@Override public void tearDownAfterSuite() { this.m_indexManager.destroy(); this.m_indexManager = null; }
@Override @SuppressWarnings("rawtypes") public DefaultResourceLocator getResourceLocator() { return (DefaultResourceLocator) getLocalIndexManager() .getResourceLocator(); }
/** * Obtain a view of the default KB instance as of the last commit time on * the database. */ public BigdataGraphAccessor(final IIndexManager indexManager) { this(indexManager, BigdataSail.Options.DEFAULT_NAMESPACE, indexManager.getLastCommitTime()); }
final long lastCommitTime = store.getIndexManager().getLastCommitTime(); assertTrue(store == indexManager.getResourceLocator().locate( store.getNamespace(), ITx.UNISOLATED)); assertTrue(store.getLexiconRelation() == indexManager .getResourceLocator().locate(namespaceLexiconRelation, ITx.UNISOLATED)); assertTrue(store.getSPORelation() == indexManager .getResourceLocator().locate(namespaceSPORelation, ITx.UNISOLATED)); assertNotNull(indexManager.getIndex(lexiconRelationIndexName, ITx.UNISOLATED)); assertNotNull(indexManager.getIndex(primaryStatementIndexName, ITx.UNISOLATED)); .getLastCommitTime()); assertTrue(null == indexManager.getResourceLocator().locate( namespace, ITx.UNISOLATED)); assertTrue(null == indexManager.getResourceLocator().locate( namespaceLexiconRelation, ITx.UNISOLATED)); assertTrue(null == indexManager.getResourceLocator().locate( namespaceSPORelation, ITx.UNISOLATED)); assertNull(indexManager.getIndex(lexiconRelationIndexName, ITx.UNISOLATED)); assertNull(indexManager.getIndex(primaryStatementIndexName, ITx.UNISOLATED));
@Override public TemporaryStore getTempStore() { return getLocalIndexManager().getTempStore(); }
private AbstractTripleStore resolveKB() { long timestamp = this.timestamp; if (timestamp == ITx.READ_COMMITTED) { /** * Note: This code is request the view as of the the last commit * time. If we use ITx.READ_COMMITTED here then it will cause * the Journal to provide us with a ReadCommittedIndex and that * has a synchronization hot spot! */ timestamp = indexManager.getLastCommitTime(); } final AbstractTripleStore kb = (AbstractTripleStore) indexManager .getResourceLocator().locate(namespace, timestamp); if (kb == null) { throw new RuntimeException("Not found: namespace=" + namespace + ", timestamp=" + TimestampUtility.toString(timestamp)); } return kb; }
@Override public ExecutorService getExecutorService() { return delegate.getExecutorService(); }
protected IIndex getIndex(final IIndexManager store) { // name by the unit test. final String name = getName(); final long timestamp = ITx.UNISOLATED; IIndex ndx = store.getIndex(name, timestamp); if (ndx == null) { if(log.isInfoEnabled()) log.info("Registering index: " + name); /* * Note: This specifies an split handler that keeps the logical * row together. This is a hard requirement. The atomic * read/update guarantee depends on this. */ final IndexMetadata md = new IndexMetadata(name, UUID.randomUUID()); // Ensure that splits do not break logical rows. md.setSplitHandler(LogicalRowSplitHandler.INSTANCE); store.registerIndex(md); ndx = store.getIndex(name, timestamp); } return ndx; }
public List<String> getNamespacesTx(long tx) { if (tx == ITx.READ_COMMITTED && getIndexManager() instanceof IBigdataFederation) { // Use the last commit point for the federation *only*. tx = getIndexManager().getLastCommitTime(); } final SparseRowStore grs = getIndexManager().getGlobalRowStore(tx); if (grs == null) { log.warn("No GRS @ tx=" + TimestampUtility.toString(tx)); // Empty. return Collections.emptyList(); } return grs.getNamespaces(tx); }
@Override public IIndex getIndex(String name, long timestamp) { return delegate.getIndex(name, timestamp); }
@Override public SparseRowStore getGlobalRowStore() { return delegate.getGlobalRowStore(); }
@Override public void dropIndex(String name) { delegate.dropIndex(name); }
@Override public void registerIndex(IndexMetadata indexMetadata) { delegate.registerIndex(indexMetadata); }
final long lastCommitTime = store.getIndexManager().getLastCommitTime(); assertTrue(store == indexManager.getResourceLocator().locate( store.getNamespace(), ITx.UNISOLATED)); assertTrue(store.getLexiconRelation() == indexManager .getResourceLocator().locate(namespaceLexiconRelation, ITx.UNISOLATED)); assertTrue(store.getSPORelation() == indexManager .getResourceLocator().locate(namespaceSPORelation, ITx.UNISOLATED)); assertNotNull(indexManager.getIndex(lexiconRelationIndexName, ITx.UNISOLATED)); assertNotNull(indexManager.getIndex(primaryStatementIndexName, ITx.UNISOLATED)); .getLastCommitTime()); assertTrue(null == indexManager.getResourceLocator().locate( namespace, ITx.UNISOLATED)); assertTrue(null == indexManager.getResourceLocator().locate( namespaceLexiconRelation, ITx.UNISOLATED)); assertTrue(null == indexManager.getResourceLocator().locate( namespaceSPORelation, ITx.UNISOLATED)); assertNull(indexManager.getIndex(lexiconRelationIndexName, ITx.UNISOLATED)); assertNull(indexManager.getIndex(primaryStatementIndexName, ITx.UNISOLATED));
@Override public TemporaryStore getTempStore() { return getLocalIndexManager().getTempStore(); }
private AbstractTripleStore resolveKB() { long timestamp = this.timestamp; if (timestamp == ITx.READ_COMMITTED) { /** * Note: This code is request the view as of the the last commit * time. If we use ITx.READ_COMMITTED here then it will cause * the Journal to provide us with a ReadCommittedIndex and that * has a synchronization hot spot! */ timestamp = indexManager.getLastCommitTime(); } final AbstractTripleStore kb = (AbstractTripleStore) indexManager .getResourceLocator().locate(namespace, timestamp); if (kb == null) { throw new RuntimeException("Not found: namespace=" + namespace + ", timestamp=" + TimestampUtility.toString(timestamp)); } return kb; }
@Override public ExecutorService getExecutorService() { return getLocalIndexManager().getExecutorService(); }
protected IIndex getIndex(final IIndexManager store) { // name by the unit test. final String name = getName(); final long timestamp = ITx.UNISOLATED; IIndex ndx = store.getIndex(name, timestamp); if (ndx == null) { if(log.isInfoEnabled()) log.info("Registering index: " + name); /* * Note: This specifies an split handler that keeps the logical * row together. This is a hard requirement. The atomic * read/update guarantee depends on this. */ final IndexMetadata md = new IndexMetadata(name, UUID.randomUUID()); // Ensure that splits do not break logical rows. md.setSplitHandler(LogicalRowSplitHandler.INSTANCE); store.registerIndex(md); ndx = store.getIndex(name, timestamp); } return ndx; }
public List<String> getNamespacesTx(long tx) { if (tx == ITx.READ_COMMITTED && getIndexManager() instanceof IBigdataFederation) { // Use the last commit point for the federation *only*. tx = getIndexManager().getLastCommitTime(); } final SparseRowStore grs = getIndexManager().getGlobalRowStore(tx); if (grs == null) { log.warn("No GRS @ tx=" + TimestampUtility.toString(tx)); // Empty. return Collections.emptyList(); } return grs.getNamespaces(tx); }
@Override public IIndex getIndex(String name, long timestamp) { return delegate.getIndex(name, timestamp); }