boolean bypass = false;
if (this.cpHost != null) {
try {
bypass = this.cpHost.preGetTableDescriptors(tableNameList, descriptors);
} catch (IOException ioe) {
throw new ServiceException(ioe);
}
}
if (!bypass) {
if (req.getTableNamesCount() == 0) {
// request for all TableDescriptors
Map<String, HTableDescriptor> descriptorMap = null;
try {
descriptorMap = this.tableDescriptors.getAll();
} catch (IOException e) {
LOG.warn("Failed getting all descriptors", e);
}
if (descriptorMap != null) {
for(HTableDescriptor desc: descriptorMap.values()) {
if(!desc.getTableName().isSystemTable()) {
descriptors.add(desc);
}
}
}
} else {
for (TableName s: tableNameList) {
try {
HTableDescriptor desc = this.tableDescriptors.get(s);
if (desc != null) {
descriptors.add(desc);
}
} catch (IOException e) {
LOG.warn("Failed getting descriptor for " + s, e);
}
}
}
if (this.cpHost != null) {
try {
this.cpHost.postGetTableDescriptors(descriptors);
} catch (IOException ioe) {
throw new ServiceException(ioe);
}
}
}
GetTableDescriptorsResponse.Builder builder = GetTableDescriptorsResponse.newBuilder();