/** * Create a new namespace * @param descriptor descriptor which describes the new namespace * @throws IOException */ @Override public void createNamespace(final NamespaceDescriptor descriptor) throws IOException { executeCallable(new MasterCallable<Void>(getConnection()) { @Override public Void call(int callTimeout) throws Exception { PayloadCarryingRpcController controller = rpcControllerFactory.newController(); controller.setCallTimeout(callTimeout); // TODO: set priority based on NS? master.createNamespace(controller, CreateNamespaceRequest.newBuilder() .setNamespaceDescriptor(ProtobufUtil .toProtoNamespaceDescriptor(descriptor)).build() ); return null; } }); }
@Override public CreateNamespaceResponse createNamespace(RpcController controller, CreateNamespaceRequest request) throws ServiceException { try { master.createNamespace(ProtobufUtil.toNamespaceDescriptor(request.getNamespaceDescriptor())); return CreateNamespaceResponse.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
/** * Create a new namespace * @param descriptor descriptor which describes the new namespace * @throws IOException */ @Override public void createNamespace(final NamespaceDescriptor descriptor) throws IOException { executeCallable(new MasterCallable<Void>(getConnection()) { @Override public Void call(int callTimeout) throws Exception { master.createNamespace(null, CreateNamespaceRequest.newBuilder() .setNamespaceDescriptor(ProtobufUtil .toProtoNamespaceDescriptor(descriptor)).build() ); return null; } }); }
@Override public CreateNamespaceResponse createNamespace(RpcController controller, CreateNamespaceRequest request) throws ServiceException { try { createNamespace(ProtobufUtil.toNamespaceDescriptor(request.getNamespaceDescriptor())); return CreateNamespaceResponse.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
/** * Create a new namespace * @param descriptor descriptor which describes the new namespace * @throws IOException */ public void createNamespace(final NamespaceDescriptor descriptor) throws IOException { executeCallable(new MasterCallable<Void>(getConnection()) { @Override public Void call() throws Exception { master.createNamespace(null, CreateNamespaceRequest.newBuilder() .setNamespaceDescriptor(ProtobufUtil .toProtoNamespaceDescriptor(descriptor)).build()); return null; } }); }
/** * Create a new namespace * @param descriptor descriptor which describes the new namespace * @throws IOException */ public void createNamespace(final NamespaceDescriptor descriptor) throws IOException { executeCallable(new MasterCallable<Void>(getConnection()) { @Override public Void call(int callTimeout) throws Exception { master.createNamespace(null, CreateNamespaceRequest.newBuilder() .setNamespaceDescriptor(ProtobufUtil .toProtoNamespaceDescriptor(descriptor)).build()); return null; } }); }