Search in sources :

Example 1 with TaskManagersInfo

use of org.apache.flink.runtime.rest.messages.JobVertexTaskManagersInfo.TaskManagersInfo in project flink by splunk.

the class JobVertexTaskManagersInfoTest method getTestResponseInstance.

@Override
protected JobVertexTaskManagersInfo getTestResponseInstance() throws Exception {
    final Random random = new Random();
    List<TaskManagersInfo> taskManagersInfoList = new ArrayList<>();
    final Map<ExecutionState, Integer> statusCounts = new HashMap<>(ExecutionState.values().length);
    final IOMetricsInfo jobVertexMetrics = new IOMetricsInfo(random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean());
    int count = 100;
    for (ExecutionState executionState : ExecutionState.values()) {
        statusCounts.put(executionState, count++);
    }
    taskManagersInfoList.add(new TaskManagersInfo("host1", ExecutionState.CANCELING, 1L, 2L, 3L, jobVertexMetrics, statusCounts, "taskmanagerId"));
    return new JobVertexTaskManagersInfo(new JobVertexID(), "test", System.currentTimeMillis(), taskManagersInfoList);
}
Also used : ExecutionState(org.apache.flink.runtime.execution.ExecutionState) Random(java.util.Random) HashMap(java.util.HashMap) JobVertexID(org.apache.flink.runtime.jobgraph.JobVertexID) ArrayList(java.util.ArrayList) IOMetricsInfo(org.apache.flink.runtime.rest.messages.job.metrics.IOMetricsInfo) TaskManagersInfo(org.apache.flink.runtime.rest.messages.JobVertexTaskManagersInfo.TaskManagersInfo)

Example 2 with TaskManagersInfo

use of org.apache.flink.runtime.rest.messages.JobVertexTaskManagersInfo.TaskManagersInfo in project flink by apache.

the class JobVertexTaskManagersInfoTest method getTestResponseInstance.

@Override
protected JobVertexTaskManagersInfo getTestResponseInstance() throws Exception {
    final Random random = new Random();
    List<TaskManagersInfo> taskManagersInfoList = new ArrayList<>();
    final Map<ExecutionState, Integer> statusCounts = new HashMap<>(ExecutionState.values().length);
    final IOMetricsInfo jobVertexMetrics = new IOMetricsInfo(random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean());
    int count = 100;
    for (ExecutionState executionState : ExecutionState.values()) {
        statusCounts.put(executionState, count++);
    }
    taskManagersInfoList.add(new TaskManagersInfo("host1", ExecutionState.CANCELING, 1L, 2L, 3L, jobVertexMetrics, statusCounts, "taskmanagerId"));
    return new JobVertexTaskManagersInfo(new JobVertexID(), "test", System.currentTimeMillis(), taskManagersInfoList);
}
Also used : ExecutionState(org.apache.flink.runtime.execution.ExecutionState) Random(java.util.Random) HashMap(java.util.HashMap) JobVertexID(org.apache.flink.runtime.jobgraph.JobVertexID) ArrayList(java.util.ArrayList) IOMetricsInfo(org.apache.flink.runtime.rest.messages.job.metrics.IOMetricsInfo) TaskManagersInfo(org.apache.flink.runtime.rest.messages.JobVertexTaskManagersInfo.TaskManagersInfo)

Example 3 with TaskManagersInfo

use of org.apache.flink.runtime.rest.messages.JobVertexTaskManagersInfo.TaskManagersInfo in project flink-mirror by flink-ci.

the class JobVertexTaskManagersInfoTest method getTestResponseInstance.

@Override
protected JobVertexTaskManagersInfo getTestResponseInstance() throws Exception {
    final Random random = new Random();
    List<TaskManagersInfo> taskManagersInfoList = new ArrayList<>();
    final Map<ExecutionState, Integer> statusCounts = new HashMap<>(ExecutionState.values().length);
    final IOMetricsInfo jobVertexMetrics = new IOMetricsInfo(random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean());
    int count = 100;
    for (ExecutionState executionState : ExecutionState.values()) {
        statusCounts.put(executionState, count++);
    }
    taskManagersInfoList.add(new TaskManagersInfo("host1", ExecutionState.CANCELING, 1L, 2L, 3L, jobVertexMetrics, statusCounts, "taskmanagerId"));
    return new JobVertexTaskManagersInfo(new JobVertexID(), "test", System.currentTimeMillis(), taskManagersInfoList);
}
Also used : ExecutionState(org.apache.flink.runtime.execution.ExecutionState) Random(java.util.Random) HashMap(java.util.HashMap) JobVertexID(org.apache.flink.runtime.jobgraph.JobVertexID) ArrayList(java.util.ArrayList) IOMetricsInfo(org.apache.flink.runtime.rest.messages.job.metrics.IOMetricsInfo) TaskManagersInfo(org.apache.flink.runtime.rest.messages.JobVertexTaskManagersInfo.TaskManagersInfo)

Aggregations

ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 Random (java.util.Random)3 ExecutionState (org.apache.flink.runtime.execution.ExecutionState)3 JobVertexID (org.apache.flink.runtime.jobgraph.JobVertexID)3 TaskManagersInfo (org.apache.flink.runtime.rest.messages.JobVertexTaskManagersInfo.TaskManagersInfo)3 IOMetricsInfo (org.apache.flink.runtime.rest.messages.job.metrics.IOMetricsInfo)3