@Before public void setupServer() throws Exception{ allocator = new RootAllocator(20 * 1024 * 1024); pool = new CloseableThreadPool("test-fabric"); fabric = new FabricServiceImpl(address, 45678, true, THREAD_COUNT, allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); fabric.start(); }
protected FabricServer newFabricServer() throws Exception { return new FabricServer(getAddress(), getHandler(), getRpcConfig(), getAllocator(), getRegistry(), getEventLoop()); }
@Before public void setUpPDFSService() throws IOException { NodeEndpoint endpoint = NodeEndpoint.newBuilder() .setAddress(fabric.getAddress()).setFabricPort(fabric.getPort()) .build(); PDFSProtocol pdfsProtocol = PDFSProtocol.newInstance(endpoint, DremioTest.DEFAULT_SABOT_CONFIG, allocator, true); FabricRunnerFactory factory = fabric.registerProtocol(pdfsProtocol); sabotFS = new RemoteNodeFileSystem(factory.getCommandRunner(fabric.getAddress(), fabric.getPort()), allocator); sabotFS.initialize(URI.create(format("sabot://%s:%d", fabric.getAddress(), fabric.getPort())), new Configuration(false)); }
final String address = FabricServiceImpl.getAddress(useIP); registry.bind(FabricService.class, new FabricServiceImpl( address, 45678,
public ServiceHolder(BufferAllocator allocator, Provider<Iterable<NodeEndpoint>> nodeProvider, PDFSMode mode, String name) throws Exception{ this.allocator = allocator.newChildAllocator(name, 0, Long.MAX_VALUE); pool = new CloseableThreadPool(name); fabric = new FabricServiceImpl(HOSTNAME, 9970, true, THREAD_COUNT, this.allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); fabric.start(); endpoint = NodeEndpoint.newBuilder() .setAddress(fabric.getAddress()).setFabricPort(fabric.getPort()) .setRoles(Roles.newBuilder().setJavaExecutor(mode == PDFSMode.DATA)) .build(); service = new PDFSService(DirectProvider.wrap((FabricService) fabric), DirectProvider.wrap(endpoint), nodeProvider, DremioTest.DEFAULT_SABOT_CONFIG, this.allocator, mode); service.start(); fileSystem = service.createFileSystem(); }
fabricService = new FabricServiceImpl(HOSTNAME, 45678, true, THREAD_COUNT, allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool);
@BeforeClass public static void setup() throws Exception { final String hostname = FabricServiceImpl.getAddress(false); final String localWritePathString = tempFolder.getRoot().getAbsolutePath(); currentDremioDaemon = DACDaemon.newDremioDaemon(
ReceivedResponseMessage<QueryId> resp2 = ep2.getEndpoint(address, fabric.getPort()).send(expectedD, random1); assertEquals(resp2.getBody(), expectedQ); assertEqualsBytes(r2B, resp2.getBuffer());
fabricAddress = FabricServiceImpl.getAddress(false); } catch (UnknownHostException e) { throw new RuntimeException("Cannot get local address", e); new FabricServiceImpl( fabricAddress, dacConfig.localPort,
fabricService = new FabricServiceImpl(HOSTNAME, 45678, true, THREAD_COUNT, allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool);
@Test(expected=RpcException.class) public void propagateFailure() throws Exception { ProtocolBuilder builder = ProtocolBuilder.builder().allocator(allocator).name("test-fabric").protocolId(3); SendEndpointCreator<NodeEndpoint, QueryId> ep1 = builder.register(1, new AbstractReceiveHandler<NodeEndpoint, QueryId>(NodeEndpoint.getDefaultInstance(), QueryId.getDefaultInstance()) { @Override public SentResponseMessage<QueryId> handle(NodeEndpoint request, ArrowBuf dBody) throws RpcException { throw new NullPointerException("an npe."); } }); builder.register(fabric); ReceivedResponseMessage<QueryId> resp1 = ep1.getEndpoint(address, fabric.getPort()).send(expectedD); assertEquals(resp1.getBody(), expectedQ); assertTrue(resp1.getBuffer() == null); }
@Override void initProvider() throws Exception { allocator = new RootAllocator(20 * 1024 * 1024); pool = new CloseableThreadPool("test-remoteocckvstore"); localFabricService = new FabricServiceImpl(HOSTNAME, 45678, true, THREAD_COUNT, allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); localFabricService.start(); remoteFabricService = new FabricServiceImpl(HOSTNAME, 45679, true, THREAD_COUNT, allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); remoteFabricService.start(); localKVStoreProvider = new LocalKVStoreProvider(DremioTest.CLASSPATH_SCAN_RESULT, DirectProvider.wrap(localFabricService), allocator, HOSTNAME, tmpFolder.getRoot().toString(), true, true, true, false); localKVStoreProvider.start(); remoteKVStoreProvider = new RemoteKVStoreProvider( DremioTest.CLASSPATH_SCAN_RESULT, DirectProvider.wrap(NodeEndpoint.newBuilder() .setAddress(HOSTNAME) .setFabricPort(localFabricService.getPort()) .build()), DirectProvider.wrap(remoteFabricService), allocator, HOSTNAME); remoteKVStoreProvider.start(); }
@Test public void basicProtocolNoBuffers() throws Exception { ProtocolBuilder builder = ProtocolBuilder.builder().allocator(allocator).name("test-fabric").protocolId(3); SendEndpointCreator<NodeEndpoint, QueryId> ep1 = builder.register(1, new AbstractReceiveHandler<NodeEndpoint, QueryId>(NodeEndpoint.getDefaultInstance(), QueryId.getDefaultInstance()) { @Override public SentResponseMessage<QueryId> handle(NodeEndpoint request, ArrowBuf dBody) throws RpcException { if (!request.equals(expectedD)) { throw new RpcException("Objects not same."); } return new SentResponseMessage<>(expectedQ); } }); builder.register(fabric); ReceivedResponseMessage<QueryId> resp1 = ep1.getEndpoint(address, fabric.getPort()).send(expectedD); assertEquals(resp1.getBody(), expectedQ); assertTrue(resp1.getBuffer() == null); }
@Override KVStoreProvider createKKStoreProvider() throws Exception { allocator = new RootAllocator(20 * 1024 * 1024); pool = new CloseableThreadPool("test-remoteindexedkvstore"); localFabricService = new FabricServiceImpl(HOSTNAME, 45678, true, THREAD_COUNT, allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); localFabricService.start(); final Provider<FabricService> fab = () -> localFabricService; remoteFabricService = new FabricServiceImpl(HOSTNAME, 45679, true, THREAD_COUNT, allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); remoteFabricService.start(); final Provider<FabricService> rfab = () -> remoteFabricService; localKVStoreProvider = new LocalKVStoreProvider(DremioTest.CLASSPATH_SCAN_RESULT, fab, allocator, HOSTNAME, null, true, true, true, false); localKVStoreProvider.start(); remoteKVStoreProvider = new RemoteKVStoreProvider( DremioTest.CLASSPATH_SCAN_RESULT, DirectProvider.wrap(NodeEndpoint.newBuilder() .setAddress(HOSTNAME) .setFabricPort(localFabricService.getPort()) .build()), rfab, allocator, HOSTNAME); remoteKVStoreProvider.start(); return remoteKVStoreProvider; }
@Override KVStoreProvider createKKStoreProvider() throws Exception { allocator = new RootAllocator(20 * 1024 * 1024); pool = new CloseableThreadPool("test-remoteocckvstore"); localFabricService = new FabricServiceImpl(HOSTNAME, 45678, true, THREAD_COUNT, allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); localFabricService.start(); remoteFabricService = new FabricServiceImpl(HOSTNAME, 45679, true, THREAD_COUNT, allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); remoteFabricService.start(); localKVStoreProvider = new LocalKVStoreProvider(DremioTest.CLASSPATH_SCAN_RESULT, DirectProvider.<FabricService>wrap(localFabricService), allocator, HOSTNAME, null, true, true, true, false); localKVStoreProvider.start(); remoteKVStoreProvider = new RemoteKVStoreProvider( DremioTest.CLASSPATH_SCAN_RESULT, DirectProvider.wrap(NodeEndpoint.newBuilder() .setAddress(HOSTNAME) .setFabricPort(localFabricService.getPort()) .build()), DirectProvider.<FabricService>wrap(remoteFabricService), allocator, HOSTNAME); remoteKVStoreProvider.start(); return remoteKVStoreProvider; }