@BeforeClass public static void setup() { endpoints = Lists.newArrayList(); final String pattern = "node%d"; for (int i = 2; i < 32; i++) { String host = String.format(pattern, i); endpoints.add(NodeEndpoint.newBuilder().setAddress(host).build()); } }
public List<MinorFragmentEndpoint> getEndpoints() { List<MinorFragmentEndpoint> l = new ArrayList<MinorFragmentEndpoint>(); for (int i = 0; i < NUM_FRAGMENTS; i++) { l.add(new MinorFragmentEndpoint(i, NodeEndpoint.newBuilder().setAddress(String.format("a_%d", i)).setFabricPort(1).build())); } return l; }
/** * <code>optional .exec.NodeEndpoint endpoint = 2;</code> */ public Builder mergeEndpoint(com.dremio.exec.proto.CoordinationProtos.NodeEndpoint value) { if (endpointBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && endpoint_ != com.dremio.exec.proto.CoordinationProtos.NodeEndpoint.getDefaultInstance()) { endpoint_ = com.dremio.exec.proto.CoordinationProtos.NodeEndpoint.newBuilder(endpoint_).mergeFrom(value).buildPartial(); } else { endpoint_ = value; } onChanged(); } else { endpointBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
public Builder toBuilder() { return newBuilder(this); }
@Test public void testResourceSchedulingInProfile() throws Exception { AttemptObservers observers = AttemptObservers.of(observer); final NodeEndpoint endpoint = NodeEndpoint.newBuilder().setAddress("host1").setFabricPort(12345).build(); when(context.getCurrentEndpoint()).thenReturn(endpoint); QueryManager queryManager = new QueryManager(queryId, context, null, completionListener, new Pointer<>(), observers, true, true, catalog); ResourceSchedulingDecisionInfo result = new ResourceSchedulingDecisionInfo(); result.setQueueId("abcd"); result.setQueueName("queue.abcd"); observers.resourcesScheduled(result); UserBitShared.QueryProfile queryProfile = queryManager.getQueryProfile("my description", UserBitShared.QueryResult.QueryState.RUNNING, null, "some reason"); assertNotNull(queryProfile.getResourceSchedulingProfile()); assertEquals("abcd", queryProfile.getResourceSchedulingProfile().getQueueId()); assertEquals("queue.abcd", queryProfile.getResourceSchedulingProfile().getQueueName()); } }
@Test public void test2ComponentsConnection() throws Exception { assertNull(zooKeeperServer.getZKClient().exists("/dremio2/test-cluster-id", false)); try(ZKClusterClient client = new ZKClusterClient( DEFAULT_SABOT_CONFIG, String.format("%s/dremio2/test-cluster-id", zooKeeperServer.getConnectString())) ) { client.start(); ZKServiceSet serviceSet = client.newServiceSet("coordinator"); serviceSet.register(NodeEndpoint.newBuilder().setAddress("foo").build()); Stat stat = zooKeeperServer.getZKClient().exists("/dremio2/test-cluster-id/coordinator", false); assertNotNull(stat); assertEquals(1, stat.getNumChildren()); } }
@Test public void test1ComponentConnection() throws Exception { assertNull(zooKeeperServer.getZKClient().exists("/dremio1", false)); try(ZKClusterClient client = new ZKClusterClient( DEFAULT_SABOT_CONFIG, String.format("%s/dremio1", zooKeeperServer.getConnectString())) ) { client.start(); ZKServiceSet serviceSet = client.newServiceSet("coordinator"); serviceSet.register(NodeEndpoint.newBuilder().setAddress("foo").build()); Stat stat = zooKeeperServer.getZKClient().exists("/dremio1/coordinator", false); assertNotNull(stat); assertEquals(1, stat.getNumChildren()); } }
private static final CoordinationProtos.NodeEndpoint newNodeEndpoint(String address, int port) { return CoordinationProtos.NodeEndpoint.newBuilder().setAddress(address).setFabricPort(port).build(); }
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(); }
private static final NodeEndpoint newNodeEndpoint(String address, int port) { return NodeEndpoint.newBuilder().setAddress(address).setFabricPort(port).build(); }
@Test public void test3ComponentsConnection() throws Exception { assertNull(zooKeeperServer.getZKClient().exists("/dremio3/test/test-cluster-id", false)); try(ZKClusterClient client = new ZKClusterClient( DEFAULT_SABOT_CONFIG, String.format("%s/dremio3/test/test-cluster-id", zooKeeperServer.getConnectString())) ) { client.start(); ZKServiceSet serviceSet = client.newServiceSet("coordinator"); serviceSet.register(NodeEndpoint.newBuilder().setAddress("foo").build()); Stat stat = zooKeeperServer.getZKClient().exists("/dremio3/test/test-cluster-id/coordinator", false); assertNotNull(stat); assertEquals(1, stat.getNumChildren()); } }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.dremio.exec.proto.CoordinationProtos.NodeEndpoint prototype) {
private static NodeEndpoint getEndpoint(String host) { return NodeEndpoint.newBuilder().setAddress(host).setFabricPort(1234).build(); }
private static final NodeEndpoint newNodeEndpoint(String address, int port) { return NodeEndpoint.newBuilder().setAddress(address).setFabricPort(port).build(); } }
@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)); }
public com.dremio.exec.proto.CoordinationProtos.NodeEndpoint.Builder newMessage() { return com.dremio.exec.proto.CoordinationProtos.NodeEndpoint.newBuilder(); } public java.lang.String getFieldName(int number)
/** * Create a {@link com.dremio.exec.dfs.proto.beans.NodeEndpoint} * @param address the address * @param port the control port * @return */ private static NodeEndpoint newNodeEndpoint(String address, int port) { return NodeEndpoint.newBuilder().setAddress(address).setFabricPort(port).build(); }
public static Builder newBuilder(com.dremio.exec.proto.CoordinationProtos.NodeEndpoint prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
/** * Create a {@link com.dremio.exec.dfs.proto.beans.NodeEndpoint} * @param address the address * @param port the control port * @return */ private static NodeEndpoint newNodeEndpoint(String address, int port) { return NodeEndpoint.newBuilder().setAddress(address).setFabricPort(port).build(); }
/** * Create a {@link com.dremio.exec.proto.beans.NodeEndpoint} * @param address the address * @param port the control port * @return */ private static NodeEndpoint newNodeEndpoint(String address, int port) { return NodeEndpoint.newBuilder().setAddress(address).setFabricPort(port).setRoles(Roles.newBuilder().setJavaExecutor(true)).build(); }