private final static TaskName getStandbyTaskName(TaskName activeTaskName, int replicaNum) { return new TaskName(STANDBY_TASKNAME_PREFIX.concat(TASKNAME_SEPARATOR) .concat(activeTaskName.getTaskName()) .concat(TASKNAME_SEPARATOR) .concat(String.valueOf(replicaNum))); } }
/** * Write the taskName to partition mapping. * @param changelogEntries The entries that needs to be written to the coordinator stream, the map takes the taskName * and it's corresponding changelog partition. */ public void writePartitionMapping(Map<TaskName, Integer> changelogEntries) { LOG.debug("Updating changelog information with: "); for (Map.Entry<TaskName, Integer> entry : changelogEntries.entrySet()) { LOG.debug("TaskName: {} to Partition: {}", entry.getKey().getTaskName(), entry.getValue()); coordinatorStreamManager.send(new SetChangelogMapping(SOURCE, entry.getKey().getTaskName(), entry.getValue())); } }
/** * Write the taskName to partition mapping. * @param changelogEntries The entries that needs to be written to the coordinator stream, the map takes the taskName * and it's corresponding changelog partition. */ public void writePartitionMapping(Map<TaskName, Integer> changelogEntries) { LOG.debug("Updating changelog information with: "); for (Map.Entry<TaskName, Integer> entry : changelogEntries.entrySet()) { LOG.debug("TaskName: {} to Partition: {}", entry.getKey().getTaskName(), entry.getValue()); coordinatorStreamManager.send(new SetChangelogMapping(SOURCE, entry.getKey().getTaskName(), entry.getValue())); } }
/** * Write the taskName to partition mapping. * @param changelogEntries The entries that needs to be written to the coordinator stream, the map takes the taskName * and it's corresponding changelog partition. */ public void writePartitionMapping(Map<TaskName, Integer> changelogEntries) { LOG.debug("Updating changelog information with: "); for (Map.Entry<TaskName, Integer> entry : changelogEntries.entrySet()) { LOG.debug("TaskName: {} to Partition: {}", entry.getKey().getTaskName(), entry.getValue()); coordinatorStreamManager.send(new SetChangelogMapping(SOURCE, entry.getKey().getTaskName(), entry.getValue())); } }
/** * Write the taskName to partition mapping. * @param changelogEntries The entries that needs to be written to the coordinator stream, the map takes the taskName * and it's corresponding changelog partition. */ public void writePartitionMapping(Map<TaskName, Integer> changelogEntries) { LOG.debug("Updating changelog information with: "); for (Map.Entry<TaskName, Integer> entry : changelogEntries.entrySet()) { LOG.debug("TaskName: {} to Partition: {}", entry.getKey().getTaskName(), entry.getValue()); coordinatorStreamManager.send(new SetChangelogMapping(SOURCE, entry.getKey().getTaskName(), entry.getValue())); } }
/** * Write the taskName to partition mapping. * @param changelogEntries The entries that needs to be written to the coordinator stream, the map takes the taskName * and it's corresponding changelog partition. */ public void writePartitionMapping(Map<TaskName, Integer> changelogEntries) { LOG.debug("Updating changelog information with: "); for (Map.Entry<TaskName, Integer> entry : changelogEntries.entrySet()) { LOG.debug("TaskName: {} to Partition: {}", entry.getKey().getTaskName(), entry.getValue()); coordinatorStreamManager.send(new SetChangelogMapping(SOURCE, entry.getKey().getTaskName(), entry.getValue())); } }
/** * Saves the task assignments specified by containers using the provided TaskAssignementManager. * * @param containers the set of containers from which the task assignments will be saved. * @param taskAssignmentManager the {@link TaskAssignmentManager} that will be used to save the mappings. */ private void saveTaskAssignments(Set<ContainerModel> containers, TaskAssignmentManager taskAssignmentManager) { for (ContainerModel container : containers) { for (TaskName taskName : container.getTasks().keySet()) { taskAssignmentManager.writeTaskContainerMapping(taskName.getTaskName(), container.getId()); } } }
/** * Saves the task assignments specified by containers using the provided TaskAssignementManager. * * @param containers the set of containers from which the task assignments will be saved. * @param taskAssignmentManager the {@link TaskAssignmentManager} that will be used to save the mappings. */ private void saveTaskAssignments(Set<ContainerModel> containers, TaskAssignmentManager taskAssignmentManager) { for (ContainerModel container : containers) { for (TaskName taskName : container.getTasks().keySet()) { taskAssignmentManager.writeTaskContainerMapping(taskName.getTaskName(), container.getId()); } } }
/** * Saves the task assignments specified by containers using the provided TaskAssignementManager. * * @param containers the set of containers from which the task assignments will be saved. * @param taskAssignmentManager the {@link TaskAssignmentManager} that will be used to save the mappings. */ private void saveTaskAssignments(Set<ContainerModel> containers, TaskAssignmentManager taskAssignmentManager) { for (ContainerModel container : containers) { for (TaskName taskName : container.getTasks().keySet()) { taskAssignmentManager.writeTaskContainerMapping(taskName.getTaskName(), container.getId()); } } }
BroadcastOperatorImpl(BroadcastOperatorSpec<M> broadcastOpSpec, SystemStream systemStream, Context context) { this.broadcastOpSpec = broadcastOpSpec; this.systemStream = systemStream; this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); }
BroadcastOperatorImpl(BroadcastOperatorSpec<M> broadcastOpSpec, SystemStream systemStream, Context context) { this.broadcastOpSpec = broadcastOpSpec; this.systemStream = systemStream; this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); }
BroadcastOperatorImpl(BroadcastOperatorSpec<M> broadcastOpSpec, SystemStream systemStream, Context context) { this.broadcastOpSpec = broadcastOpSpec; this.systemStream = systemStream; this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); }
BroadcastOperatorImpl(BroadcastOperatorSpec<M> broadcastOpSpec, SystemStream systemStream, Context context) { this.broadcastOpSpec = broadcastOpSpec; this.systemStream = systemStream; this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); }
BroadcastOperatorImpl(BroadcastOperatorSpec<M> broadcastOpSpec, SystemStream systemStream, Context context) { this.broadcastOpSpec = broadcastOpSpec; this.systemStream = systemStream; this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); }
public static Map<String, String> generateTaskAssignments(int numContainers, int taskCount) { Map<String, String> mapping = new HashMap<>(taskCount); Set<ContainerModel> containers = generateContainerModels(numContainers, taskCount); for (ContainerModel container : containers) { for (TaskName taskName : container.getTasks().keySet()) { mapping.put(taskName.getTaskName(), container.getId()); } } return mapping; }
PartitionByOperatorImpl(PartitionByOperatorSpec<M, K, V> partitionByOpSpec, SystemStream systemStream, Context context) { this.partitionByOpSpec = partitionByOpSpec; this.systemStream = systemStream; this.keyFunction = partitionByOpSpec.getKeyFunction(); this.valueFunction = partitionByOpSpec.getValueFunction(); this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); StreamMetadataCache streamMetadataCache = ((TaskContextImpl) context.getTaskContext()).getStreamMetadataCache(); this.controlMessageSender = new ControlMessageSender(streamMetadataCache); }
PartitionByOperatorImpl(PartitionByOperatorSpec<M, K, V> partitionByOpSpec, SystemStream systemStream, Context context) { this.partitionByOpSpec = partitionByOpSpec; this.systemStream = systemStream; this.keyFunction = partitionByOpSpec.getKeyFunction(); this.valueFunction = partitionByOpSpec.getValueFunction(); this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); StreamMetadataCache streamMetadataCache = ((TaskContextImpl) context.getTaskContext()).getStreamMetadataCache(); this.controlMessageSender = new ControlMessageSender(streamMetadataCache); }
PartitionByOperatorImpl(PartitionByOperatorSpec<M, K, V> partitionByOpSpec, SystemStream systemStream, Context context) { this.partitionByOpSpec = partitionByOpSpec; this.systemStream = systemStream; this.keyFunction = partitionByOpSpec.getKeyFunction(); this.valueFunction = partitionByOpSpec.getValueFunction(); this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); StreamMetadataCache streamMetadataCache = ((TaskContextImpl) context.getTaskContext()).getStreamMetadataCache(); this.controlMessageSender = new ControlMessageSender(streamMetadataCache); }
PartitionByOperatorImpl(PartitionByOperatorSpec<M, K, V> partitionByOpSpec, SystemStream systemStream, Context context) { this.partitionByOpSpec = partitionByOpSpec; this.systemStream = systemStream; this.keyFunction = partitionByOpSpec.getKeyFunction(); this.valueFunction = partitionByOpSpec.getValueFunction(); this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); StreamMetadataCache streamMetadataCache = ((TaskContextImpl) context.getTaskContext()).getStreamMetadataCache(); this.controlMessageSender = new ControlMessageSender(streamMetadataCache); }
PartitionByOperatorImpl(PartitionByOperatorSpec<M, K, V> partitionByOpSpec, SystemStream systemStream, Context context) { this.partitionByOpSpec = partitionByOpSpec; this.systemStream = systemStream; this.keyFunction = partitionByOpSpec.getKeyFunction(); this.valueFunction = partitionByOpSpec.getValueFunction(); this.taskName = context.getTaskContext().getTaskModel().getTaskName().getTaskName(); StreamMetadataCache streamMetadataCache = ((TaskContextImpl) context.getTaskContext()).getStreamMetadataCache(); this.controlMessageSender = new ControlMessageSender(streamMetadataCache); }