Search in sources :

Example 1 with ErasureCodingPolicyProto

use of org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.ErasureCodingPolicyProto 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);
    }
}
Also used : GetErasureCodingPoliciesResponseProto(org.apache.hadoop.hdfs.protocol.proto.ErasureCodingProtos.GetErasureCodingPoliciesResponseProto) ServiceException(com.google.protobuf.ServiceException) ErasureCodingPolicy(org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy) ErasureCodingPolicyProto(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.ErasureCodingPolicyProto)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 ErasureCodingPolicy (org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy)1 GetErasureCodingPoliciesResponseProto (org.apache.hadoop.hdfs.protocol.proto.ErasureCodingProtos.GetErasureCodingPoliciesResponseProto)1 ErasureCodingPolicyProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.ErasureCodingPolicyProto)1