Commit 9aa32a56 authored by NILANJAN DAW's avatar NILANJAN DAW

Async mode StorageService made cache flag aware. Async Storage no more sharing stubs.

parent d7f831b2
......@@ -47,6 +47,8 @@ public class ClientRunner {
private int threadCount;
private int rps;
AtomicDouble openCount;
private boolean cacheEnabled;
public ClientRunner() {
clientID = UUID.randomUUID().toString();
generatedPacket = Collections.synchronizedList(new ArrayList<>());
......@@ -60,6 +62,7 @@ public class ClientRunner {
this.rps = Integer.parseInt((String) properties.get("app.rps"));
this.threadCount = Integer.parseInt((String) properties.get("app.thread_count"));
runtime = Integer.parseInt((String) properties.get("app.runtime"));
this.cacheEnabled = properties.get("app.cache").equals("1");
this.cCreate = Integer.parseInt((String) properties.get("app.cycle_create"));
this.cRead = Integer.parseInt((String) properties.get("app.cycle_read"));
......@@ -144,7 +147,7 @@ public class ClientRunner {
public double runExperimentByRps(String threadId) throws InterruptedException, ExecutionException {
String value = createString(), updatedValue = createString();
StorageService storageService = new StorageService(clientID);
StorageService storageService = new StorageService(clientID, this.cacheEnabled);
storageService.initStorage();
this.seedServer(storageService, value, threadId);
......@@ -342,7 +345,7 @@ public class ClientRunner {
propertiesFile = args[0];
ClientRunner clientRunner = new ClientRunner();
System.out.println(clientRunner.getGreeting());
StorageService storageService = new StorageService(clientRunner.clientID);
StorageService storageService = new StorageService(clientRunner.clientID, clientRunner.cacheEnabled);
storageService.initStorage();
System.out.println("storage initialised");
clientRunner.seedServer(storageService, clientRunner.createString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment