use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerAdminProtocolProtos.OMConfigurationResponse in project ozone by apache.
the class OMAdminProtocolClientSideImpl method getOMConfiguration.
@Override
public OMConfiguration getOMConfiguration() throws IOException {
try {
OMConfigurationResponse getConfigResponse = rpcProxy.getOMConfiguration(NULL_RPC_CONTROLLER, OMConfigurationRequest.newBuilder().build());
OMConfiguration.Builder omMedatataBuilder = new OMConfiguration.Builder();
if (getConfigResponse.getSuccess()) {
if (getConfigResponse.getNodesInMemoryCount() > 0) {
for (OMNodeInfo omNodeInfo : getConfigResponse.getNodesInMemoryList()) {
omMedatataBuilder.addToNodesInMemory(OMNodeDetails.getFromProtobuf(omNodeInfo));
}
}
if (getConfigResponse.getNodesInNewConfCount() > 0) {
for (OMNodeInfo omNodeInfo : getConfigResponse.getNodesInNewConfList()) {
omMedatataBuilder.addToNodesInNewConf(OMNodeDetails.getFromProtobuf(omNodeInfo));
}
}
}
return omMedatataBuilder.build();
} catch (ServiceException e) {
LOG.error("Failed to retrieve configuration of OM {}", omPrintInfo, e);
}
return null;
}
Aggregations