@Override public String getPath() { return resource.getPath(); }
/** * @return the resource relative path */ public String getPath() { return resource.getPath(); }
@Override public ILSMComponentIdGenerator getComponentIdGenerator(INCServiceContext serviceCtx, IResource resource) throws HyracksDataException { IDatasetLifecycleManager dslcManager = ((INcApplicationContext) serviceCtx.getApplicationContext()).getDatasetLifecycleManager(); int partition = StoragePathUtil.getPartitionNumFromRelativePath(resource.getPath()); return dslcManager.getComponentIdGenerator(datasetId, partition, resource.getPath()); }
@Override public ILSMOperationTracker getOperationTracker(INCServiceContext ctx, IResource resource) throws HyracksDataException { IDatasetLifecycleManager dslcManager = ((INcApplicationContext) ctx.getApplicationContext()).getDatasetLifecycleManager(); int partition = StoragePathUtil.getPartitionNumFromRelativePath(resource.getPath()); return dslcManager.getOperationTracker(datasetId, partition, resource.getPath()); }
@Override public ILSMOperationTracker getOperationTracker(INCServiceContext ctx, IResource resource) { try { INcApplicationContext appCtx = (INcApplicationContext) ctx.getApplicationContext(); DatasetLifecycleManager dslcManager = (DatasetLifecycleManager) appCtx.getDatasetLifecycleManager(); DatasetResource dsr = dslcManager.getDatasetLifecycle(datasetId); int partition = StoragePathUtil.getPartitionNumFromRelativePath(resource.getPath()); PrimaryIndexOperationTracker opTracker = dslcManager.getOperationTracker(datasetId, partition, resource.getPath()); if (!(opTracker instanceof TestPrimaryIndexOperationTracker)) { Field opTrackersField = DatasetResource.class.getDeclaredField("datasetPrimaryOpTrackers"); opTracker = new TestPrimaryIndexOperationTracker(datasetId, partition, appCtx.getTransactionSubsystem().getLogManager(), dsr.getDatasetInfo(), dslcManager.getComponentIdGenerator(datasetId, partition, resource.getPath())); replaceMapEntry(opTrackersField, dsr, partition, opTracker); } return opTracker; } catch (Exception e) { throw new RuntimeException(e); } }