Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr committed Dec 10, 2024
1 parent 33a81f8 commit 598c258
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ private <T> void batchWriteAllDocuments(List<T> documents, String setName, Opera

List<BatchRecord> batchWriteRecords = batchWriteDataList.stream().map(BatchWriteData::batchRecord).toList();
try {
BatchPolicy bPolicy = (BatchPolicy) enrichPolicyWithTransaction(client, client.getBatchPolicyDefault());
client.operate(bPolicy, batchWriteRecords);
BatchPolicy batchPolicy = (BatchPolicy) enrichPolicyWithTransaction(client, client.getBatchPolicyDefault());
client.operate(batchPolicy, batchWriteRecords);
} catch (AerospikeException e) {
throw translateError(e); // no exception is thrown for versions mismatch, only record's result code shows it
}
Expand Down Expand Up @@ -944,8 +944,8 @@ public GroupedEntities findByIds(GroupedKeys groupedKeys) {

private GroupedEntities findGroupedEntitiesByGroupedKeys(GroupedKeys groupedKeys) {
EntitiesKeys entitiesKeys = EntitiesKeys.of(toEntitiesKeyMap(groupedKeys));
BatchPolicy bPolicy = (BatchPolicy) enrichPolicyWithTransaction(client, client.getBatchPolicyDefault());
Record[] aeroRecords = client.get(bPolicy, entitiesKeys.getKeys());
BatchPolicy batchPolicy = (BatchPolicy) enrichPolicyWithTransaction(client, client.getBatchPolicyDefault());
Record[] aeroRecords = client.get(batchPolicy, entitiesKeys.getKeys());

return toGroupedEntities(entitiesKeys, aeroRecords);
}
Expand Down Expand Up @@ -1540,13 +1540,13 @@ private List<KeyRecord> findByIdsWithoutMapping(Collection<?> ids, String setNam
try {
Key[] keys = getKeys(ids, setName);

BatchPolicy bPolicy = (BatchPolicy) enrichPolicyWithTransaction(client, getBatchPolicyFilterExp(query));
BatchPolicy batchPolicy = (BatchPolicy) enrichPolicyWithTransaction(client, getBatchPolicyFilterExp(query));
Record[] aeroRecords;
if (targetClass != null) {
String[] binNames = getBinNamesFromTargetClass(targetClass, mappingContext);
aeroRecords = client.get(bPolicy, keys, binNames);
aeroRecords = client.get(batchPolicy, keys, binNames);
} else {
aeroRecords = client.get(bPolicy, keys);
aeroRecords = client.get(batchPolicy, keys);
}

return IntStream.range(0, keys.length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ private Mono<GroupedEntities> findGroupedEntitiesByGroupedKeys(BatchPolicy batch
EntitiesKeys entitiesKeys = EntitiesKeys.of(toEntitiesKeyMap(groupedKeys));

return enrichPolicyWithTransaction(reactorClient, batchPolicy)
.flatMap(bPolicy -> reactorClient.get((BatchPolicy) bPolicy, entitiesKeys.getKeys()))
.flatMap(batchPolicyEnriched -> reactorClient.get((BatchPolicy) batchPolicyEnriched, entitiesKeys.getKeys()))
.map(item -> toGroupedEntities(entitiesKeys, item.records))
.onErrorMap(this::translateError);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ private static Policy getNewPolicy(Policy policy) {
return new WritePolicy(writePolicy);
} else if (policy instanceof BatchPolicy batchPolicy) {
return new BatchPolicy(batchPolicy);
} else {
return new Policy(policy);
}
return new Policy(policy);
}

private static Policy getPolicyFilterExp(IAerospikeClient client, QueryEngine queryEngine, Query query) {
Expand Down

0 comments on commit 598c258

Please sign in to comment.