public SerializingLongReceiver createReceiver() throws Exception { TaskManagerLocation senderLocation = new TaskManagerLocation( ResourceID.generate(), LOCAL_ADDRESS, senderEnv.getConnectionManager().getDataPort()); InputGate receiverGate = createInputGate( jobId, dataSetID, executionAttemptID, senderLocation, receiverEnv, channels); SerializingLongReceiver receiver = new SerializingLongReceiver(receiverGate, channels * partitionIds.length); receiver.start(); return receiver; }
/** * Requests a remote subpartition. */ @Override void requestSubpartition(int subpartitionIndex) throws IOException, InterruptedException { if (partitionRequestClient == null) { // Create a client and request the partition partitionRequestClient = connectionManager .createPartitionRequestClient(connectionId); partitionRequestClient.requestSubpartition(partitionId, subpartitionIndex, this, 0); } }
public void start() throws IOException { synchronized (lock) { Preconditions.checkState(!isShutdown, "The NetworkEnvironment has already been shut down."); LOG.info("Starting the network environment and its components."); try { LOG.debug("Starting network connection manager"); connectionManager.start(resultPartitionManager, taskEventDispatcher); } catch (IOException t) { throw new IOException("Failed to instantiate network connection manager.", t); } if (kvStateServer != null) { try { LOG.debug("Starting the KvState server."); kvStateServer.start(); } catch (InterruptedException ie) { throw new IOException("Failed to start the KvState server.", ie); } } } }
/** * Releases all received buffers and closes the partition request client. */ @Override void releaseAllResources() throws IOException { if (isReleased.compareAndSet(false, true)) { synchronized (receivedBuffers) { Buffer buffer; while ((buffer = receivedBuffers.poll()) != null) { buffer.recycle(); } } // The released flag has to be set before closing the connection to ensure that // buffers received concurrently with closing are properly recycled. if (partitionRequestClient != null) { partitionRequestClient.close(this); } else { connectionManager.closeOpenChannelConnections(connectionId); } } }
connectionManager.shutdown();
private void createPartitionRequestClient() { synchronized (partitionRequestLock) { if (partitionRequestClient == null) { try { partitionRequestClient = connectionManager.createPartitionRequestClient(connectionId); } catch (Throwable t) { setError(new DataConsumptionException(partitionId, t)); } } } }
public void start() throws IOException { synchronized (lock) { Preconditions.checkState(!isShutdown, "The NetworkEnvironment has already been shut down."); LOG.info("Starting the network environment and its components."); try { LOG.debug("Starting network connection manager"); connectionManager.start(resultPartitionManager, taskEventDispatcher); } catch (IOException t) { throw new IOException("Failed to instantiate network connection manager.", t); } if (kvStateServer != null) { try { kvStateServer.start(); } catch (Throwable ie) { kvStateServer.shutdown(); kvStateServer = null; throw new IOException("Failed to start the Queryable State Data Server.", ie); } } if (kvStateProxy != null) { try { kvStateProxy.start(); } catch (Throwable ie) { kvStateProxy.shutdown(); kvStateProxy = null; throw new IOException("Failed to start the Queryable State Client Proxy.", ie); } } } }
partitionRequestClient.close(this); } else { connectionManager.closeOpenChannelConnections(connectionId);
connectionManager.shutdown();
resourceID, taskManagerServicesConfiguration.getTaskManagerAddress(), network.getConnectionManager().getDataPort());
/** * Requests a remote subpartition. */ @VisibleForTesting @Override public void requestSubpartition(int subpartitionIndex) throws IOException, InterruptedException { if (partitionRequestClient == null) { // Create a client and request the partition partitionRequestClient = connectionManager .createPartitionRequestClient(connectionId); partitionRequestClient.requestSubpartition(partitionId, subpartitionIndex, this, 0); } }
public void start() throws IOException { synchronized (lock) { Preconditions.checkState(!isShutdown, "The NetworkEnvironment has already been shut down."); LOG.info("Starting the network environment and its components."); try { LOG.debug("Starting network connection manager"); connectionManager.start(resultPartitionManager, taskEventDispatcher); } catch (IOException t) { throw new IOException("Failed to instantiate network connection manager.", t); } if (kvStateServer != null) { try { kvStateServer.start(); } catch (Throwable ie) { kvStateServer.shutdown(); kvStateServer = null; throw new IOException("Failed to start the Queryable State Data Server.", ie); } } if (kvStateProxy != null) { try { kvStateProxy.start(); } catch (Throwable ie) { kvStateProxy.shutdown(); kvStateProxy = null; throw new IOException("Failed to start the Queryable State Client Proxy.", ie); } } } }
partitionRequestClient.close(this); } else { connectionManager.closeOpenChannelConnections(connectionId);
connectionManager.shutdown();
resourceID, taskManagerServicesConfiguration.getTaskManagerAddress(), network.getConnectionManager().getDataPort());
/** * Requests a remote subpartition. */ @VisibleForTesting @Override public void requestSubpartition(int subpartitionIndex) throws IOException, InterruptedException { if (partitionRequestClient == null) { // Create a client and request the partition partitionRequestClient = connectionManager .createPartitionRequestClient(connectionId); partitionRequestClient.requestSubpartition(partitionId, subpartitionIndex, this, 0); } }
public void start() throws IOException { synchronized (lock) { Preconditions.checkState(!isShutdown, "The NetworkEnvironment has already been shut down."); LOG.info("Starting the network environment and its components."); try { LOG.debug("Starting network connection manager"); connectionManager.start(resultPartitionManager, taskEventDispatcher); } catch (IOException t) { throw new IOException("Failed to instantiate network connection manager.", t); } if (kvStateServer != null) { try { kvStateServer.start(); } catch (Throwable ie) { kvStateServer.shutdown(); kvStateServer = null; throw new IOException("Failed to start the Queryable State Data Server.", ie); } } if (kvStateProxy != null) { try { kvStateProxy.start(); } catch (Throwable ie) { kvStateProxy.shutdown(); kvStateProxy = null; throw new IOException("Failed to start the Queryable State Client Proxy.", ie); } } } }
partitionRequestClient.close(this); } else { connectionManager.closeOpenChannelConnections(connectionId);
connectionManager.shutdown();
resourceID, taskManagerServicesConfiguration.getTaskManagerAddress(), network.getConnectionManager().getDataPort());