HBASE-7588 Fix two findbugs warning in MemStoreFlusher; REAPPLIED

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1437154 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2013-01-22 20:45:40 +00:00
parent 461c3c0e7f
commit f60b8246e7
1 changed files with 22 additions and 4 deletions

View File

@ -500,21 +500,21 @@ class MemStoreFlusher extends HasThread implements FlushRequester {
return "flush_queue="
+ flushQueue.size();
}
public String dumpQueue() {
StringBuilder queueList = new StringBuilder();
queueList.append("Flush Queue Queue dump:\n");
queueList.append(" Flush Queue:\n");
java.util.Iterator<FlushQueueEntry> it = flushQueue.iterator();
while(it.hasNext()){
queueList.append(" "+it.next().toString());
queueList.append("\n");
}
return queueList.toString();
}
interface FlushQueueEntry extends Delayed {}
/**
@ -530,6 +530,12 @@ class MemStoreFlusher extends HasThread implements FlushRequester {
public int compareTo(Delayed o) {
return -1;
}
@Override
public boolean equals(Object obj) {
return (this == obj);
}
}
/**
@ -597,5 +603,17 @@ class MemStoreFlusher extends HasThread implements FlushRequester {
public String toString() {
return "[flush region " + Bytes.toStringBinary(region.getRegionName()) + "]";
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
Delayed other = (Delayed) obj;
return compareTo(other) == 0;
}
}
}