-
Notifications
You must be signed in to change notification settings - Fork 102
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
Generic Key generators #214
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
* | ||
* @author vchella, pencal | ||
*/ | ||
public interface NdBenchAbstractClient<W> { | ||
public interface NdBenchAbstractClient<K, W> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please document the addition of parameter K. Also, is it OK not to narrow down the expected superclass/interfaces for K? |
||
|
||
/** | ||
* Initialize the client | ||
|
@@ -47,31 +47,31 @@ public interface NdBenchAbstractClient<W> { | |
* @return | ||
* @throws Exception | ||
*/ | ||
String readSingle(final String key) throws Exception; | ||
String readSingle(final K key) throws Exception; | ||
|
||
/** | ||
* Perform a bulk read operation given the list of keys | ||
* | ||
* @return | ||
* @throws Exception | ||
*/ | ||
List<String> readBulk(final List<String> keys) throws Exception; | ||
List<String> readBulk(final List<K> keys) throws Exception; | ||
|
||
/** | ||
* Perform a single write operation | ||
* | ||
* @return | ||
* @throws Exception | ||
*/ | ||
W writeSingle(final String key) throws Exception; | ||
W writeSingle(final K key) throws Exception; | ||
|
||
/** | ||
* Perform bulk write operation given the list of keys | ||
* | ||
* @param keys | ||
* @return | ||
*/ | ||
List<W> writeBulk(final List<String> keys) throws Exception; | ||
List<W> writeBulk(final List<K> keys) throws Exception; | ||
|
||
/** | ||
* shutdown the client | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.netflix.ndbench.core; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a license header |
||
|
||
import java.util.List; | ||
import java.util.concurrent.atomic.AtomicReference; | ||
|
||
import com.google.common.util.concurrent.RateLimiter; | ||
|
||
import com.netflix.ndbench.api.plugin.NdBenchMonitor; | ||
|
||
public interface NdBenchOperation<K> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a classdoc. also, is there some functional interface we could make this interface extend? like for example Function or BiFunction? |
||
boolean process(NdBenchDriver driver, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add javadoc on the spec |
||
NdBenchMonitor monitor, | ||
List<K> keys, | ||
AtomicReference<RateLimiter> rateLimiter, | ||
boolean isAutoTuneEnabled); | ||
|
||
boolean isReadType(); | ||
|
||
boolean isWriteType(); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a newline at the end of file |
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.
while we are in here, lets discuss the naming of parameter W. W stands for write because it is the type returned by writeSingle but it is not descriptive of what the type is. Can we rename W to PostImageType or am I thinking about it too much?