connectionManager.setMaxTotal(numThreads);
connectionManager.setDefaultMaxPerRoute(numThreads);
HttpConnectionParams.setStaleCheckingEnabled(clientParams, false);
final HttpStore httpStore = new HttpStore("test",
"localhost",
8080,
httpClient,
new RequestFormatFactory().getRequestFormat(RequestFormatType.VOLDEMORT_V0),
false);
Thread.sleep(400);
PerformanceTest httpWriteTest = new PerformanceTest() {
@Override
public void doOperation(int i) {
byte[] key = String.valueOf(i).getBytes();
httpStore.put(new ByteArray(key), new Versioned<byte[]>(key), null);
}
};
System.out.println("###########################################");
System.out.println("Performing HTTP write test.");
httpWriteTest.run(numRequests, numThreads);
httpWriteTest.printStats();
System.out.println();
PerformanceTest httpReadTest = new PerformanceTest() {
@Override
public void doOperation(int i) {
httpStore.get(new ByteArray(String.valueOf(i).getBytes()), null);
}
};
System.out.println("Performing HTTP read test.");
httpReadTest.run(numRequests, numThreads);
httpReadTest.printStats();