Skip to content

Commit

Permalink
FMWK-222 Add the sendKey property to all Policy classes (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn authored Aug 14, 2023
1 parent ac17186 commit 69db958
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ private WritePolicy setupWritePolicy(AerospikeProperties properties) {
WritePolicy policy = new WritePolicy();
setGeneralPolicyProperties(policy, writePolicyDefault);
whenPresent(writePolicyDefault.durableDelete, p -> policy.durableDelete = p);
whenPresent(writePolicyDefault.sendKey, p -> policy.sendKey = p);
return policy;
}

Expand Down Expand Up @@ -147,6 +146,7 @@ private void setGeneralPolicyProperties(Policy policy, AerospikeProperties.Polic
whenPresent(policyDefault.timeoutDelay, p -> policy.timeoutDelay = (int) p.toMillis());
whenPresent(policyDefault.maxRetries, p -> policy.maxRetries = p);
whenPresent(policyDefault.sleepBetweenRetries, p -> policy.sleepBetweenRetries = (int) p.toMillis());
whenPresent(policyDefault.sendKey, p -> policy.sendKey = p);
}

private <T> void whenPresent(T param, Consumer<T> consumer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ public abstract static class PolicyDefault {
* Time to sleep between retries.
*/
public Duration sleepBetweenRetries;

/**
* If the key is sent on a write, the key will be stored with the record on the server.
*/
public Boolean sendKey;
}

/**
Expand Down Expand Up @@ -191,11 +196,6 @@ public static class ReadPolicyDefault extends PolicyDefault {
@Data
public static class WritePolicyDefault extends PolicyDefault {

/**
* If the key is sent on a write, the key will be stored with the record on the server.
*/
public Boolean sendKey;

/**
* If the transaction results in a record deletion, leave a tombstone for the record.
*/
Expand All @@ -212,10 +212,12 @@ public static class BatchPolicyDefault extends PolicyDefault {
* Number of concurrent synchronous batch request threads to server nodes.
*/
public Integer maxConcurrentThreads;

/**
* Allow batch to be processed immediately in the server's receiving thread.
*/
public Boolean allowInline;

/**
* Send set name for every key in the batch.
*/
Expand Down

0 comments on commit 69db958

Please sign in to comment.