private JsonNode getNetDiagnostics() { final NCServiceContext serviceContext = (NCServiceContext) appCtx.getServiceContext(); final NodeControllerService controllerService = (NodeControllerService) serviceContext.getControllerService(); final NetworkManager networkManager = controllerService.getNetworkManager(); return networkManager.getMuxDemux().getState(); } }
@Override public void run() { try { Map<JobId, Joblet> jobletMap = ncs.getJobletMap(); Joblet ji = jobletMap.get(pid.getJobId()); if (ji != null) { PartitionChannel channel = new PartitionChannel(pid, new NetworkInputChannel(ncs.getNetworkManager(), new InetSocketAddress( InetAddress.getByAddress(networkAddress.lookupIpAddress()), networkAddress.getPort()), pid, 5)); ji.reportPartitionAvailability(channel); } } catch (Exception e) { throw new RuntimeException(e); } } }
td.getTaskAttemptId().getTaskId().getPartition()); PartitionChannel channel = new PartitionChannel(pid, new NetworkInputChannel(ncs.getNetworkManager(), new InetSocketAddress( InetAddress.getByAddress(networkAddress.lookupIpAddress()),
MuxDemuxPerformanceCounters netPC = ncs.getNetworkManager().getPerformanceCounters(); hbData.netPayloadBytesRead = netPC.getPayloadBytesRead(); hbData.netPayloadBytesWritten = netPC.getPayloadBytesWritten();
@Test public void failedJobPartitionRequestTest() throws Exception { final NodeControllerService nc1 = integrationUtil.ncs[0]; final NodeControllerService nc2 = integrationUtil.ncs[1]; final JobId failedJob = new JobId(-1); nc2.getPartitionManager().jobCompleted(failedJob, JobStatus.FAILURE); final NetworkAddress localNetworkAddress = nc2.getNetworkManager().getPublicNetworkAddress(); final InetSocketAddress nc2Address = new InetSocketAddress(localNetworkAddress.getAddress(), localNetworkAddress.getPort()); PartitionId id = new PartitionId(failedJob, new ConnectorDescriptorId(1), 0, 1); NetworkInputChannel inputChannel = new NetworkInputChannel(nc1.getNetworkManager(), nc2Address, id, 1); InputChannelFrameReader frameReader = new InputChannelFrameReader(inputChannel); inputChannel.registerMonitor(frameReader); AtomicBoolean failed = new AtomicBoolean(false); Thread reader = new Thread(() -> { try { failed.set(!frameReader.nextFrame(new FixedSizeFrame())); } catch (HyracksDataException e) { e.printStackTrace(); } }); reader.start(); final IHyracksCommonContext context = Mockito.mock(IHyracksCommonContext.class); Mockito.when(context.getInitialFrameSize()).thenReturn(2000); inputChannel.open(context); reader.join(5000); Assert.assertTrue(failed.get()); } }
final ConnectorDescriptorId codId = new ConnectorDescriptorId(1); final PartitionId pid = new PartitionId(ctx.getJobletContext().getJobId(), codId, 1, 1); final ChannelControlBlock ccb = ncs.getNetworkManager() .connect(NetworkingUtil.getSocketAddress(ncs.getNetworkManager().getLocalNetworkAddress())); final NetworkOutputChannel networkOutputChannel = new NetworkOutputChannel(ccb, 0); final MaterializingPipelinedPartition mpp =