MetaReader.getRegion(ct, tableNameOrRegionName);
if (pair == null || pair.getSecond() == null) {
LOG.info("No server in .META. for " +
Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + pair);
} else {
ServerName sn = pair.getSecond();
HRegionInterface rs =
this.connection.getHRegionConnection(sn.getHostname(), sn.getPort());
return CompactionState.valueOf(
rs.getCompactionState(pair.getFirst().getRegionName()));
}
} else {
final String tableName = tableNameString(tableNameOrRegionName, ct);
List<Pair<HRegionInfo, ServerName>> pairs =
MetaReader.getTableRegionsAndLocations(ct, tableName);
for (Pair<HRegionInfo, ServerName> pair: pairs) {
if (pair.getFirst().isOffline()) continue;
if (pair.getSecond() == null) continue;
try {
ServerName sn = pair.getSecond();
HRegionInterface rs =
this.connection.getHRegionConnection(sn.getHostname(), sn.getPort());
switch (CompactionState.valueOf(
rs.getCompactionState(pair.getFirst().getRegionName()))) {
case MAJOR_AND_MINOR:
return CompactionState.MAJOR_AND_MINOR;
case MAJOR: