HBASE-3612 HBaseAdmin::isTableAvailable returns true when the table does not exit
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1080397 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
79eb3c26a2
commit
d86e7e1c18
|
@ -62,6 +62,8 @@ Release 0.91.0 - Unreleased
|
||||||
on OOME
|
on OOME
|
||||||
HBASE-1960 Master should wait for DFS to come up when creating
|
HBASE-1960 Master should wait for DFS to come up when creating
|
||||||
hbase.version; use alternate strategy for waiting for DNs
|
hbase.version; use alternate strategy for waiting for DNs
|
||||||
|
HBASE-3612 HBaseAdmin::isTableAvailable returns true when the table does
|
||||||
|
not exit
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
|
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
|
||||||
|
|
|
@ -31,6 +31,7 @@ import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
@ -443,6 +444,7 @@ public class HConnectionManager {
|
||||||
|
|
||||||
public boolean isTableAvailable(final byte[] tableName) throws IOException {
|
public boolean isTableAvailable(final byte[] tableName) throws IOException {
|
||||||
final AtomicBoolean available = new AtomicBoolean(true);
|
final AtomicBoolean available = new AtomicBoolean(true);
|
||||||
|
final AtomicInteger regionCount = new AtomicInteger(0);
|
||||||
MetaScannerVisitor visitor = new MetaScannerVisitor() {
|
MetaScannerVisitor visitor = new MetaScannerVisitor() {
|
||||||
@Override
|
@Override
|
||||||
public boolean processRow(Result row) throws IOException {
|
public boolean processRow(Result row) throws IOException {
|
||||||
|
@ -457,13 +459,14 @@ public class HConnectionManager {
|
||||||
available.set(false);
|
available.set(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
regionCount.incrementAndGet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
MetaScanner.metaScan(conf, visitor);
|
MetaScanner.metaScan(conf, visitor);
|
||||||
return available.get();
|
return available.get() && (regionCount.get() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue