HBASE-10310. ZNodeCleaner session expired for /hbase/master (Samir Ahmic)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1557273 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5f5ce57c9a
commit
b8c7e3e380
|
@ -18,12 +18,6 @@
|
|||
|
||||
package org.apache.hadoop.hbase;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
|
||||
import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
|
@ -32,6 +26,12 @@ import java.io.FileReader;
|
|||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
|
||||
import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
|
||||
|
||||
/**
|
||||
* <p>Contains a set of methods for the collaboration between the start/stop scripts and the
|
||||
* servers. It allows to delete immediately the znode when the master or the regions server crashes.
|
||||
|
@ -146,6 +146,7 @@ public class ZNodeClearer {
|
|||
String znodeFileContent;
|
||||
try {
|
||||
znodeFileContent = ZNodeClearer.readMyEphemeralNodeOnDisk();
|
||||
return MasterAddressTracker.deleteIfEquals(zkw, znodeFileContent);
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
// If no file, just keep going -- return success.
|
||||
LOG.warn("Can't find the znode file; presume non-fatal", fnfe);
|
||||
|
@ -156,7 +157,5 @@ public class ZNodeClearer {
|
|||
} finally {
|
||||
zkw.close();
|
||||
}
|
||||
|
||||
return MasterAddressTracker.deleteIfEquals(zkw, znodeFileContent);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue