use of com.google.protobuf.ServiceException in project hadoop by apache.
the class ClientNamenodeProtocolTranslatorPB method unsetErasureCodingPolicy.
@Override
public void unsetErasureCodingPolicy(String src) throws IOException {
final UnsetErasureCodingPolicyRequestProto.Builder builder = ErasureCodingProtos.UnsetErasureCodingPolicyRequestProto.newBuilder();
builder.setSrc(src);
UnsetErasureCodingPolicyRequestProto req = builder.build();
try {
rpcProxy.unsetErasureCodingPolicy(null, req);
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
use of com.google.protobuf.ServiceException in project hadoop by apache.
the class ClientNamenodeProtocolTranslatorPB method getEZForPath.
@Override
public EncryptionZone getEZForPath(String src) throws IOException {
final GetEZForPathRequestProto.Builder builder = GetEZForPathRequestProto.newBuilder();
builder.setSrc(src);
final GetEZForPathRequestProto req = builder.build();
try {
final EncryptionZonesProtos.GetEZForPathResponseProto response = rpcProxy.getEZForPath(null, req);
if (response.hasZone()) {
return PBHelperClient.convert(response.getZone());
} else {
return null;
}
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
use of com.google.protobuf.ServiceException in project hadoop by apache.
the class ClientNamenodeProtocolTranslatorPB method mkdirs.
@Override
public boolean mkdirs(String src, FsPermission masked, boolean createParent) throws IOException {
MkdirsRequestProto.Builder builder = MkdirsRequestProto.newBuilder().setSrc(src).setMasked(PBHelperClient.convert(masked)).setCreateParent(createParent);
FsPermission unmasked = masked.getUnmasked();
if (unmasked != null) {
builder.setUnmasked(PBHelperClient.convert(unmasked));
}
MkdirsRequestProto req = builder.build();
try {
return rpcProxy.mkdirs(null, req).getResult();
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
use of com.google.protobuf.ServiceException in project hadoop by apache.
the class ClientNamenodeProtocolTranslatorPB method setAcl.
@Override
public void setAcl(String src, List<AclEntry> aclSpec) throws IOException {
SetAclRequestProto req = SetAclRequestProto.newBuilder().setSrc(src).addAllAclSpec(PBHelperClient.convertAclEntryProto(aclSpec)).build();
try {
if (Client.isAsynchronousMode()) {
rpcProxy.setAcl(null, req);
setAsyncReturnValue();
} else {
rpcProxy.setAcl(null, req);
}
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
use of com.google.protobuf.ServiceException in project hadoop by apache.
the class ClientNamenodeProtocolTranslatorPB method createEncryptionZone.
@Override
public void createEncryptionZone(String src, String keyName) throws IOException {
final CreateEncryptionZoneRequestProto.Builder builder = CreateEncryptionZoneRequestProto.newBuilder();
builder.setSrc(src);
if (keyName != null && !keyName.isEmpty()) {
builder.setKeyName(keyName);
}
CreateEncryptionZoneRequestProto req = builder.build();
try {
rpcProxy.createEncryptionZone(null, req);
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
Aggregations