@Override public LocalResource getResource() throws HyracksDataException { return localResourceRepository.get(resourceRef.getRelativePath()); } }
public ResourceIdFactory createResourceIdFactory() throws HyracksDataException { long largestResourceId = localResourceRepository.maxId(); return new ResourceIdFactory(largestResourceId); } }
LocalResource lr = localResourceRepository.get(resourceRef.getRelativePath()); long resourceId = lr == null ? -1 : lr.getId(); if (resourceId != -1) { localResourceRepository.delete(resourceRef.getRelativePath()); localResourceRepository.insert(lr); } catch (IOException e) { throw HyracksDataException.create(e);
@Override public void destroy() throws HyracksDataException { LOGGER.log(Level.INFO, "Dropping index " + resourceRef.getRelativePath() + " on node " + ctx.getNodeId()); synchronized (lcManager) { index = lcManager.get(resourceRef.getRelativePath()); if (index != null) { lcManager.unregister(resourceRef.getRelativePath()); } else { readIndex(); } if (getResourceId() != -1) { localResourceRepository.delete(resourceRef.getRelativePath()); } index.destroy(); } }
private long getResourceIDfromResourcePath(String resourcePath) throws HyracksDataException { LocalResource lr = resourceRepository.get(resourcePath); if (lr == null) { return -1; } return lr.getId(); }
public static NcLocalCounters collect(CcId ccId, NodeControllerService ncs) throws HyracksDataException { final INcApplicationContext appContext = (INcApplicationContext) ncs.getApplicationContext(); long maxResourceId = Math.max(appContext.getLocalResourceRepository().maxId(), MetadataIndexImmutableProperties.FIRST_AVAILABLE_USER_DATASET_ID); long maxTxnId = appContext.getMaxTxnId(); long maxJobId = ncs.getMaxJobId(ccId); return new NcLocalCounters(maxResourceId, maxTxnId, maxJobId); }
private long getResourceId() throws HyracksDataException { LocalResource lr = localResourceRepository.get(resourceRef.getRelativePath()); return lr == null ? -1 : lr.getId(); }
private int getDIDfromResourcePath(String resourcePath) throws HyracksDataException { LocalResource lr = resourceRepository.get(resourcePath); if (lr == null) { return -1; } return ((DatasetLocalResource) lr.getResource()).getDatasetId(); }
@Override public synchronized void register(String resourcePath, IIndex index) throws HyracksDataException { validateDatasetLifecycleManagerState(); int did = getDIDfromResourcePath(resourcePath); LocalResource resource = resourceRepository.get(resourcePath); DatasetResource datasetResource = datasets.get(did); if (datasetResource == null) { datasetResource = getDatasetLifecycle(did); } datasetResource.register(resource, (ILSMIndex) index); }
dclm.open(indexPath); final ILSMIndex index = (ILSMIndex) dclm.get(indexPath); final long resourceId = ncAppCtx.getLocalResourceRepository().get(indexPath).getId(); final DatasetLocalResource datasetLocalResource = (DatasetLocalResource) ncAppCtx.getLocalResourceRepository().get(indexPath).getResource(); final ITransactionContext txnCtx = beingTransaction(ncAppCtx, index, resourceId); final ILogManager logManager = ncAppCtx.getTransactionSubsystem().getLogManager();
indexBuilder.build(); } else { final LocalResource resource = localResourceRepository.get(file.getRelativePath()); if (resource == null) { throw new HyracksDataException("Could not find required metadata indexes. Please delete "