All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dangdang.ddframe.job.cloud.scheduler.mesos.JobTaskRequest Maven / Gradle / Ivy

There is a newer version: 2.1.5
Show newest version
/*
 * Copyright 1999-2015 dangdang.com.
 * 

* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

*/ package com.dangdang.ddframe.job.cloud.scheduler.mesos; import com.dangdang.ddframe.job.cloud.scheduler.config.CloudJobConfiguration; import com.dangdang.ddframe.job.cloud.scheduler.context.TaskContext; import com.netflix.fenzo.ConstraintEvaluator; import com.netflix.fenzo.TaskRequest; import com.netflix.fenzo.VMTaskFitnessCalculator; import lombok.RequiredArgsConstructor; import java.util.Collections; import java.util.List; import java.util.Map; /** * 作业任务请求对象. * * @author zhangliang */ @RequiredArgsConstructor public final class JobTaskRequest implements TaskRequest { private final TaskContext taskContext; private final CloudJobConfiguration jobConfig; @Override public String getId() { return taskContext.getId(); } @Override public String taskGroupName() { return ""; } @Override public double getCPUs() { return jobConfig.getCpuCount(); } @Override public double getMemory() { return jobConfig.getMemoryMB(); } @Override public double getNetworkMbps() { return 0; } @Override public double getDisk() { return 10d; } @Override public int getPorts() { return 1; } @Override public Map getScalarRequests() { return null; } @Override public List getHardConstraints() { return null; } @Override public List getSoftConstraints() { return null; } @Override public void setAssignedResources(final AssignedResources assignedResources) { } @Override public AssignedResources getAssignedResources() { return null; } @Override public Map getCustomNamedResources() { return Collections.emptyMap(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy