Search in sources :

Example 1 with CreateSnapshotRequestProto

use of org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.CreateSnapshotRequestProto in project hadoop by apache.

the class ClientNamenodeProtocolTranslatorPB method createSnapshot.

@Override
public String createSnapshot(String snapshotRoot, String snapshotName) throws IOException {
    final CreateSnapshotRequestProto.Builder builder = CreateSnapshotRequestProto.newBuilder().setSnapshotRoot(snapshotRoot);
    if (snapshotName != null) {
        builder.setSnapshotName(snapshotName);
    }
    final CreateSnapshotRequestProto req = builder.build();
    try {
        return rpcProxy.createSnapshot(null, req).getSnapshotPath();
    } catch (ServiceException e) {
        throw ProtobufHelper.getRemoteException(e);
    }
}
Also used : CreateSnapshotRequestProto(org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.CreateSnapshotRequestProto) ServiceException(com.google.protobuf.ServiceException)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 CreateSnapshotRequestProto (org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.CreateSnapshotRequestProto)1