Converts wire type to proto type.

@param workerInfo the wire representation to convert
@return the converted proto representation
489650
public static alluxio.grpc.WorkerInfo toProto(WorkerInfo workerInfo) {
    return alluxio.grpc.WorkerInfo.newBuilder().setId(workerInfo.getId())
        .setAddress(toProto(workerInfo.getAddress()))
        .setLastContactSec(workerInfo.getLastContactSec()).setState(workerInfo.getState())
        .setCapacityBytes(workerInfo.getCapacityBytes()).setUsedBytes(workerInfo.getUsedBytes())
        .setStartTimeMs(workerInfo.getStartTimeMs())
        .putAllCapacityBytesOnTiers(workerInfo.getCapacityBytesOnTiers())
        .putAllUsedBytesOnTiers(workerInfo.getUsedBytesOnTiers()).build();
  }
209963
public static Set<Integer> worker_output_tasks(WorkerData workerData) {
        ContextMaker context_maker = workerData.getContextMaker();
        Set<Integer> taskIds = workerData.getTaskIds();
        StormTopology topology = workerData.getSysTopology();

        Set<Integer> rtn = new HashSet<>();

        for (Integer taskId : taskIds) {
            TopologyContext context = context_maker.makeTopologyContext(topology, taskId, null);

            // <StreamId, <ComponentId, Grouping>>
            Map<String, Map<String, Grouping>> targets = context.getThisTargets();
            for (Map<String, Grouping> e : targets.values()) {
                for (String componentId : e.keySet()) {
                    List<Integer> tasks = context.getComponentTasks(componentId);
                    rtn.addAll(tasks);
                }
            }
        }

        return rtn;
    }
