Skip to content

Commit

Permalink
Small changes to the client code
Browse files Browse the repository at this point in the history
  • Loading branch information
rohancme committed May 1, 2015
1 parent 6ef5666 commit 045a983
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 7 additions & 3 deletions src/edu/tomr/client/InitializeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private static void generateRequests(ClientRequestType requestType, int requestL
e.printStackTrace();
}
String randomString = generateString(requestLength);
ExecutorService executor = Executors.newFixedThreadPool(5);
ExecutorService executor = Executors.newFixedThreadPool(10);
for(int i=1; i<=numOfRequests; i++){
//ClientServiceMessage serviceMessage = getServiceMessage();
//Connection nodeConnection=new Connection(serviceMessage.getServiceIPAddress(),servicerNodePort);
Expand Down Expand Up @@ -81,7 +81,11 @@ private static String generateString(int requestLength) {
}

public static void main(String[] args) {

generateRequests(ClientRequestType.ADD, 50, 5);
serverIP = ConfigParams.getProperty("LB_IP");
long startTime = System.nanoTime();
//generateRequests(ClientRequestType.ADD, 1000, 2000);
generateRequests(ClientRequestType.GET, 50, 2000);
long endTime = System.nanoTime();
System.out.println("Took "+((endTime - startTime)/1000000) + " ms");
}
}
7 changes: 1 addition & 6 deletions src/edu/tomr/queue/NodeQueueProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,11 @@ public void run() {
boolean running = true;

while(running) {
try {
Thread.sleep(50);

if(!queue.isEmpty()){
DBMessage msg = (DBMessage)queue.dequeueMessage();
handleMessage(msg);
}
} catch (InterruptedException e) {
running = false;
e.printStackTrace();
}
}
}

Expand Down

0 comments on commit 045a983

Please sign in to comment.