Examples of DrillbitEndpoint


Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

  }
 
  public DrillbitEndpoint start() throws DrillbitStartupException, InterruptedException, UnknownHostException{
    int userPort = userServer.bind(config.getInt(ExecConstants.INITIAL_USER_PORT));
    String address = useIP ?  InetAddress.getLocalHost().getHostAddress() : InetAddress.getLocalHost().getCanonicalHostName();
    DrillbitEndpoint partialEndpoint = DrillbitEndpoint.newBuilder()
        .setAddress(address)
        //.setAddress("localhost")
        .setUserPort(userPort)
        .build();
View Full Code Here

Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

    }
  }

  public void run() throws Exception {
    coord.start(10000);
    DrillbitEndpoint md = engine.start();
    cache.run();
    manager.start(md, cache, engine.getBitCom(), coord);
    handle = coord.register(md);
  }
View Full Code Here

Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

    for(Iterator<RowGroupInfo> iter = rowGroups.iterator(); iter.hasNext();){
      RowGroupInfo rowGroupInfo = iter.next();
      for (int i = 0; i < endpoints.size(); i++) {
        int minorFragmentId = (fragmentPointer + i) % endpoints.size();
        DrillbitEndpoint currentEndpoint = endpoints.get(minorFragmentId);
        Map<DrillbitEndpoint, Long> bytesPerEndpoint = rowGroupInfo.getEndpointBytes();
        boolean haveAffinity = bytesPerEndpoint.containsKey(currentEndpoint) ;

        if (assignAll ||
                (!bytesPerEndpoint.isEmpty() &&
View Full Code Here

Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

  @Override
  public DrillbitEndpoint start(DrillbitEndpoint partialEndpoint) throws InterruptedException, DrillbitStartupException {
    server = new BitServer(handler, context, connectionRegistry, listeners);
    int port = context.getConfig().getInt(ExecConstants.INITIAL_BIT_PORT);
    port = server.bind(port);
    DrillbitEndpoint completeEndpoint = partialEndpoint.toBuilder().setBitPort(port).build();
    connectionRegistry.setEndpoint(completeEndpoint);
    return completeEndpoint;
  }
View Full Code Here

Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

    }

    Collection<DrillbitEndpoint> endpoints = clusterCoordinator.getAvailableEndpoints();
    checkState(!endpoints.isEmpty(), "No DrillbitEndpoint can be found");
    // just use the first endpoint for now
    DrillbitEndpoint endpoint = endpoints.iterator().next();
    this.client = new UserClient(allocator.getUnderlyingAllocator(), new NioEventLoopGroup(1, new NamedThreadFactory("Client-")));
    logger.debug("Connecting to server {}:{}", endpoint.getAddress(), endpoint.getUserPort());
    connect(endpoint);
    connected = true;
  }
View Full Code Here

Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

      Range<Long> intersection = rowGroupRange.intersection(blockRange);
      long bytes = intersection.upperEndpoint() - intersection.lowerEndpoint();

      // For each host in the current block location, add the intersecting bytes to the corresponding endpoint
      for (String host : hosts) {
        DrillbitEndpoint endpoint = getDrillBitEndpoint(host);
        if (endpointByteMap.containsKey(endpoint)) {
          endpointByteMap.put(endpoint, endpointByteMap.get(endpoint) + bytes);
        } else {
          if (endpoint != null ) endpointByteMap.put(endpoint, bytes);
        }
View Full Code Here

Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

    final BitComTestHandler handler = new BitComTestHandler();
    final ListenerPool listeners = new ListenerPool(2);
    ConnectionManagerRegistry registry = new ConnectionManagerRegistry(handler, c, listeners);
    BitServer server = new BitServer(handler, c, registry, listeners);
    port = server.bind(port);
    DrillbitEndpoint ep = DrillbitEndpoint.newBuilder().setAddress("localhost").setBitPort(port).build();
    registry.setEndpoint(ep);
    for(int i =0; i < 10; i++){
      try(BitConnectionManager cm = new BitConnectionManager(ep, ep, handler, c, listeners)){
        SendFragmentStatus cmd = new SendFragmentStatus(FragmentStatus.getDefaultInstance());
        cm.runCommand(cmd);
View Full Code Here

Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

    PhysicalPlanReader ppr = new PhysicalPlanReader(CONFIG, CONFIG.getMapper(), DrillbitEndpoint.getDefaultInstance());
    Fragment fragmentRoot = getRootFragment(ppr, fragmentFile);
    PlanningSet planningSet = StatsCollector.collectStats(fragmentRoot);
    SimpleParallelizer par = new SimpleParallelizer();
    List<DrillbitEndpoint> endpoints = Lists.newArrayList();
    DrillbitEndpoint localBit = null;
    for(int i =0; i < bitCount; i++){
      DrillbitEndpoint b1 = DrillbitEndpoint.newBuilder().setAddress("localhost").setBitPort(1234+i).build();
      if(i ==0) localBit = b1;
      endpoints.add(b1);
    }
   
   
View Full Code Here

Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

  @Override
  public void applyAssignments(List<DrillbitEndpoint> endpoints) throws PhysicalOperatorSetupException {
    // we actually don't have to do anything since nothing should have changed. we'll check just check that things
    // didn't get screwed up.
    if (endpoints.size() != 1) throw new PhysicalOperatorSetupException("A Screen operator can only be assigned to a single node.");
    DrillbitEndpoint endpoint = endpoints.iterator().next();
//    logger.debug("Endpoint this: {}, assignment: {}", this.endpoint, endpoint);
    if (!endpoint.equals(this.endpoint)) {
      throw new PhysicalOperatorSetupException(String.format(
          "A Screen operator can only be assigned to its home node.  Expected endpoint %s, Actual endpoint: %s",
          this.endpoint, endpoint));
    }
  }
View Full Code Here

Examples of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint

    }

    Collection<DrillbitEndpoint> endpoints = clusterCoordinator.getAvailableEndpoints();
    checkState(!endpoints.isEmpty(), "No DrillbitEndpoint can be found");
    // just use the first endpoint for now
    DrillbitEndpoint endpoint = endpoints.iterator().next();

    this.client = new UserClient(supportComplexTypes, allocator,
                                 TransportCheck.createEventLoopGroup(config.getInt(ExecConstants.CLIENT_RPC_THREADS), "Client-"));
    logger.debug("Connecting to server {}:{}", endpoint.getAddress(), endpoint.getUserPort());
    connect(endpoint);
    connected = true;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.