HBASE-9329 SnapshotManager should check for directory existance before throwing a warning (Jean-Marc Spaggiari)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1517608 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
mbertozzi 2013-08-26 17:08:43 +00:00
parent f3fbf8c5d2
commit 5700f61b95
1 changed files with 4 additions and 3 deletions

View File

@ -57,7 +57,6 @@ import org.apache.hadoop.hbase.procedure.Procedure;
import org.apache.hadoop.hbase.procedure.ProcedureCoordinator; import org.apache.hadoop.hbase.procedure.ProcedureCoordinator;
import org.apache.hadoop.hbase.procedure.ProcedureCoordinatorRpcs; import org.apache.hadoop.hbase.procedure.ProcedureCoordinatorRpcs;
import org.apache.hadoop.hbase.procedure.ZKProcedureCoordinatorRpcs; import org.apache.hadoop.hbase.procedure.ZKProcedureCoordinatorRpcs;
import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription.Type; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription.Type;
import org.apache.hadoop.hbase.snapshot.ClientSnapshotDescriptionUtils; import org.apache.hadoop.hbase.snapshot.ClientSnapshotDescriptionUtils;
@ -268,10 +267,12 @@ public class SnapshotManager implements Stoppable {
void resetTempDir() throws IOException { void resetTempDir() throws IOException {
// cleanup any existing snapshots. // cleanup any existing snapshots.
Path tmpdir = SnapshotDescriptionUtils.getWorkingSnapshotDir(rootDir); Path tmpdir = SnapshotDescriptionUtils.getWorkingSnapshotDir(rootDir);
if (master.getMasterFileSystem().getFileSystem().exists(tmpdir)) {
if (!master.getMasterFileSystem().getFileSystem().delete(tmpdir, true)) { if (!master.getMasterFileSystem().getFileSystem().delete(tmpdir, true)) {
LOG.warn("Couldn't delete working snapshot directory: " + tmpdir); LOG.warn("Couldn't delete working snapshot directory: " + tmpdir);
} }
} }
}
/** /**
* Delete the specified snapshot * Delete the specified snapshot