use of org.apache.hadoop.ozone.om.helpers.ServiceInfoEx in project ozone by apache.
the class OzoneManagerProtocolClientSideTranslatorPB method getServiceInfo.
@Override
public ServiceInfoEx getServiceInfo() throws IOException {
ServiceListRequest req = ServiceListRequest.newBuilder().build();
OMRequest omRequest = createOMRequest(Type.ServiceList).setServiceListRequest(req).build();
final ServiceListResponse resp = handleError(submitRequest(omRequest)).getServiceListResponse();
return new ServiceInfoEx(resp.getServiceInfoList().stream().map(ServiceInfo::getFromProtobuf).collect(Collectors.toList()), resp.getCaCertificate(), resp.getCaCertsList());
}
use of org.apache.hadoop.ozone.om.helpers.ServiceInfoEx in project ozone by apache.
the class OzoneManagerRequestHandler method getServiceList.
private ServiceListResponse getServiceList(ServiceListRequest request) throws IOException {
ServiceListResponse.Builder resp = ServiceListResponse.newBuilder();
ServiceInfoEx serviceInfoEx = impl.getServiceInfo();
List<OzoneManagerProtocolProtos.ServiceInfo> serviceInfoProtos = new ArrayList<>();
List<ServiceInfo> serviceInfos = serviceInfoEx.getServiceInfoList();
for (ServiceInfo info : serviceInfos) {
serviceInfoProtos.add(info.getProtobuf());
}
resp.addAllServiceInfo(serviceInfoProtos);
if (serviceInfoEx.getCaCertificate() != null) {
resp.setCaCertificate(serviceInfoEx.getCaCertificate());
}
for (String ca : serviceInfoEx.getCaCertPemList()) {
resp.addCaCerts(ca);
}
return resp.build();
}
Aggregations