-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
batch reads options added #61
Conversation
} | ||
|
||
public Map<StaticBuffer,EntryList> getSlice(String storeName, List<StaticBuffer> keys, SliceQuery query, StoreTransaction txh) throws BackendException { | ||
if(keys.size() == 1){ | ||
StaticBuffer key = keys.get(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
due to abstraction level better to extract get single element logic to separate method
return Collections.singletonMap(key, | ||
getSlice(storeName, new KeySliceQuery(key, query.getSliceStart(), query.getSliceEnd()), txh)); | ||
} else if(keys.size() < bathReadThreshold){ | ||
return getSliceParallel(storeName, keys, query, txh); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd rather rename it to getSliceInParallel
} | ||
} | ||
|
||
public Map<StaticBuffer,EntryList> getSliceBatch(String storeName, List<StaticBuffer> keys, SliceQuery query, StoreTransaction txh) throws BackendException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd rather rename it to getSliceByBatch
final EntryArrayList result = new EntryArrayList(); | ||
entriesMap.entrySet().stream() | ||
.limit(entriesNo) | ||
.forEach(entry -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use here collect(customCollector())
79eac81
to
196d999
Compare
...orage-backend/src/main/java/com/playtika/janusgraph/aerospike/operations/ReadOperations.java
Outdated
Show resolved
Hide resolved
196d999
to
84ca1cf
Compare
No description provided.