public static JobId create(DataInput dis) throws IOException { JobId jobId = new JobId(); jobId.readFields(dis); return jobId; }
public static JobId parse(String str) throws HyracksDataException { Matcher m = jobIdPattern.matcher(str); if (m.matches()) { int ccId = Integer.parseInt(m.group(1)); if (ccId <= 0xffff && ccId >= 0) { long jobId = Long.parseLong(m.group(2)) | (long) ccId << CcIdPartitionedLongFactory.ID_BITS; return new JobId(jobId); } } throw HyracksDataException.create(ErrorCode.NOT_A_JOBID, str); }
public ResultHandle(long jobId, long resultSetId) { this(new JobId(jobId), new ResultSetId(resultSetId)); }
public JobId create() { return new JobId(nextId()); }
private static PartitionId readPartitionId(DataInputStream dis) throws IOException { long jobId = dis.readLong(); int cdid = dis.readInt(); int senderIndex = dis.readInt(); int receiverIndex = dis.readInt(); PartitionId pid = new PartitionId(new JobId(jobId), new ConnectorDescriptorId(cdid), senderIndex, receiverIndex); return pid; }
public JobId newJobId() { return new JobId(jobCounter++); }
public JobId maxJobId() { return new JobId(maxId()); }
private static PartitionId readInitialMessage(ByteBuffer buffer) { JobId jobId = new JobId(buffer.getLong()); ConnectorDescriptorId cdid = new ConnectorDescriptorId(buffer.getInt()); int senderIndex = buffer.getInt(); int receiverIndex = buffer.getInt(); return new PartitionId(jobId, cdid, senderIndex, receiverIndex); }
@Override public void accept(ByteBuffer buffer) { JobId jobId = new JobId(buffer.getLong()); ResultSetId rsId = new ResultSetId(buffer.getLong()); int partition = buffer.getInt(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Received initial result partition read request for JobId: " + jobId + " partition: " + partition + " on channel: " + ccb); } noc = new NetworkOutputChannel(ccb, nBuffers); try { partitionManager.initializeResultPartitionReader(jobId, rsId, partition, noc); } catch (HyracksException e) { LOGGER.warn("Failed to initialize result partition reader", e); noc.abort(AbstractChannelWriteInterface.REMOTE_ERROR_CODE); } }
public static IHyracksTaskContext create(int frameSize, IOManager ioManager) { try { INCServiceContext serviceCtx = new TestNCServiceContext(ioManager, null); TestJobletContext jobletCtx = new TestJobletContext(frameSize, serviceCtx, new JobId(0)); TaskAttemptId tid = new TaskAttemptId(new TaskId(new ActivityId(new OperatorDescriptorId(0), 0), 0), 0); IHyracksTaskContext taskCtx = new TestTaskContext(jobletCtx, tid); return taskCtx; } catch (HyracksException e) { throw new RuntimeException(e); } }
queryCtx.put("1", new ClientJobRequest(queryCtx, "1", new JobId(1))); cancellationServlet.handle(mockRequest, mockResponse); verify(mockResponse, times(1)).setStatus(HttpResponseStatus.OK); queryCtx.put("2", new ClientJobRequest(queryCtx, "2", new JobId(2))); Mockito.doThrow(new Exception()).when(mockHcc).cancelJob(any()); mockRequest = mockRequest("2");
@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()); } }
ActiveNotificationHandler activeJobNotificationHandler = (ActiveNotificationHandler) appCtx.getActiveNotificationHandler(); JobId jobId = new JobId(1);