Search in sources :

Example 1 with ServiceListRequest

use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ServiceListRequest 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());
}
Also used : ServiceInfo(org.apache.hadoop.ozone.om.helpers.ServiceInfo) OMRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest) ServiceListRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ServiceListRequest) ServiceInfoEx(org.apache.hadoop.ozone.om.helpers.ServiceInfoEx) ServiceListResponse(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ServiceListResponse)

Example 2 with ServiceListRequest

use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ServiceListRequest in project ozone by apache.

the class OzoneManagerProtocolClientSideTranslatorPB method getServiceList.

@Override
public List<ServiceInfo> getServiceList() throws IOException {
    ServiceListRequest req = ServiceListRequest.newBuilder().build();
    OMRequest omRequest = createOMRequest(Type.ServiceList).setServiceListRequest(req).build();
    final ServiceListResponse resp = handleError(submitRequest(omRequest)).getServiceListResponse();
    return resp.getServiceInfoList().stream().map(ServiceInfo::getFromProtobuf).collect(Collectors.toList());
}
Also used : OMRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest) ServiceListRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ServiceListRequest) ServiceListResponse(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ServiceListResponse)

Aggregations

OMRequest (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest)2 ServiceListRequest (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ServiceListRequest)2 ServiceListResponse (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ServiceListResponse)2 ServiceInfo (org.apache.hadoop.ozone.om.helpers.ServiceInfo)1 ServiceInfoEx (org.apache.hadoop.ozone.om.helpers.ServiceInfoEx)1