Skip to content

Commit

Permalink
Added @OverRide to some methods as Eclipse asked me to. Fixed missing…
Browse files Browse the repository at this point in the history
… include in test.
  • Loading branch information
jayjwylie committed Oct 9, 2012
1 parent 1890420 commit 31bc42e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 20.8-b03-424 (Apple Inc.)
Created-By: 20.2-b06 (Sun Microsystems Inc.)
Implementation-Title: Voldemort
Implementation-Version: 0.90.1
Implementation-Version: 0.96
Implementation-Vendor: LinkedIn

Expand Up @@ -132,6 +132,7 @@ public ClientRequestExecutorFactory getFactory() {
return factory;
}

@Override
public SocketStore create(String storeName,
String hostName,
int port,
Expand Down Expand Up @@ -189,6 +190,7 @@ public void checkin(SocketDestination destination, ClientRequestExecutor clientR
}
}

@Override
public void close(SocketDestination destination) {
factory.setLastClosedTimestamp(destination);
queuedPool.reset(destination);
Expand All @@ -197,6 +199,7 @@ public void close(SocketDestination destination) {
/**
* Close the socket pool
*/
@Override
public void close() {
// unregister MBeans
if(stats != null) {
Expand Down Expand Up @@ -269,6 +272,7 @@ protected void updateStats() {
}
}

@Override
public void useResource(ClientRequestExecutor clientRequestExecutor) {
updateStats();
if(logger.isDebugEnabled()) {
Expand Down Expand Up @@ -297,13 +301,15 @@ public void useResource(ClientRequestExecutor clientRequestExecutor) {
clientRequestExecutor.addClientRequest(clientRequest, timeoutMs);
}

@Override
public void handleTimeout() {
// Do *not* invoke updateStats since handleException does so.
long durationNs = System.nanoTime() - startTimeNs;
handleException(new TimeoutException("Could not acquire resource in " + timeoutMs
+ " ms. (Took " + durationNs + " ns.)"));
}

@Override
public void handleException(Exception e) {
updateStats();
if(!(e instanceof UnreachableStoreException))
Expand All @@ -317,6 +323,7 @@ public void handleException(Exception e) {
}
}

@Override
public long getDeadlineNs() {
return startTimeNs + TimeUnit.MILLISECONDS.toNanos(timeoutMs);
}
Expand Down Expand Up @@ -373,6 +380,7 @@ private void invokeCallback(Object o, long requestTime) {
}
}

@Override
public void complete() {
try {
clientRequest.complete();
Expand All @@ -389,33 +397,40 @@ public void complete() {
}
}

@Override
public boolean isComplete() {
return isComplete;
}

@Override
public boolean formatRequest(DataOutputStream outputStream) {
return clientRequest.formatRequest(outputStream);
}

@Override
public T getResult() throws VoldemortException, IOException {
return clientRequest.getResult();
}

@Override
public boolean isCompleteResponse(ByteBuffer buffer) {
return clientRequest.isCompleteResponse(buffer);
}

@Override
public void parseResponse(DataInputStream inputStream) {
clientRequest.parseResponse(inputStream);
}

@Override
public void timeOut() {
clientRequest.timeOut();
invokeCallback(new StoreTimeoutException("ClientRequestExecutor timed out. Cannot complete request."),
(System.nanoTime() - startNs) / Time.NS_PER_MS);
checkin(destination, clientRequestExecutor);
}

@Override
public boolean isTimedOut() {
return clientRequest.isTimedOut();
}
Expand Down
3 changes: 3 additions & 0 deletions test/unit/voldemort/client/AdminServiceBasicTest.java
Expand Up @@ -17,7 +17,10 @@
package voldemort.client;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
Expand Down

0 comments on commit 31bc42e

Please sign in to comment.