public synchronized static IResourceLifecycleManager<IIndex> getIndexLifecycleManager() { if (lcManager == null) { lcManager = new IndexLifecycleManager(); } return lcManager; }
@Override public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx, IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException { return new TreeIndexStatsOperatorNodePushable(ctx, partition, indexHelperFactory, storageManager); } }
@Override public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx, IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException { return new IndexDropOperatorNodePushable(dataflowHelperFactory, options, ctx, partition); } }
public TreeIndexStatsOperatorNodePushable(IHyracksTaskContext ctx, int partition, IIndexDataflowHelperFactory indexHelperFactory, IStorageManager storageManager) throws HyracksDataException { this.ctx = ctx; this.treeIndexHelper = indexHelperFactory.create(ctx.getJobletContext().getServiceContext(), partition); this.storageManager = storageManager; }
public IndexDataflowHelperFactory getPrimaryIndexDataflowHelperFactory(PrimaryIndexInfo primaryIndexInfo, IStorageComponentProvider storageComponentProvider) throws AlgebricksException { return new IndexDataflowHelperFactory(storageComponentProvider.getStorageManager(), primaryIndexInfo.getFileSplitProvider()); }
@Override public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx, IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException { return new IndexInsertUpdateDeleteOperatorNodePushable(ctx, partition, indexHelperFactory, fieldPermutation, recordDescProvider.getInputRecordDescriptor(getActivityId(), 0), op, modificationOpCallbackFactory, tupleFilterFactory); } }
@Override public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx, IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException { return new IndexBulkLoadOperatorNodePushable(indexHelperFactory, ctx, partition, fieldPermutation, fillFactor, verifyInput, numElementsHint, checkIfEmptyIndex, recordDescProvider.getInputRecordDescriptor(this.getActivityId(), 0)); } }
@Override public void open(String resourcePath) throws HyracksDataException { IndexInfo info = indexInfos.get(resourcePath); if (info == null) { throw new HyracksDataException( "Failed to open index with resource name " + resourcePath + " since it does not exist."); } if (!info.isOpen) { allocateMemory(resourcePath); info.index.activate(); info.isOpen = true; } info.touch(); }
@Override public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx, IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException { return new TreeIndexDiskOrderScanOperatorNodePushable(ctx, partition, indexHelperFactory, searchCallbackFactory); } }
@Override public void initialize() throws HyracksDataException { dropIndex(); }
@Override public void close(String resourcePath) throws HyracksDataException { indexInfos.get(resourcePath).untouch(); }
@Override public void close() throws HyracksDataException { try { super.close(); } finally { if (primaryIndex != null) { primaryIndexHelper.close(); } } }
@Override public void open() throws HyracksDataException { super.open(); appender = new FrameTupleAppender(writeBuffer); }
@Override public void open() throws HyracksDataException { super.open(); ((ITwoPCIndex) index).setCurrentVersion(version); }
@Override public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx, IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException { return new IndexCreateOperatorNodePushable(indexBuilderFactory.create(ctx, partition)); } }
@Override public void stop(boolean dumpState, OutputStream outputStream) throws IOException { if (dumpState) { dumpState(outputStream); } for (IndexInfo i : indexInfos.values()) { if (i.isOpen) { i.index.deactivate(); } } }
@Override public void close() throws HyracksDataException { Throwable failure = releaseResources(); failure = CleanupUtils.close(writer, failure); if (failure != null) { throw HyracksDataException.create(failure); } }
private void writeFilterTupleToOutput(ITupleReference tuple) throws IOException { if (tuple != null) { writeTupleToOutput(tuple); } else { int[] offsets = nonFilterTupleBuild.getFieldEndOffsets(); for (int i = 0; i < offsets.length; i++) { int start = i > 0 ? offsets[i - 1] : 0; tb.addField(nonFilterTupleBuild.getByteArray(), start, offsets[i]); } } }
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; }
public IndexDropOperatorNodePushable(IIndexDataflowHelperFactory indexHelperFactory, Set<DropOption> options, IHyracksTaskContext ctx, int partition) throws HyracksDataException { this.indexHelper = indexHelperFactory.create(ctx.getJobletContext().getServiceContext(), partition); this.options = options; }