public MuxDemuxPerformanceCounters getPerformanceCounters() { return md.getPerformanceCounters(); } }
public ClientNetworkManager(int nThreads, ISocketChannelFactory socketChannelFactory) { /* This is a connect only socket and does not listen to any incoming connections, so pass null to * localAddress and listener. */ md = new MuxDemux(null, null, nThreads, MAX_CONNECTION_ATTEMPTS, FullFrameChannelInterfaceFactory.INSTANCE, socketChannelFactory); }
public void start() throws IOException { md.start(); }
public void start() throws IOException { md.start(); InetSocketAddress sockAddr = md.getLocalAddress(); localNetworkAddress = new NetworkAddress(sockAddr.getHostString(), sockAddr.getPort()); // See if the public address was explicitly specified, and if not, // make it a copy of localNetworkAddress if (publicNetworkAddress.getAddress() == null) { publicNetworkAddress = localNetworkAddress; } else { // Likewise for public port if (publicNetworkAddress.getPort() == 0) { publicNetworkAddress = new NetworkAddress(publicNetworkAddress.getAddress(), sockAddr.getPort()); } } }
throw new NetException("Socket Closed"); muxDemux.getPerformanceCounters().addSignalingBytesRead(read); if (readerState.readBuffer.remaining() > 0) { return; int channelId = readerState.command.getChannelId(); ccb = cSet.registerChannel(channelId); muxDemux.getChannelOpenListener().channelOpened(ccb); ++chunksRead; int newPendingReadSize = readerState.ccb.read(sc, readerState.pendingReadSize); muxDemux.getPerformanceCounters().addPayloadBytesRead(readerState.pendingReadSize - newPendingReadSize); readerState.pendingReadSize = newPendingReadSize; if (readerState.pendingReadSize > 0) {
@Override public ChannelControlBlock connect(SocketAddress remoteAddress) throws InterruptedException, NetException { MultiplexedConnection mConn = md.connect((InetSocketAddress) remoteAddress); return mConn.openChannel(); }
public IChannelInterfaceFactory getChannelInterfaceFactory() { return muxDemux.getChannelInterfaceFactory(); }
private JsonNode getNetDiagnostics() { final NCServiceContext serviceContext = (NCServiceContext) appCtx.getServiceContext(); final NodeControllerService controllerService = (NodeControllerService) serviceContext.getControllerService(); final NetworkManager networkManager = controllerService.getNetworkManager(); return networkManager.getMuxDemux().getState(); } }
public void start() throws IOException { md.start(); InetSocketAddress sockAddr = md.getLocalAddress(); localNetworkAddress = new NetworkAddress(sockAddr.getHostString(), sockAddr.getPort()); // See if the public address was explicitly specified, and if not, // make it a copy of localNetworkAddress if (publicNetworkAddress.getAddress() == null) { publicNetworkAddress = localNetworkAddress; } else { // Likewise for public port if (publicNetworkAddress.getPort() == 0) { publicNetworkAddress = new NetworkAddress(publicNetworkAddress.getAddress(), sockAddr.getPort()); } } }
public ChannelControlBlock connect(SocketAddress remoteAddress) throws InterruptedException, NetException { MultiplexedConnection mConn = md.connect((InetSocketAddress) remoteAddress); return mConn.openChannel(); }
public MuxDemuxPerformanceCounters getPerformanceCounters() { return md.getPerformanceCounters(); } }
public void start() throws IOException { md.start(); InetSocketAddress sockAddr = md.getLocalAddress(); localNetworkAddress = new NetworkAddress(sockAddr.getHostString(), sockAddr.getPort()); // See if the public address was explicitly specified, and if not, // make it a copy of localNetworkAddress if (publicNetworkAddress.getAddress() == null) { publicNetworkAddress = localNetworkAddress; } else { // Likewise for public port if (publicNetworkAddress.getPort() == 0) { publicNetworkAddress = new NetworkAddress(publicNetworkAddress.getAddress(), sockAddr.getPort()); } } }
public ChannelControlBlock connect(SocketAddress remoteAddress) throws InterruptedException, NetException { MultiplexedConnection mConn = md.connect((InetSocketAddress) remoteAddress); return mConn.openChannel(); }
public NetworkManager(String inetAddress, int inetPort, PartitionManager partitionManager, int nThreads, int nBuffers, String publicInetAddress, int publicInetPort, IChannelInterfaceFactory channelInterfaceFactory, ISocketChannelFactory socketChannelFactory) { this.partitionManager = partitionManager; this.nBuffers = nBuffers; md = new MuxDemux(new InetSocketAddress(inetAddress, inetPort), new ChannelOpenListener(), nThreads, MAX_CONNECTION_ATTEMPTS, channelInterfaceFactory, socketChannelFactory); // Just save these values for the moment; may be reset in start() publicNetworkAddress = new NetworkAddress(publicInetAddress, publicInetPort); }
public MuxDemuxPerformanceCounters getPerformanceCounters() { return md.getPerformanceCounters(); } }
private ChannelControlBlock connect(SocketAddress remoteAddress) throws InterruptedException, NetException { MultiplexedConnection mConn = md.connect((InetSocketAddress) remoteAddress); return mConn.openChannel(); }
public MessagingNetworkManager(NodeControllerService ncs, String inetAddress, int inetPort, int nThreads, String publicInetAddress, int publicInetPort, IChannelInterfaceFactory channelInterfaceFactory, ISocketChannelFactory socketChannelFactory) { this.ncs = ncs; md = new MuxDemux(new InetSocketAddress(inetAddress, inetPort), new ChannelOpenListener(), nThreads, MAX_CONNECTION_ATTEMPTS, channelInterfaceFactory, socketChannelFactory); publicNetworkAddress = new NetworkAddress(publicInetAddress, publicInetPort); }
public MuxDemuxPerformanceCounters getPerformanceCounters() { return md.getPerformanceCounters(); }
/** * @param inetAddress * - Internet address to bind the listen port to * @param inetPort * - Port to bind on inetAddress * @param publicInetAddress * - Internet address to report to consumers; * useful when behind NAT. null = same as inetAddress * @param publicInetPort * - Port to report to consumers; useful when * behind NAT. Ignored if publicInetAddress is null. 0 = same as inetPort */ public ResultNetworkManager(String inetAddress, int inetPort, IResultPartitionManager partitionManager, int nThreads, int nBuffers, String publicInetAddress, int publicInetPort, IChannelInterfaceFactory channelInterfaceFactory, ISocketChannelFactory socketChannelFactory) { this.partitionManager = partitionManager; this.nBuffers = nBuffers; md = new MuxDemux(new InetSocketAddress(inetAddress, inetPort), new ChannelOpenListener(), nThreads, MAX_CONNECTION_ATTEMPTS, channelInterfaceFactory, socketChannelFactory); // Just save these values for the moment; may be reset in start() publicNetworkAddress = new NetworkAddress(publicInetAddress, publicInetPort); }
if (len > 0) { int written = sc.write(cmdWriteBuffer); muxDemux.getPerformanceCounters().addSignalingBytesWritten(written); if (written < len) { return false; pendingBuffer.limit(pendingWriteSize + pendingBuffer.position()); int written = sc.write(pendingBuffer); muxDemux.getPerformanceCounters().addPayloadBytesWritten(written); pendingWriteSize -= written; } finally {