use of org.apache.hadoop.hdfs.protocol.proto.ErasureCodingProtos.GetErasureCodingPoliciesResponseProto in project hadoop by apache.
the class ClientNamenodeProtocolServerSideTranslatorPB method getErasureCodingPolicies.
@Override
public GetErasureCodingPoliciesResponseProto getErasureCodingPolicies(RpcController controller, GetErasureCodingPoliciesRequestProto request) throws ServiceException {
try {
ErasureCodingPolicy[] ecPolicies = server.getErasureCodingPolicies();
GetErasureCodingPoliciesResponseProto.Builder resBuilder = GetErasureCodingPoliciesResponseProto.newBuilder();
for (ErasureCodingPolicy ecPolicy : ecPolicies) {
resBuilder.addEcPolicies(PBHelperClient.convertErasureCodingPolicy(ecPolicy));
}
return resBuilder.build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
use of org.apache.hadoop.hdfs.protocol.proto.ErasureCodingProtos.GetErasureCodingPoliciesResponseProto in project hadoop by apache.
the class ClientNamenodeProtocolTranslatorPB method getErasureCodingPolicies.
@Override
public ErasureCodingPolicy[] getErasureCodingPolicies() throws IOException {
try {
GetErasureCodingPoliciesResponseProto response = rpcProxy.getErasureCodingPolicies(null, VOID_GET_EC_POLICIES_REQUEST);
ErasureCodingPolicy[] ecPolicies = new ErasureCodingPolicy[response.getEcPoliciesCount()];
int i = 0;
for (ErasureCodingPolicyProto ecPolicyProto : response.getEcPoliciesList()) {
ecPolicies[i++] = PBHelperClient.convertErasureCodingPolicy(ecPolicyProto);
}
return ecPolicies;
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
Aggregations