PartitionProducerStateChecker partitionProducerStateChecker = mock(PartitionProducerStateChecker.class); Executor executor = mock(Executor.class); TaskEventDispatcher taskEventDispatcher = new TaskEventDispatcher();
@Override void sendTaskEvent(TaskEvent event) throws IOException { checkError(); checkState(subpartitionView != null, "Tried to send task event to producer before requesting the subpartition."); if (!taskEventDispatcher.publish(partitionId, event)) { throw new IOException("Error while publishing event " + event + " to producer. The producer could not be found."); } }
taskEventDispatcher.clearAll();
private SuperstepBarrier initSuperstepBarrier() { SuperstepBarrier barrier = new SuperstepBarrier(getUserCodeClassLoader()); TaskEventDispatcher taskEventDispatcher = getEnvironment().getTaskEventDispatcher(); ResultPartitionID partitionId = toSyncPartitionId; taskEventDispatcher.subscribeToEvent(partitionId, barrier, AllWorkersDoneEvent.class); taskEventDispatcher.subscribeToEvent(partitionId, barrier, TerminationEvent.class); return barrier; }
@VisibleForTesting public void setupPartition(InternalResultPartition partition) throws IOException { BufferPool bufferPool = null; try { int extraNetworkBufferThisPartition = extraNetworkBuffersPerGate >= 0 ? extraNetworkBuffersPerGate : partition.getNumberOfSubpartitions() * networkBuffersPerSubpartition; int numberOfMemorySegments = partition.getNumberOfSubpartitions() * networkBuffersPerSubpartition + extraNetworkBufferThisPartition; bufferPool = networkBufferPool.createBufferPool(numberOfMemorySegments, numberOfMemorySegments); partition.registerBufferPool(bufferPool); resultPartitionManager.registerResultPartition(partition); } catch (Throwable t) { if (bufferPool != null) { bufferPool.lazyDestroy(); } if (t instanceof IOException) { throw (IOException) t; } else { throw new IOException(t.getMessage(), t); } } taskEventDispatcher.registerPartition(partition.getPartitionId()); }
taskEventDispatcher.unregisterPartition(partition.getPartitionId()); partition.destroyBufferPool();
@Override void sendTaskEvent(TaskEvent event) throws IOException { checkError(); checkState(subpartitionView != null, "Tried to send task event to producer before requesting the subpartition."); if (!taskEventDispatcher.publish(partitionId, event)) { throw new IOException("Error while publishing event " + event + " to producer. The producer could not be found."); } }
taskEventDispatcher.clearAll();
private SuperstepBarrier initSuperstepBarrier() { SuperstepBarrier barrier = new SuperstepBarrier(getUserCodeClassLoader()); TaskEventDispatcher taskEventDispatcher = getEnvironment().getTaskEventDispatcher(); ResultPartitionID partitionId = toSyncPartitionId; taskEventDispatcher.subscribeToEvent(partitionId, barrier, AllWorkersDoneEvent.class); taskEventDispatcher.subscribeToEvent(partitionId, barrier, TerminationEvent.class); return barrier; }
@VisibleForTesting public void setupPartition(ResultPartition partition) throws IOException { BufferPool bufferPool = null; try { int maxNumberOfMemorySegments = partition.getPartitionType().isBounded() ? partition.getNumberOfSubpartitions() * networkBuffersPerChannel + extraNetworkBuffersPerGate : Integer.MAX_VALUE; // If the partition type is back pressure-free, we register with the buffer pool for // callbacks to release memory. bufferPool = networkBufferPool.createBufferPool(partition.getNumberOfSubpartitions(), maxNumberOfMemorySegments, partition.getPartitionType().hasBackPressure() ? Optional.empty() : Optional.of(partition)); partition.registerBufferPool(bufferPool); resultPartitionManager.registerResultPartition(partition); } catch (Throwable t) { if (bufferPool != null) { bufferPool.lazyDestroy(); } if (t instanceof IOException) { throw (IOException) t; } else { throw new IOException(t.getMessage(), t); } } taskEventDispatcher.registerPartition(partition.getPartitionId()); }
taskEventDispatcher.unregisterPartition(partition.getPartitionId()); partition.destroyBufferPool();
TaskEventDispatcher taskEventDispatcher = new TaskEventDispatcher(); NetworkEnvironment network = mock(NetworkEnvironment.class); when(network.createKvStateTaskRegistry(any(JobID.class), any(JobVertexID.class))).thenReturn(mockKvRegistry);
@Override void sendTaskEvent(TaskEvent event) throws IOException { checkError(); checkState(subpartitionView != null, "Tried to send task event to producer before requesting the subpartition."); if (!taskEventDispatcher.publish(partitionId, event)) { throw new IOException("Error while publishing event " + event + " to producer. The producer could not be found."); } }
taskEventDispatcher.clearAll();
private SuperstepBarrier initSuperstepBarrier() { SuperstepBarrier barrier = new SuperstepBarrier(getUserCodeClassLoader()); TaskEventDispatcher taskEventDispatcher = getEnvironment().getTaskEventDispatcher(); ResultPartitionID partitionId = toSyncPartitionId; taskEventDispatcher.subscribeToEvent(partitionId, barrier, AllWorkersDoneEvent.class); taskEventDispatcher.subscribeToEvent(partitionId, barrier, TerminationEvent.class); return barrier; }
@VisibleForTesting public void setupPartition(ResultPartition partition) throws IOException { BufferPool bufferPool = null; try { int maxNumberOfMemorySegments = partition.getPartitionType().isBounded() ? partition.getNumberOfSubpartitions() * networkBuffersPerChannel + extraNetworkBuffersPerGate : Integer.MAX_VALUE; // If the partition type is back pressure-free, we register with the buffer pool for // callbacks to release memory. bufferPool = networkBufferPool.createBufferPool(partition.getNumberOfSubpartitions(), maxNumberOfMemorySegments, partition.getPartitionType().hasBackPressure() ? Optional.empty() : Optional.of(partition)); partition.registerBufferPool(bufferPool); resultPartitionManager.registerResultPartition(partition); } catch (Throwable t) { if (bufferPool != null) { bufferPool.lazyDestroy(); } if (t instanceof IOException) { throw (IOException) t; } else { throw new IOException(t.getMessage(), t); } } taskEventDispatcher.registerPartition(partition.getPartitionId()); }
taskEventDispatcher.unregisterPartition(partition.getPartitionId()); partition.destroyBufferPool();
int mode) throws IOException { TaskEventDispatcher taskEventDispatcher = new TaskEventDispatcher(); NetworkEnvironment networkEnvironment = mock(NetworkEnvironment.class); when(networkEnvironment.createKvStateTaskRegistry(any(JobID.class), any(JobVertexID.class)))
@Override void sendTaskEvent(TaskEvent event) throws IOException { checkError(); checkState(subpartitionView != null, "Tried to send task event to producer before requesting the subpartition."); if (!taskEventDispatcher.publish(partitionId, event)) { throw new IOException("Error while publishing event " + event + " to producer. The producer could not be found."); } }
taskEventDispatcher.clearAll();