388290
public ApiResponse<ApiSuccessResponse> getWorkbinsContentWithHttpInfo(GetWorkbinsContentData getWorkbinsContentData) throws ApiException {
        com.squareup.okhttp.Call call = getWorkbinsContentValidateBeforeCall(getWorkbinsContentData, null, null);
        Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
69431
public WorkerInfo generateWorkerInfo(Set<WorkerInfoField> fieldRange, boolean isLiveWorker) {
    WorkerInfo info = new WorkerInfo();
    Set<WorkerInfoField> checkedFieldRange = fieldRange != null ? fieldRange :
        new HashSet<>(Arrays.asList(WorkerInfoField.values()));
    for (WorkerInfoField field : checkedFieldRange) {
      switch (field) {
        case ADDRESS:
          info.setAddress(mWorkerAddress);
          break;
        case WORKER_CAPACITY_BYTES:
          info.setCapacityBytes(mCapacityBytes);
          break;
        case WORKER_CAPACITY_BYTES_ON_TIERS:
          info.setCapacityBytesOnTiers(mTotalBytesOnTiers);
          break;
        case ID:
          info.setId(mId);
          break;
        case LAST_CONTACT_SEC:
          info.setLastContactSec(
              (int) ((CommonUtils.getCurrentMs() - mLastUpdatedTimeMs) / Constants.SECOND_MS));
          break;
        case START_TIME_MS:
          info.setStartTimeMs(mStartTimeMs);
          break;
        case STATE:
          if (isLiveWorker) {
            info.setState(LIVE_WORKER_STATE);
          } else {
            info.setState(LOST_WORKER_STATE);
          }
          break;
        case WORKER_USED_BYTES:
          info.setUsedBytes(mUsedBytes);
          break;
        case WORKER_USED_BYTES_ON_TIERS:
          info.setUsedBytesOnTiers(mUsedBytesOnTiers);
          break;
        default:
          LOG.warn("Unrecognized worker info field: " + field);
      }
    }
    return info;
  }
243021
protected final CodeBlock generateTypeInfo( BeanTypeInfo typeInfo ) {

        Class type;
        ImmutableMap<JClassType, String> mapTypeToMetadata;
        if ( isSerializer() ) {
            type = TypeSerializationInfo.class;
            mapTypeToMetadata = typeInfo.getMapTypeToSerializationMetadata();
        } else {
            type = TypeDeserializationInfo.class;
            mapTypeToMetadata = typeInfo.getMapTypeToDeserializationMetadata();
        }

        CodeBlock.Builder builder = CodeBlock.builder()
                .add( "new $T($T.$L, $S)", type, As.class, typeInfo.getInclude(), typeInfo.getPropertyName() )
                .indent()
                .indent();

        for ( Entry<JClassType, String> entry : mapTypeToMetadata.entrySet() ) {
            builder.add( "\n.addTypeInfo($T.class, $S)", rawName( entry.getKey() ), entry.getValue() );
        }

        return builder.unindent().unindent().build();
    }
1221557
public static WorkQueue getWorkQueue(Type type, int nThreads) {
		switch(type) {
			case Simple:
					return new SimpleWorkQueue(nThreads);
			
			case Multi:
					return new MultiWorkQueue(nThreads);

            //case WorkStealing:
            default:
					return new MultiWorkQueue(nThreads);
		}
	}
612388
public Map<Integer, ResourceWorkerSlot> getTaskToNodePortbyNode(String supervisorId) {
        Map<Integer, ResourceWorkerSlot> result = new HashMap<>();
        for (ResourceWorkerSlot worker : workers) {
            if (worker.getNodeId().equals(supervisorId)) {
                result.put(worker.getPort(), worker);
            }
        }
        return result;
    }
1160442
def worker_workerready(self, node, workerinfo):
        
        node.workerinfo = workerinfo
        node.workerinfo["id"] = node.gateway.id
        node.workerinfo["spec"] = node.gateway.spec

        # TODO: (#234 task) needs this for pytest. Remove when refactor in pytest repo
        node.slaveinfo = node.workerinfo

        self.config.hook.pytest_testnodeready(node=node)
        if self.shuttingdown:
            node.shutdown()
        else:
            self.sched.add_node(node)
531113
public Protos.TaskInfo constructMesosTaskInfo(Config heronConfig, Config heronRuntime) {
    //String taskIdStr, BaseContainer task, Offer offer
    String taskIdStr = this.taskId;

    Protos.TaskID mesosTaskID = Protos.TaskID.newBuilder().setValue(taskIdStr).build();
    Protos.TaskInfo.Builder taskInfo = Protos.TaskInfo.newBuilder()
        .setName(baseContainer.name)
        .setTaskId(mesosTaskID);
    Protos.Environment.Builder environment = Protos.Environment.newBuilder();

    // If the job defines custom environment variables, add them to the builder
    // Don't add them if they already exist to prevent overwriting the defaults
    Set<String> builtinEnvNames = new HashSet<>();
    for (Protos.Environment.Variable variable : environment.getVariablesList()) {
      builtinEnvNames.add(variable.getName());
    }

    for (BaseContainer.EnvironmentVariable ev : baseContainer.environmentVariables) {
      environment.addVariables(
          Protos.Environment.Variable.newBuilder().setName(ev.name).setValue(ev.value));
    }

    taskInfo
        .addResources(scalarResource(TaskResources.CPUS_RESOURCE_NAME, baseContainer.cpu))
        .addResources(scalarResource(TaskResources.MEM_RESOURCE_NAME, baseContainer.memInMB))
        .addResources(scalarResource(TaskResources.DISK_RESOURCE_NAME, baseContainer.diskInMB))
        .addResources(rangeResource(TaskResources.PORT_RESOURCE_NAME,
            this.freePorts.get(0), this.freePorts.get(this.freePorts.size() - 1))).
        setSlaveId(this.offer.getSlaveId());

    int containerIndex = TaskUtils.getContainerIndexForTaskId(taskIdStr);
    String commandStr = executorCommand(heronConfig, heronRuntime, containerIndex);

    Protos.CommandInfo.Builder command = Protos.CommandInfo.newBuilder();

    List<Protos.CommandInfo.URI> uriProtos = new ArrayList<>();
    for (String uri : baseContainer.dependencies) {
      uriProtos.add(Protos.CommandInfo.URI.newBuilder()
          .setValue(uri)
          .setExtract(true)
          .build());
    }

    command.setValue(commandStr)
        .setShell(baseContainer.shell)
        .setEnvironment(environment)
        .addAllUris(uriProtos);

    if (!baseContainer.runAsUser.isEmpty()) {
      command.setUser(baseContainer.runAsUser);
    }
    taskInfo.setCommand(command);

    return taskInfo.build();
  }
311852
def get_worker_build_info(workflow, platform):
    
    workspace = workflow.plugin_workspace[OrchestrateBuildPlugin.key]
    return workspace[WORKSPACE_KEY_BUILD_INFO][platform]
302774
public static TypeInformation createInternalTypeInfoFromInternalType(InternalType type) {
		TypeInformation typeInfo = INTERNAL_TYPE_TO_INTERNAL_TYPE_INFO.get(type);
		if (typeInfo != null) {
			return typeInfo;
		}

		if (type instanceof RowType) {
			RowType rowType = (RowType) type;
			return new BaseRowTypeInfo(rowType.getFieldTypes(), rowType.getFieldNames());
		} else if (type instanceof ArrayType) {
			return new BinaryArrayTypeInfo(((ArrayType) type).getElementType());
		} else if (type instanceof MapType) {
			MapType mapType = (MapType) type;
			return new BinaryMapTypeInfo(mapType.getKeyType(), mapType.getValueType());
		} else if (type instanceof DecimalType) {
			DecimalType decimalType = (DecimalType) type;
			return new DecimalTypeInfo(decimalType.precision(), decimalType.scale());
		}  else if (type instanceof GenericType) {
			GenericType<?> genericType = (GenericType<?>) type;
			return new BinaryGenericTypeInfo<>(genericType);
		} else {
			throw new UnsupportedOperationException("Not support yet: " + type);
		}
	}
118165
public long getId(final WorkerNetAddress address) throws IOException {
    return retryRPC((RpcCallable<Long>) () -> {
      GetWorkerIdPRequest request =
          GetWorkerIdPRequest.newBuilder().setWorkerNetAddress(GrpcUtils.toProto(address)).build();
      return mClient.getWorkerId(request).getWorkerId();
    });
  }
403405
public alluxio.grpc.WorkerRange getWorkerRange() {
    alluxio.grpc.WorkerRange result = alluxio.grpc.WorkerRange.valueOf(workerRange_);
    return result == null ? alluxio.grpc.WorkerRange.ALL : result;
  }
588254
public MBeanInfo createMBeanInfo() {
        if (type != null) {
            return new MBeanInfo(type.getName(), description, getAttributeInfo(), getConstructorInfo(), getOperationInfo(), getNotificationInfo());
        } else {
            return new MBeanInfo(name, description, getAttributeInfo(), getConstructorInfo(), getOperationInfo(), getNotificationInfo());
        }
    }
796331
public alluxio.grpc.WorkerNetAddress getWorkerNetAddress() {
    return workerNetAddress_ == null ? alluxio.grpc.WorkerNetAddress.getDefaultInstance() : workerNetAddress_;
  }
933273
public static Map<String, Map<String, MkGrouper>> outbound_components(
            TopologyContext topology_context, WorkerData workerData) {
        Map<String, Map<String, MkGrouper>> rr = new HashMap<>();

        // <Stream_id,<component,Grouping>>
        Map<String, Map<String, Grouping>> output_groupings = topology_context.getThisTargets();
        for (Entry<String, Map<String, Grouping>> entry : output_groupings.entrySet()) {
            String stream_id = entry.getKey();
            Map<String, Grouping> component_grouping = entry.getValue();

            Fields out_fields = topology_context.getThisOutputFields(stream_id);

            Map<String, MkGrouper> componentGrouper = new HashMap<>();
            for (Entry<String, Grouping> cg : component_grouping.entrySet()) {
                String component = cg.getKey();
                Grouping tgrouping = cg.getValue();

                List<Integer> outTasks = topology_context.getComponentTasks(component);
                // ATTENTION: If topology set one component parallelism as 0
                // so we don't need send tuple to it
                if (outTasks.size() > 0) {
                    MkGrouper grouper = new MkGrouper(
                            topology_context, out_fields, tgrouping, component, stream_id, workerData);
                    componentGrouper.put(component, grouper);
                }
                LOG.info("outbound_components, {}-{} for task-{} on {}",
                        component, outTasks, topology_context.getThisTaskId(), stream_id);
            }
            if (componentGrouper.size() > 0) {
                rr.put(stream_id, componentGrouper);
            }
        }
        return rr;
    }
1292380
public final ProducerType getProducerType() {
        /* Get the int value and get the corresponding ProducerType to return */
        Byte pType = (Byte) getHdr2().getField(JsHdr2Access.PRODUCERTYPE);
        return ProducerType.getProducerType(pType);
    }