Search in sources :

Example 1 with EncryptionZoneProto

use of org.apache.hadoop.hdfs.protocol.proto.EncryptionZonesProtos.EncryptionZoneProto in project hadoop by apache.

the class ClientNamenodeProtocolTranslatorPB method listEncryptionZones.

@Override
public BatchedEntries<EncryptionZone> listEncryptionZones(long id) throws IOException {
    final ListEncryptionZonesRequestProto req = ListEncryptionZonesRequestProto.newBuilder().setId(id).build();
    try {
        EncryptionZonesProtos.ListEncryptionZonesResponseProto response = rpcProxy.listEncryptionZones(null, req);
        List<EncryptionZone> elements = Lists.newArrayListWithCapacity(response.getZonesCount());
        for (EncryptionZoneProto p : response.getZonesList()) {
            elements.add(PBHelperClient.convert(p));
        }
        return new BatchedListEntries<>(elements, response.getHasMore());
    } catch (ServiceException e) {
        throw ProtobufHelper.getRemoteException(e);
    }
}
Also used : EncryptionZone(org.apache.hadoop.hdfs.protocol.EncryptionZone) ServiceException(com.google.protobuf.ServiceException) ListEncryptionZonesRequestProto(org.apache.hadoop.hdfs.protocol.proto.EncryptionZonesProtos.ListEncryptionZonesRequestProto) BatchedListEntries(org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries) EncryptionZoneProto(org.apache.hadoop.hdfs.protocol.proto.EncryptionZonesProtos.EncryptionZoneProto)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 BatchedListEntries (org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries)1 EncryptionZone (org.apache.hadoop.hdfs.protocol.EncryptionZone)1 EncryptionZoneProto (org.apache.hadoop.hdfs.protocol.proto.EncryptionZonesProtos.EncryptionZoneProto)1 ListEncryptionZonesRequestProto (org.apache.hadoop.hdfs.protocol.proto.EncryptionZonesProtos.ListEncryptionZonesRequestProto)1