public static TaskAttemptId parse(String str) { if (str.startsWith("TAID:")) { str = str.substring(5); int idIdx = str.lastIndexOf(':'); return new TaskAttemptId(TaskId.parse(str.substring(0, idIdx)), Integer.parseInt(str.substring(idIdx + 1))); } throw new IllegalArgumentException("Unable to parse: " + str); }
public static TaskAttemptId create(DataInput dis) throws IOException { TaskAttemptId taskAttemptId = new TaskAttemptId(); taskAttemptId.readFields(dis); return taskAttemptId; }
private static TaskAttemptId readTaskAttemptId(DataInputStream dis) throws IOException { int odid = dis.readInt(); int aid = dis.readInt(); int partition = dis.readInt(); int attempt = dis.readInt(); TaskAttemptId taId = new TaskAttemptId(new TaskId(new ActivityId(new OperatorDescriptorId(odid), aid), partition), attempt); return taId; }
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); } }
public IHyracksTaskContext createTestContext(JobId jobId, int partition, boolean withMessaging) throws HyracksDataException { IHyracksTaskContext ctx = TestUtils.create(KB32, ExecutionTestUtil.integrationUtil.ncs[0].getIoManager()); if (withMessaging) { TaskUtil.put(HyracksConstants.KEY_MESSAGE, new VSizeFrame(ctx), ctx); } IHyracksJobletContext jobletCtx = Mockito.mock(IHyracksJobletContext.class); JobEventListenerFactory factory = new JobEventListenerFactory(new TxnId(jobId.getId()), true); Mockito.when(jobletCtx.getJobletEventListenerFactory()).thenReturn(factory); Mockito.when(jobletCtx.getServiceContext()).thenReturn(ExecutionTestUtil.integrationUtil.ncs[0].getContext()); Mockito.when(jobletCtx.getJobId()).thenReturn(jobId); ctx = Mockito.spy(ctx); Mockito.when(ctx.getJobletContext()).thenReturn(jobletCtx); Mockito.when(ctx.getIoManager()).thenReturn(ExecutionTestUtil.integrationUtil.ncs[0].getIoManager()); TaskAttemptId taskId = new TaskAttemptId(new TaskId(new ActivityId(new OperatorDescriptorId(0), 0), partition), 0); Mockito.when(ctx.getTaskAttemptId()).thenReturn(taskId); return ctx; }
TaskId tid = ts.getTaskId(); TaskAttempt taskAttempt = new TaskAttempt(tcAttempt, new TaskAttemptId(new TaskId(tid.getActivityId(), tid.getPartition()), attempts), ts); taskAttempt.setStatus(TaskAttempt.TaskStatus.INITIALIZED, null); locationMap.put(tid,