@Override public TruncateResponseProto truncate(RpcController controller, TruncateRequestProto req) throws ServiceException { try { boolean result = server.truncate(req.getSrc(), req.getNewLength(), req.getClientName()); return TruncateResponseProto.newBuilder().setResult(result).build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public boolean truncate(String src, long newLength, String clientName) throws IOException, UnresolvedLinkException { TruncateRequestProto req = TruncateRequestProto.newBuilder() .setSrc(src) .setNewLength(newLength) .setClientName(clientName) .build(); try { return rpcProxy.truncate(null, req).getResult(); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public boolean truncate(String src, long newLength, String clientName) throws IOException { TruncateRequestProto req = TruncateRequestProto.newBuilder() .setSrc(src) .setNewLength(newLength) .setClientName(clientName) .build(); try { return rpcProxy.truncate(null, req).getResult(); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }