HBASE-4003 Cleanup Calls Conservatively On Timeout - revert

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1145766 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-07-12 20:53:06 +00:00
parent f7ea5fe685
commit 16a366b5cd
2 changed files with 6 additions and 19 deletions

View File

@ -304,7 +304,6 @@ Release 0.91.0 - Unreleased
HBASE-4010 HMaster.createTable could be heavily optimized HBASE-4010 HMaster.createTable could be heavily optimized
HBASE-3506 Ability to disable, drop and enable tables using regex expression HBASE-3506 Ability to disable, drop and enable tables using regex expression
(Joey Echeverria via Ted Yu) (Joey Echeverria via Ted Yu)
HBASE-4003 Cleanup Calls Conservatively On Timeout (Karthick Sankarachary)
HBASE-3516 Coprocessors: add test cases for loading coprocessor jars HBASE-3516 Coprocessors: add test cases for loading coprocessor jars
(Mingjie Lai via garyh) (Mingjie Lai via garyh)
HBASE-4036 Implementing a MultipleColumnPrefixFilter (Anirudh Todi) HBASE-4036 Implementing a MultipleColumnPrefixFilter (Anirudh Todi)

View File

@ -167,11 +167,9 @@ public class HBaseClient {
Writable value; // value, null if error Writable value; // value, null if error
IOException error; // exception, null if value IOException error; // exception, null if value
boolean done; // true when call is done boolean done; // true when call is done
long startTime;
protected Call(Writable param) { protected Call(Writable param) {
this.param = param; this.param = param;
this.startTime = System.currentTimeMillis();
synchronized (HBaseClient.this) { synchronized (HBaseClient.this) {
this.id = counter++; this.id = counter++;
} }
@ -203,10 +201,6 @@ public class HBaseClient {
this.value = value; this.value = value;
callComplete(); callComplete();
} }
public long getStartTime() {
return this.startTime;
}
} }
/** Thread that reads responses and notifies callers. Each connection owns a /** Thread that reads responses and notifies callers. Each connection owns a
@ -580,7 +574,7 @@ public class HBaseClient {
// since we expect certain responses to not make it by the specified // since we expect certain responses to not make it by the specified
// {@link ConnectionId#rpcTimeout}. // {@link ConnectionId#rpcTimeout}.
closeException = ste; closeException = ste;
cleanupCalls(remoteId.rpcTimeout); cleanupCalls();
} else { } else {
// Since the server did not respond within the default ping interval // Since the server did not respond within the default ping interval
// time, treat this as a fatal condition and close this connection // time, treat this as a fatal condition and close this connection
@ -641,21 +635,15 @@ public class HBaseClient {
/* Cleanup all calls and mark them as done */ /* Cleanup all calls and mark them as done */
private void cleanupCalls() { private void cleanupCalls() {
cleanupCalls(0);
}
private synchronized void cleanupCalls(long rpcTimeout) {
Iterator<Entry<Integer, Call>> itor = calls.entrySet().iterator() ; Iterator<Entry<Integer, Call>> itor = calls.entrySet().iterator() ;
while (itor.hasNext()) { while (itor.hasNext()) {
Call c = itor.next().getValue(); Call c = itor.next().getValue();
if (System.currentTimeMillis() - c.getStartTime() > rpcTimeout) { c.setException(closeException); // local exception
c.setException(closeException); // local exception // Notify the open calls, so they are aware of what just happened
// Notify the open calls, so they are aware of what just happened synchronized (c) {
synchronized (c) { c.notifyAll();
c.notifyAll();
}
itor.remove();
} }
itor.remove();
} }
} }
} }