HBASE-7944 Replication leaks file reader resource & not reset currentNbOperations (Jeffrey Zhong)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1450901 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2013-02-27 18:29:01 +00:00
parent 2e2d95af14
commit 76314737e3
2 changed files with 8 additions and 2 deletions

View File

@ -123,15 +123,20 @@ public class ReplicationHLogReaderManager {
public void closeReader() throws IOException {
if (this.reader != null) {
this.reader.close();
this.reader = null;
}
}
/**
* Tell the helper to reset internal state
*/
public void finishCurrentFile() {
void finishCurrentFile() {
this.position = 0;
this.reader = null;
try {
this.closeReader();
} catch (IOException e) {
LOG.warn("Unable to close reader", e);
}
}
}

View File

@ -327,6 +327,7 @@ public class ReplicationSource extends Thread
}
boolean gotIOE = false;
currentNbOperations = 0;
currentNbEntries = 0;
currentSize = 0;
try {