@Override public int getIndexOfThisSubtask() { return taskInfo.getIndexOfThisSubtask(); }
@Override public void init() throws Exception { final String iterationId = getConfiguration().getIterationId(); if (iterationId == null || iterationId.length() == 0) { throw new Exception("Missing iteration ID in the task configuration"); } final String brokerID = StreamIterationHead.createBrokerIdString(getEnvironment().getJobID(), iterationId, getEnvironment().getTaskInfo().getIndexOfThisSubtask()); final long iterationWaitTime = getConfiguration().getIterationWaitTime(); LOG.info("Iteration tail {} trying to acquire feedback queue under {}", getName(), brokerID); @SuppressWarnings("unchecked") BlockingQueue<StreamRecord<IN>> dataChannel = (BlockingQueue<StreamRecord<IN>>) BlockingQueueBroker.INSTANCE.get(brokerID); LOG.info("Iteration tail {} acquired feedback queue {}", getName(), brokerID); this.headOperator = new RecordPusher<>(); this.headOperator.setup(this, getConfiguration(), new IterationTailOutput<>(dataChannel, iterationWaitTime)); // call super.init() last because that needs this.headOperator to be set up super.init(); }
operatorID, operatorClassName, taskInfo.getIndexOfThisSubtask(), taskInfo.getNumberOfParallelSubtasks());
getEnvironment().getTaskInfo().getIndexOfThisSubtask());
when(mockTaskInfo.getIndexOfThisSubtask()).thenReturn(0); Environment mockEnvironment = new MockEnvironmentBuilder().build();
taskInfo.getMaxNumberOfParallelSubtasks(), taskInfo.getNumberOfParallelSubtasks(), taskInfo.getIndexOfThisSubtask());
int numKeyGroups = getEnvironment().getTaskInfo().getMaxNumberOfParallelSubtasks(); int numSubtasks = getEnvironment().getTaskInfo().getNumberOfParallelSubtasks(); int subtaskIndex = getEnvironment().getTaskInfo().getIndexOfThisSubtask();
@Override public int getIndexOfThisSubtask() { return taskInfo.getIndexOfThisSubtask(); }
@Override public int getIndexOfThisSubtask() { return taskInfo.getIndexOfThisSubtask(); }
/** * Returns the index of this subtask in the subtask group. * * @return the index of this subtask in the subtask group */ public int getIndexInSubtaskGroup() { return this.environment.getTaskInfo().getIndexOfThisSubtask(); }
/** * Returns the index of this subtask in the subtask group. * * @return the index of this subtask in the subtask group */ public int getIndexInSubtaskGroup() { return this.environment.getTaskInfo().getIndexOfThisSubtask(); }
/** * Returns the index of this subtask in the subtask group. * * @return the index of this subtask in the subtask group */ public int getIndexInSubtaskGroup() { return this.environment.getTaskInfo().getIndexOfThisSubtask(); }
/** * Returns the index of this subtask in the subtask group. * * @return the index of this subtask in the subtask group */ public int getIndexInSubtaskGroup() { return this.environment.getTaskInfo().getIndexOfThisSubtask(); }
private String createOperatorIdentifier(StreamOperator<?> operator, int vertexId) { return operator.getClass().getSimpleName() + "_" + vertexId + "_" + getEnvironment().getTaskInfo().getIndexOfThisSubtask(); }
/** * Utility function that composes a string for logging purposes. The string includes the given message, * the given name of the task and the index in its subtask group as well as the number of instances * that exist in its subtask group. * * @param message The main message for the log. * @param taskName The name of the task. * @param parent The task that contains the code producing the message. * * @return The string for logging. */ public static String constructLogString(String message, String taskName, AbstractInvokable parent) { return message + ": " + taskName + " (" + (parent.getEnvironment().getTaskInfo().getIndexOfThisSubtask() + 1) + '/' + parent.getEnvironment().getTaskInfo().getNumberOfParallelSubtasks() + ')'; }
/** * Utility function that composes a string for logging purposes. The string includes the given message, * the given name of the task and the index in its subtask group as well as the number of instances * that exist in its subtask group. * * @param message The main message for the log. * @param taskName The name of the task. * @param parent The task that contains the code producing the message. * * @return The string for logging. */ public static String constructLogString(String message, String taskName, AbstractInvokable parent) { return message + ": " + taskName + " (" + (parent.getEnvironment().getTaskInfo().getIndexOfThisSubtask() + 1) + '/' + parent.getEnvironment().getTaskInfo().getNumberOfParallelSubtasks() + ')'; }
public String brokerKey() { if (brokerKey == null) { int iterationId = config.getIterationId(); brokerKey = getEnvironment().getJobID().toString() + '#' + iterationId + '#' + getEnvironment().getTaskInfo().getIndexOfThisSubtask(); } return brokerKey; }
public String brokerKey() { if (brokerKey == null) { int iterationId = config.getIterationId(); brokerKey = getEnvironment().getJobID().toString() + '#' + iterationId + '#' + getEnvironment().getTaskInfo().getIndexOfThisSubtask(); } return brokerKey; }
public String brokerKey() { if (brokerKey == null) { int iterationId = config.getIterationId(); brokerKey = getEnvironment().getJobID().toString() + '#' + iterationId + '#' + getEnvironment().getTaskInfo().getIndexOfThisSubtask(); } return brokerKey; }
public String brokerKey() { if (brokerKey == null) { int iterationId = config.getIterationId(); brokerKey = getEnvironment().getJobID().toString() + '#' + iterationId + '#' + getEnvironment().getTaskInfo().getIndexOfThisSubtask(); } return brokerKey; }