org.apache.flink.mesos.util.MesosResourceAllocation Java Examples
The following examples show how to use
org.apache.flink.mesos.util.MesosResourceAllocation.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LaunchableMesosWorkerTest.java From flink with Apache License 2.0 | 6 votes |
@Test public void launch_withNonDefaultConfiguration_forwardsConfigurationValues() { final Configuration configuration = new Configuration(); configuration.setString(MesosOptions.MASTER_URL, "foobar"); final MemorySize memorySize = new MemorySize(1337L); configuration.set(TaskManagerOptions.MANAGED_MEMORY_SIZE, memorySize); configuration.set(TaskManagerOptions.TOTAL_PROCESS_MEMORY, MemorySize.parse("1g")); final LaunchableTask launchableTask = new LaunchableMesosWorker( ignored -> Option.empty(), MesosTaskManagerParameters.create(configuration), ContainerSpecification.from(configuration), Protos.TaskID.newBuilder().setValue("test-task-id").build(), MesosUtils.createMesosSchedulerConfiguration(configuration, "localhost")); final Protos.TaskInfo taskInfo = launchableTask.launch( Protos.SlaveID.newBuilder().setValue("test-slave-id").build(), new MesosResourceAllocation(Collections.singleton(ports(range(1000, 2000))))); assertThat( taskInfo.getCommand().getValue(), containsString(ContainerSpecification.createDynamicProperty(TaskManagerOptions.MANAGED_MEMORY_SIZE.key(), memorySize.toString()))); }
Example #2
Source File: LaunchableTask.java From Flink-CEPplus with Apache License 2.0 | 2 votes |
/** * Prepare to launch the task by producing a Mesos TaskInfo record. * @param slaveId the slave assigned to the task. * @param allocation the resource allocation to take from. * @return a TaskInfo. */ Protos.TaskInfo launch(Protos.SlaveID slaveId, MesosResourceAllocation allocation);
Example #3
Source File: LaunchableTask.java From flink with Apache License 2.0 | 2 votes |
/** * Prepare to launch the task by producing a Mesos TaskInfo record. * @param slaveId the slave assigned to the task. * @param allocation the resource allocation to take from. * @return a TaskInfo. */ Protos.TaskInfo launch(Protos.SlaveID slaveId, MesosResourceAllocation allocation);
Example #4
Source File: LaunchableTask.java From flink with Apache License 2.0 | 2 votes |
/** * Prepare to launch the task by producing a Mesos TaskInfo record. * @param slaveId the slave assigned to the task. * @param allocation the resource allocation to take from. * @return a TaskInfo. */ Protos.TaskInfo launch(Protos.SlaveID slaveId, MesosResourceAllocation allocation);