public TreeIndexDiskOrderScanOperatorNodePushable(IHyracksTaskContext ctx, int partition, IIndexDataflowHelperFactory indexHelperFactory, ISearchOperationCallbackFactory searchCallbackFactory) throws HyracksDataException { this.ctx = ctx; this.treeIndexHelper = indexHelperFactory.create(ctx.getJobletContext().getServiceContext(), partition); this.searchCallbackFactory = searchCallbackFactory; }
@Override protected RunFileWriter getRunFileWriter() throws HyracksDataException { FileReference file = ctx.getJobletContext().createManagedWorkspaceFile(HybridTopKSortRunGenerator.class.getSimpleName()); return new RunFileWriter(file, ctx.getIoManager()); }
@Override public IRecordReader<char[]> createRecordReader(IHyracksTaskContext ctx, int partition) throws HyracksDataException { return new PingReader(ctx.getJobletContext().getServiceContext().getNodeId()); }
public ActiveSourceOperatorNodePushable(IHyracksTaskContext ctx, ActiveRuntimeId runtimeId) { this.ctx = ctx; activeManager = (ActiveManager) ((INcApplicationContext) ctx.getJobletContext().getServiceContext() .getApplicationContext()).getActiveManager(); this.runtimeId = runtimeId; }
public IndexInsertUpdateDeleteOperatorNodePushable(IHyracksTaskContext ctx, int partition, IIndexDataflowHelperFactory indexHelperFactory, int[] fieldPermutation, RecordDescriptor inputRecDesc, IndexOperation op, IModificationOperationCallbackFactory modOpCallbackFactory, ITupleFilterFactory tupleFilterFactory) throws HyracksDataException { this.ctx = ctx; this.indexHelper = indexHelperFactory.create(ctx.getJobletContext().getServiceContext(), partition); this.modOpCallbackFactory = modOpCallbackFactory; this.tupleFilterFactory = tupleFilterFactory; this.inputRecDesc = inputRecDesc; this.op = op; this.tuple.setFieldPermutation(fieldPermutation); }
@Override public ITransactionSubsystem getTransactionSubsystem(IHyracksTaskContext ctx) { INcApplicationContext appCtx = (INcApplicationContext) ctx.getJobletContext().getServiceContext().getApplicationContext(); return appCtx.getTransactionSubsystem(); } }
@Override public IRecordReader<char[]> createRecordReader(IHyracksTaskContext ctx, int partition) throws HyracksDataException { INCServiceContext serviceCtx = ctx.getJobletContext().getServiceContext(); INcApplicationContext appCtx = (INcApplicationContext) serviceCtx.getApplicationContext(); DatasetLifecycleManager dsLifecycleMgr = (DatasetLifecycleManager) appCtx.getDatasetLifecycleManager(); DatasetResource dsr = dsLifecycleMgr.getDatasetLifecycle(datasetId); return new StorageComponentsReader(ctx.getJobletContext().getServiceContext().getNodeId(), dsr); }
@Override public IIndexBuilder create(IHyracksTaskContext ctx, int partition) throws HyracksDataException { FileReference resourceRef = fileSplitProvider.getFileSplits()[partition].getFileReference(ctx.getIoManager()); return new IndexBuilder(ctx.getJobletContext().getServiceContext(), storageManager, storageManager.getResourceIdFactory(ctx.getJobletContext().getServiceContext()), resourceRef, localResourceFactory, durable); } }
@Override public void open() throws HyracksDataException { state = new CollectTaskState(ctx.getJobletContext().getJobId(), new TaskId(getActivityId(), partition)); state.buffer = new ArrayList<Object[]>(); }
protected void createAndOpenFile() throws HyracksDataException { if (isInMemoryOpMode) { // In-memory mode should not generate a file. return; } if (searchResultWriter == null) { FileReference file = ctx.getJobletContext().createManagedWorkspaceFile(FILE_PREFIX); searchResultWriter = new RunFileWriter(file, ctx.getIoManager()); searchResultWriter.open(); isFileOpened = true; } }
@Override public void open() throws HyracksDataException { if (LOGGER.isEnabled(openCloseLevel)) { LOGGER.log(openCloseLevel, "open(" + pid + " by " + taId); } size = 0; eos = false; failed = false; deallocated = false; manager.registerPartition(pid, ctx.getJobletContext().getJobId().getCcId(), taId, this, PartitionState.STARTED, false); }
@Override public IRecordReader<char[]> createRecordReader(IHyracksTaskContext ctx, int partition) { INCServiceContext serviceCtx = ctx.getJobletContext().getServiceContext(); INcApplicationContext appCtx = (INcApplicationContext) serviceCtx.getApplicationContext(); DatasetLifecycleManager dsLifecycleMgr = (DatasetLifecycleManager) appCtx.getDatasetLifecycleManager(); DatasetResource dsr = dsLifecycleMgr.getDatasetLifecycle(datasetId); return new DatasetResourcesReader(dsr); }
@Override public IPushRuntime[] createPushRuntime(IHyracksTaskContext ctx) throws HyracksDataException { IJobletEventListenerFactory fact = ctx.getJobletContext().getJobletEventListenerFactory(); return new IPushRuntime[] { new CommitRuntime(ctx, ((IJobEventListenerFactory) fact).getTxnId(datasetId), datasetId, primaryKeyFields, isWriteTransaction, datasetPartitions[ctx.getTaskAttemptId().getTaskId().getPartition()], isSink) }; } }
@Override public void open() throws HyracksDataException { state = new MaterializerTaskState(ctx.getJobletContext().getJobId(), new TaskId(getActivityId(), partition)); state.open(ctx); }
@Override public void close() throws HyracksDataException { // expecting a range map if (numFields <= 0 || splitValues == null || splitValuesEndOffsets == null) { throw HyracksDataException.create(ErrorCode.NO_RANGEMAP_PRODUCED, sourceLoc); } // store the range map in the state object of ctx so that next activity (forward) could retrieve it TaskId rangeMapReaderTaskId = new TaskId(activityId, partition); RangeMapState rangeMapState = new RangeMapState(ctx.getJobletContext().getJobId(), rangeMapReaderTaskId); rangeMapState.rangeMap = new RangeMap(numFields, splitValues, splitValuesEndOffsets); ctx.setStateObject(rangeMapState); } }
@Override public void open() throws HyracksDataException { state = new ExternalGroupState(ctx.getJobletContext().getJobId(), stateId); ISpillableTable table = spillableTableFactory.buildSpillableTable(ctx, tableSize, fileSize, keyFields, comparators, firstNormalizerComputer, aggregatorFactory, inRecordDescriptor, outRecordDescriptor, framesLimit, 0); RunFileWriter[] runFileWriters = new RunFileWriter[table.getNumPartitions()]; this.externalGroupBy = new ExternalHashGroupBy(this, table, runFileWriters, inRecordDescriptor); state.setSpillableTable(table); state.setRuns(runFileWriters); state.setSpilledNumTuples(externalGroupBy.getSpilledNumTuples()); }
@Override public void open() throws HyracksDataException { state = new JoinCacheTaskState(ctx.getJobletContext().getJobId(), new TaskId(getActivityId(), partition)); state.joiner = new NestedLoopJoin(ctx, new FrameTupleAccessor(rd0), new FrameTupleAccessor(rd1), comparator, memSize, predEvaluator, isLeftOuter, nullWriters1); }
@Override public void open() throws HyracksDataException { state = new SortTaskState(ctx.getJobletContext().getJobId(), new TaskId(getActivityId(), partition)); IFrameBufferManager frameBufferManager = new VariableFrameMemoryManager( new VariableFramePool(ctx, VariableFramePool.UNLIMITED_MEMORY), FrameFreeSlotPolicyFactory.createFreeSlotPolicy(EnumFreeSlotPolicy.LAST_FIT)); state.frameSorter = new FrameSorterMergeSort(ctx, frameBufferManager, VariableFramePool.UNLIMITED_MEMORY, sortFields, keyNormalizerFactories, comparatorFactories, outRecDescs[0]); state.frameSorter.reset(); }
private void createSecondaryIndex() throws HyracksDataException, RemoteException, ACIDException, AlgebricksException { SecondaryIndexInfo secondaryIndexInfo = nc.createSecondaryIndex(primaryIndexInfo, secondaryIndex, storageManager, 0); IndexDataflowHelperFactory iHelperFactory = new IndexDataflowHelperFactory(nc.getStorageManager(), secondaryIndexInfo.getFileSplitProvider()); secondaryIndexDataflowHelper = iHelperFactory.create(taskCtx.getJobletContext().getServiceContext(), 0); secondaryIndexDataflowHelper.open(); secondaryLsmBtree = (TestLsmBtree) secondaryIndexDataflowHelper.getIndexInstance(); secondaryIndexDataflowHelper.close(); }
@Override public IPushRuntime[] createPushRuntime(IHyracksTaskContext ctx) throws HyracksDataException { return new IPushRuntime[] { new CommitRuntime(ctx, new TxnId(ctx.getJobletContext().getJobId().getId()), getDatasetId(), primaryKeyFieldPermutation, true, ctx.getTaskAttemptId().getTaskId().getPartition(), true) }; } };