Package org.apache.tajo.master.rm

Examples of org.apache.tajo.master.rm.WorkerResource


    public void releaseWorkerResource(RpcController controller,
                                           TajoMasterProtocol.WorkerResourceReleaseRequest request,
                                           RpcCallback<PrimitiveProtos.BoolProto> done) {
      List<TajoMasterProtocol.WorkerResourceProto> workerResources = request.getWorkerResourcesList();
      for(TajoMasterProtocol.WorkerResourceProto eachWorkerResource: workerResources) {
        WorkerResource workerResource = new WorkerResource();
        String[] tokens = eachWorkerResource.getWorkerHostAndPort().split(":");
        workerResource.setAllocatedHost(tokens[0]);
        workerResource.setPeerRpcPort(Integer.parseInt(tokens[1]));
        workerResource.setMemoryMBSlots(eachWorkerResource.getMemoryMBSlots());
        workerResource.setDiskSlots(eachWorkerResource.getDiskSlots());

        LOG.info("releaseWorkerResource:" + workerResource);
        context.getResourceManager().releaseWorkerResource(
            new QueryId(eachWorkerResource.getExecutionBlockId().getQueryId()),
            workerResource);
View Full Code Here


          containerId.setId(containerIdSeq.incrementAndGet());

          container.setId(containerId);
          container.setNodeId(nodeId);

          WorkerResource workerResource = new WorkerResource();
          workerResource.setAllocatedHost(nodeId.getHost());
          workerResource.setPeerRpcPort(nodeId.getPort());
          workerResource.setPullServerPort(eachWorker.getWorkerPullServerPort());
          workerResource.setMemoryMBSlots(requiredMemoryMBSlot);
          workerResource.setDiskSlots(requiredDiskSlots);

          container.setWorkerResource(workerResource);

          containers.add(container);
        }
View Full Code Here

  }

  private QueryInfo makeQueryInfoFromHeartbeat(TajoMasterProtocol.TajoHeartbeat queryHeartbeat) {
    QueryInfo queryInfo = new QueryInfo(new QueryId(queryHeartbeat.getQueryId()));
    if(queryHeartbeat.getTajoWorkerHost() != null) {
      WorkerResource queryMasterResource = new WorkerResource();
      queryMasterResource.setAllocatedHost(queryHeartbeat.getTajoWorkerHost());
      queryMasterResource.setPeerRpcPort(queryHeartbeat.getTajoWorkerPort());
      queryMasterResource.setClientPort(queryHeartbeat.getTajoWorkerClientPort());
      queryMasterResource.setPullServerPort(queryHeartbeat.getTajoWorkerPullServerPort());
      queryInfo.setQueryMasterResource(queryMasterResource);
    }
    queryInfo.setLastMessage(queryHeartbeat.getStatusMessage());
    queryInfo.setQueryState(queryHeartbeat.getState());
    queryInfo.setProgress(queryHeartbeat.getQueryProgress());
View Full Code Here

  public void startQueryMaster() {
    try {
      LOG.info("Initializing QueryInProgress for QueryID=" + queryId);
      WorkerResourceManager resourceManager = masterContext.getResourceManager();
      WorkerResource queryMasterResource = resourceManager.allocateQueryMaster(this);

      if(queryMasterResource != null) {
        queryInfo.setQueryMasterResource(queryMasterResource);
      }
      getEventHandler().handle(new QueryJobEvent(QueryJobEvent.Type.QUERY_MASTER_START, queryInfo));
View Full Code Here

          containerId.setId(eachAllocatedResource.getContainerId().getId());

          container.setId(containerId);
          container.setNodeId(nodeId);

          WorkerResource workerResource = new WorkerResource();
          workerResource.setAllocatedHost(nodeId.getHost());
          workerResource.setPeerRpcPort(nodeId.getPort());
          workerResource.setQueryMasterPort(eachAllocatedResource.getQueryMasterPort());
          workerResource.setPullServerPort(eachAllocatedResource.getWorkerPullServerPort());
          workerResource.setMemoryMB(eachAllocatedResource.getAllocatedMemoryMB());
          workerResource.setDiskSlots(eachAllocatedResource.getAllocatedDiskSlots());

          container.setWorkerResource(workerResource);

          containers.add(container);
        }
View Full Code Here

  public boolean startQueryMaster() {
    try {
      LOG.info("Initializing QueryInProgress for QueryID=" + queryId);
      WorkerResourceManager resourceManager = masterContext.getResourceManager();
      WorkerResource queryMasterResource = resourceManager.allocateQueryMaster(this);

      if(queryMasterResource == null) {
        return false;
      }
      queryInfo.setQueryMasterResource(queryMasterResource);
View Full Code Here

  }

  private QueryInfo makeQueryInfoFromHeartbeat(TajoMasterProtocol.TajoHeartbeat queryHeartbeat) {
    QueryInfo queryInfo = new QueryInfo(new QueryId(queryHeartbeat.getQueryId()));
    if (queryHeartbeat.getTajoWorkerHost() != null) {
      WorkerResource queryMasterResource = new WorkerResource();
      queryMasterResource.setAllocatedHost(queryHeartbeat.getTajoWorkerHost());
      queryMasterResource.setPeerRpcPort(queryHeartbeat.getPeerRpcPort());
      queryMasterResource.setQueryMasterPort(queryHeartbeat.getTajoQueryMasterPort());
      queryMasterResource.setClientPort(queryHeartbeat.getTajoWorkerClientPort());
      queryMasterResource.setPullServerPort(queryHeartbeat.getTajoWorkerPullServerPort());
      queryInfo.setQueryMasterResource(queryMasterResource);
    }
    queryInfo.setLastMessage(queryHeartbeat.getStatusMessage());
    queryInfo.setQueryState(queryHeartbeat.getState());
    queryInfo.setProgress(queryHeartbeat.getQueryProgress());
View Full Code Here

TOP

Related Classes of org.apache.tajo.master.rm.WorkerResource

Copyright © 2018 www.massapicom. 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.