Skip to content

Commit

Permalink
Merge pull request #1 from citrusleaf/pull_req
Browse files Browse the repository at this point in the history
Added param to send user defined key to store in record. few param na…
  • Loading branch information
sud82 authored Apr 28, 2017
2 parents c9c7bb8 + d15a9b3 commit e5a8ff4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 24 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ __Options__:
-tz,--timezone <arg> TimeZone of source where datadump is taken (default: local timeZone)
-ec,--abort-Error-Count<arg> Abort when error occurs more than this value (default: 0 (don`t abort))
-wa,--write-Action <arg> Write action if key already exists (default: update)
-tls,--tls-enable Use TLS/SSL sockets(default: False)
-tp,--tls-protocols Allow TLS protocols. Values: SSLv3,TLSv1,TLSv1.1,TLSv1.2 separated by comma (default: TLSv1.2)
-tlsCiphers,--tls-cipher-suite Allow TLS cipher suites. Values: cipher names defined by JVM separated by comma (default: null (default cipher list provided by JVM))
-tr,--tls-revoke Revoke certificates identified by their serial number. Values: serial numbers separated by comma (default: null (Do not revoke certificates))
-te,--tls-encrypt-only Enable TLS encryption and disable TLS certificate validation
-uk,--send-user-key Send user defined key in addition to hash digest to store on the server. (default: userKey is not sent to reduce meta-data overhead)
-u,--usage Print usage.
-v,--verbose Verbose mode for debug logging (default: INFO)
-tls,--tlsEnable Use TLS/SSL sockets(default: False)
-tp,--tlsProtocols Allow TLS protocols. Values: SSLv3,TLSv1,TLSv1.1,TLSv1.2 separated by comma (default: TLSv1.2)
-tlsCiphers,--tlsCipherSuite Allow TLS cipher suites. Values: cipher names defined by JVM separated by comma (default: null (default cipher list provided by JVM))
-tr,--tlsRevoke Revoke certificates identified by their serial number. Values: serial numbers separated by comma (default: null (Do not revoke certificates))
-te,--tlsEncryptOnly Enable TLS encryption and disable TLS certificate validation
```

For more details, refer to [Options](doc/options.md).
Expand Down
11 changes: 6 additions & 5 deletions doc/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
| -tz <timezone> | Time zone of data backup source. This value is used when loading data of timestamp datatype. For example, if data backup location timezone is X and that data is to be loaded into server located in Y timezone, then specify X's timezone. Valid values are standard three-letter codes such as PST, EST, etc. | local timezone |
| -ec <abort-error-count> | Error threshold to determine when the loader should stop loading data. Set it to 0 to ignore the threshold. | 0 |
| -wa <write-action> | The possible values are: 1) UPDATE - Create or update records. Merge incoming bin values with existing ones, 2) UPDATE_ONLY - Update existing records. Fail if record does not exist. Merge incoming bin values with existing ones, 3) REPLACE - Create or replace existing records, 4) REPLACE_ONLY - Replace existing records. Fail if record does not exist, 5) CREATE_ONLY - Create new records. Fail if record already exists. | UPDATE |
| -tls <tlsEnable> | Use TLS/SSL sockets | False |
| -tp <tlsProtocols> | Allow TLS protocols. Values: SSLv3,TLSv1,TLSv1.1,TLSv1.2 separated by comma | TLSv1.2) |
| -tlsCiphers <tlsCipherSuite> | Allow TLS cipher suites. Values: cipher names defined by JVM separated by comma | null (default cipher list provided by JVM)|
| -tr <tlsRevoke> | Revoke certificates identified by their serial number. Values: serial numbers separated by comma | null (Do not revoke certificates)|
| -te <tlsEncryptOnly> | Enable TLS encryption and disable TLS certificate validation
| -tls <tls-enable> | Use TLS/SSL sockets | False |
| -tp <tls-protocols> | Allow TLS protocols. Values: SSLv3,TLSv1,TLSv1.1,TLSv1.2 separated by comma | TLSv1.2) |
| -tlsCiphers <tls-cipher-suite> | Allow TLS cipher suites. Values: cipher names defined by JVM separated by comma | null (default cipher list provided by JVM)|
| -tr <tls-revoke> | Revoke certificates identified by their serial number. Values: serial numbers separated by comma | null (Do not revoke certificates)|
| -te <tls-encrypt-only> | Enable TLS encryption and disable TLS certificate validation
| -uk <send-user-key> | Send user defined key in addition to hash digest to store on the server. (default: userKey is not sent to reduce meta-data overhead).
| -v | Verbose mode. If this option is specified, verbose mode is enabled and additional information is displayed on the console. | DISABLED |
| -u | Display command usage. | |
29 changes: 16 additions & 13 deletions src/main/java/com/aerospike/load/AerospikeLoad.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
* -tz,--timezone <arg> TimeZone of source where datadump is taken (default: local timeZone)
* -ec,--abort-Error-Count<arg> Abort when error occurs more than this value(default: 0(don't abort))
* -wa,--write-Action <arg> Write action if key already exists (default: update)
* -tls,--tls-enable Use TLS/SSL sockets(default: False)
* -tp,--tls-protocols Allow TLS protocols. Values: SSLv3,TLSv1,TLSv1.1,TLSv1.2 separated by comma (default: TLSv1.2)
* -tlsCiphers,--tls-cipher-suite Allow TLS cipher suites. Values: cipher names defined by JVM separated by comma (default: null (default cipher list provided by JVM))
* -tr,--tls-revoke Revoke certificates identified by their serial number. Values: serial numbers separated by comma (default: null (Do not revoke certificates))
* -te,--tls-encrypt-only Enable TLS encryption and disable TLS certificate validation
* -uk,--send-user-key Send user defined key in addition to hash digest to store on the server. (default: userKey is not sent to reduce meta-data overhead)
* -u,--usage Print usage.
* -v,--verbose Verbose mode for debug logging (default: INFO)
* -tls,--tlsEnable Use TLS/SSL sockets(default: False)
* -tp,--tlsProtocols Allow TLS protocols. Values: SSLv3,TLSv1,TLSv1.1,TLSv1.2 separated by comma (default: TLSv1.2)
* -tlsCiphers,--tlsCipherSuite Allow TLS cipher suites. Values: cipher names defined by JVM separated by comma (default: null (default cipher list provided by JVM))
* -tr,--tlsRevoke Revoke certificates identified by their serial number. Values: serial numbers separated by comma (default: null (Do not revoke certificates))
* -te,--tlsEncryptOnly Enable TLS encryption and disable TLS certificate validation
*
* The file names can be a series of file names or directories.
*
* @author Aerospike
Expand Down Expand Up @@ -146,27 +146,30 @@ public static void main(String[] args) throws IOException {
options.addOption("tz", "timezone", true, "Timezone of source where data dump is taken (default: local timezone)");
options.addOption("ec", "abort-error-count", true, "Error count to abort (default: 0)");
options.addOption("wa", "write-action", true, "Write action if key already exists (default: update)");
options.addOption("v", "verbose", false, "Logging all");
options.addOption("u", "usage", false, "Print usage.");
options.addOption("tls", "tlsEnable", false, "Use TLS/SSL sockets");
options.addOption("tp", "tlsProtocols", true,
options.addOption("tls", "tls-enable", false, "Use TLS/SSL sockets");
options.addOption("tp", "tls-protocols", true,
"Allow TLS protocols\n" +
"Values: SSLv3,TLSv1,TLSv1.1,TLSv1.2 separated by comma\n" +
"Default: TLSv1.2"
);
options.addOption("tlsCiphers", "tlsCipherSuite", true,
options.addOption("tlsCiphers", "tls-cipher-suite", true,
"Allow TLS cipher suites\n" +
"Values: cipher names defined by JVM separated by comma\n" +
"Default: null (default cipher list provided by JVM)"
);
options.addOption("tr", "tlsRevoke", true,
options.addOption("tr", "tls-revoke", true,
"Revoke certificates identified by their serial number\n" +
"Values: serial numbers separated by comma\n" +
"Default: null (Do not revoke certificates)"
);
options.addOption("te", "tlsEncryptOnly", false,
options.addOption("te", "tls-encrypt-only", false,
"Enable TLS encryption and disable TLS certificate validation"
);
options.addOption("uk", "send-user-key", false,
"Send user defined key in addition to hash digest to store on the server. (default: userKey is not sent to reduce meta-data overhead)"
);
options.addOption("v", "verbose", false, "Logging all");
options.addOption("u", "usage", false, "Print usage.");

CommandLineParser parser = new PosixParser();
CommandLine cl = parser.parse(options, args, false);
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/com/aerospike/load/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,19 @@ protected static Parameters parseParameters(CommandLine cl) throws Exception {

String timeout = cl.getOptionValue("T", "0");
int timeout_int = (Integer.parseInt(timeout));


boolean sendKey = false;
if (cl.hasOption("uk")) {
sendKey = true;
}

String writeAction = cl.getOptionValue("wa", "UPDATE");

WritePolicy writePolicy = new WritePolicy();
writePolicy.recordExistsAction = RecordExistsAction.valueOf(writeAction.toUpperCase());
writePolicy.timeout = timeout_int;
writePolicy.expiration = ttl;
writePolicy.sendKey = sendKey;


boolean verbose = false;
Expand Down

0 comments on commit e5a8ff4

Please sign in to comment.