Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fe81475
IGNITE-13320 Cache encryption key rotation CLI management.
xtern Oct 27, 2020
c567fb6
IGNITE-13320 Control reencryption using single command.
xtern Oct 28, 2020
a407eec
IGNITE_13320 Optimize pagesLeft metric calculation.
xtern Oct 29, 2020
d1fcd54
IGNITE-13320 Use common method to calculate number of bytes remaining.
xtern Oct 29, 2020
3df4094
IGNITE-13320 Use precalculated value for metric.
xtern Oct 29, 2020
3a34004
IGNITE-13320 Code cleanup.
xtern Oct 29, 2020
60b4da2
IGNITE-13320 Code cleanup (Unlimited rate flag).
xtern Oct 29, 2020
bf9b5bd
IGNITE-13320 Test for unlimited rate.
xtern Oct 29, 2020
c777f13
IGNITE-12843 Code cleanup (review notes).
xtern Oct 30, 2020
d667171
IGNITE-13320 Better arguments check in GroupReencryptionCommand.
xtern Oct 30, 2020
aa9830d
IGNITE-13320 Wrap to DTO + rafactoring.
xtern Nov 2, 2020
2b60814
IGNITE-13320 Fix after rebase.
xtern Nov 4, 2020
8f26cc8
IGNITE-13320 Simplified generics args for VisorCacheGroupEncryptionTask.
xtern Nov 5, 2020
6cb6069
IGNITE-13320 (minor) Code cleanup.
xtern Nov 5, 2020
fba0ccd
IGNITE-13320 Update classname.properties
xtern Nov 5, 2020
1b2b8d5
IGNITE-13320 Simplify generics args.
xtern Nov 5, 2020
56a6012
IGNITE-13320 Review notes.
xtern Nov 30, 2020
1d47d54
IGNITE-13320 Simplify reencryption_rate_limit command syntax.
xtern Dec 1, 2020
e83ebe1
IGNITE-13320 Notice user about unexpected behaviour of suspend/rate_l…
xtern Dec 2, 2020
f90b8f7
IGNITE-13320 (minor) Codestyle.
xtern Dec 4, 2020
0411b02
IGNITE-13320 (minor) Test improvement.
xtern Dec 4, 2020
2675dca
IGNITE-13320 Fix test (double format mismatch).
xtern Dec 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import org.apache.ignite.internal.commandline.Command;
import org.apache.ignite.internal.commandline.CommandArgIterator;
import org.apache.ignite.internal.commandline.CommandLogger;
import org.apache.ignite.internal.commandline.argument.CommandArg;
import org.apache.ignite.internal.commandline.argument.CommandArgUtils;
import org.apache.ignite.internal.visor.encryption.VisorCacheGroupEncryptionTaskResult;
import org.apache.ignite.internal.visor.encryption.VisorReencryptionRateTask;
import org.apache.ignite.internal.visor.encryption.VisorReencryptionRateTaskArg;
Expand Down Expand Up @@ -104,22 +102,13 @@ public class ReencryptionRateCommand extends AbstractCommand<VisorReencryptionRa
Double rateLimit = null;

while (argIter.hasNextSubArg()) {
String arg = argIter.nextArg("Failed to read command argument.");
String rateLimitArg = argIter.nextArg("Expected decimal value for re-encryption rate.");

ReencryptionRateCommandArg cmdArg = CommandArgUtils.of(arg, ReencryptionRateCommandArg.class);

if (cmdArg == ReencryptionRateCommandArg.LIMIT) {
String rateLimitArg = argIter.nextArg("Expected decimal value for re-encryption rate.");

try {
rateLimit = Double.parseDouble(rateLimitArg);
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Failed to parse " + ReencryptionRateCommandArg.LIMIT +
" command argument. Decimal value expected.", e);
}
try {
rateLimit = Double.parseDouble(rateLimitArg);
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Failed to parse command argument. Decimal value expected.", e);
}
else
throw new IllegalArgumentException("Unexpected command argument: " + arg);
}

taskArg = new VisorReencryptionRateTaskArg(rateLimit);
Expand All @@ -128,40 +117,12 @@ public class ReencryptionRateCommand extends AbstractCommand<VisorReencryptionRa
/** {@inheritDoc} */
@Override public void printUsage(Logger log) {
Command.usage(log, "View/change re-encryption rate limit:", ENCRYPTION,
singletonMap("limit", "Decimal value to change re-encryption rate limit (MB/s)."),
REENCRYPTION_RATE.toString(), optional(ReencryptionRateCommandArg.LIMIT, "limit"));
singletonMap("new_limit", "Decimal value to change re-encryption rate limit (MB/s)."),
REENCRYPTION_RATE.toString(), optional("new_limit"));
}

/** {@inheritDoc} */
@Override public String name() {
return REENCRYPTION_RATE.text().toUpperCase();
}

/**
* Re-encryption rate command arguments name.
*/
private enum ReencryptionRateCommandArg implements CommandArg {
/** Re-encryption rate limit argument. */
LIMIT("--limit");

/** Argument name. */
private final String name;

/**
* @param name Argument name.
*/
ReencryptionRateCommandArg(String name) {
this.name = name;
}

/** {@inheritDoc} */
@Override public String argName() {
return name;
}

/** {@inheritDoc} */
@Override public String toString() {
return name;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2742,7 +2742,7 @@ public void testChangeReencryptionRate() throws Exception {
assertEquals(EXIT_CODE_OK, ret);
assertEquals(srvNodes, countSubstrs(testOut.toString(), "re-encryption rate is not limited."));

ret = execute("--encryption", REENCRYPTION_RATE.toString(), "--limit", "0.01");
ret = execute("--encryption", REENCRYPTION_RATE.toString(), "0.01");

assertEquals(EXIT_CODE_OK, ret);
assertEquals(srvNodes, countSubstrs(testOut.toString(), "re-encryption rate has been limited to 0.01 MB/s."));
Expand All @@ -2752,7 +2752,7 @@ public void testChangeReencryptionRate() throws Exception {
assertEquals(EXIT_CODE_OK, ret);
assertEquals(srvNodes, countSubstrs(testOut.toString(), "re-encryption rate is limited to 0.01 MB/s."));

ret = execute("--encryption", REENCRYPTION_RATE.toString(), "--limit", "0");
ret = execute("--encryption", REENCRYPTION_RATE.toString(), "0");

assertEquals(EXIT_CODE_OK, ret);
assertEquals(srvNodes, countSubstrs(testOut.toString(), "re-encryption rate is not limited."));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ This utility can do the following commands:
control.(sh|bat) --encryption resume_reencryption cacheGroupName

View/change re-encryption rate limit:
control.(sh|bat) --encryption reencryption_rate_limit [--limit limit]
control.(sh|bat) --encryption reencryption_rate_limit [new_limit]

Parameters:
limit - Decimal value to change re-encryption rate limit (MB/s).
new_limit - Decimal value to change re-encryption rate limit (MB/s).

Kill compute task by session id:
control.(sh|bat) --kill COMPUTE session_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ This utility can do the following commands:
control.(sh|bat) --encryption resume_reencryption cacheGroupName

View/change re-encryption rate limit:
control.(sh|bat) --encryption reencryption_rate_limit [--limit limit]
control.(sh|bat) --encryption reencryption_rate_limit [new_limit]

Parameters:
limit - Decimal value to change re-encryption rate limit (MB/s).
new_limit - Decimal value to change re-encryption rate limit (MB/s).

Kill compute task by session id:
control.(sh|bat) --kill COMPUTE session_id
Expand Down