private void endTest(BigdataSailRepositoryConnection cxn) throws Exception { cxn.close(); cxn.getTripleStore().close(); IJournal store = ((LocalTripleStore)cxn.getTripleStore()).getIndexManager(); store.shutdownNow(); store.destroy(); }
btree = (BTree) store.registerIndex(name, md); store.commit(); return (BTree) store.getIndex(name);
/** * Return the file whose contents are the persistent state for the * journal. * * @param journal * The journal. * * @return The file. */ private static String getFileString(final IJournal journal) { final File file = journal.getFile(); if (file == null) return ""; return file.getName();//toString(); }
/** * Create the named index if it does not exist. * * @return The {@link UUID} of the named index. */ @Override protected UUID doTask() throws Exception { final String name = getOnlyResource(); IIndex ndx = getJournal().getIndex(name); if (ndx != null) { final UUID indexUUID = ndx.getIndexMetadata().getIndexUUID(); if (log.isInfoEnabled()) log.info("Index exists: name=" + name + ", indexUUID=" + indexUUID); return indexUUID; } // register the index. ndx = getJournal().registerIndex(name, metadata); final UUID indexUUID = ndx.getIndexMetadata().getIndexUUID(); if (log.isInfoEnabled()) log.info("Registered index: name=" + name + ", class=" + ndx.getClass() + ", indexUUID=" + indexUUID); return indexUUID; }
new IResourceMetadata[] { store.getResourceMetadata() }, // store.destroy();
.getQuorum(); jnl.awaitHAReady(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (AsynchronousQuorumCloseException e) { throw new RuntimeException(e); if (journal.isGroupCommit() && journal.getRootBlockView().getCommitCounter() == 0L) { journal.getGlobalRowStore(); journal.commit();
@Override protected Object doTask() throws Exception { if(log.isInfoEnabled()) log.info("Will register " + getOnlyResource()); getJournal().registerIndex(getOnlyResource(),new IndexMetadata(resource[0], indexUUID)); if(log.isInfoEnabled()) log.info("Will write on " + getOnlyResource()); final IIndex ndx = getIndex(getOnlyResource()); assert ndx != null; assertEquals("indexUUID",indexUUID,ndx.getIndexMetadata().getIndexUUID()); // // Note: clone values since replaced with old values by the batch op. // ndx.insert(new BatchInsert(ninserts, keys, vals.clone())); for (int i = 0; i < keys.length; i++) { ndx.insert(keys[i], vals[i]); } return null; }
getJournal().dropIndex(name); getJournal().registerIndex(result.name, btree);
getJournal().getRootBlockView().getUUID())) { newView.add(getJournal().getResourceMetadata());
/** * Delegates the operation to the backing store. */ @Override synchronized public long commit() { final long begin = System.currentTimeMillis(); super.commit(); final IIndexManager indexManager = getIndexManager(); if (indexManager.isGroupCommit()) { /* * Note: GROUP_COMMIT (#566) requires that the WriteExecutorService * controls when commit points are melded. If group commit is enabled * and the index manager is directs the Journal to commit() then any * partially executed tasks that have checkpointed indices will be * immediately flushed to the backing store, breaking the ACID * semantics of the commit. * * Note: The checkpoint of the indices for an unisolated AbstractTask * occurs when the task is done with its work but is still holding any * resource locks. */ return 0L; } final long commitTime = getIndexManager().commit(); final long elapsed = System.currentTimeMillis() - begin; if (log.isInfoEnabled()) log.info("commit: commit latency=" + elapsed + "ms"); return commitTime; }
indices[i] = getJournal().getIndex(name);
new IResourceMetadata[] {// getJournal().getResourceMetadata() //
htree = (HTree) cacheStore.getUnisolatedIndex(name); cacheStore.registerIndex(metadata); htree = (HTree) cacheStore.getUnisolatedIndex(name);
@Override protected Void doTask() throws Exception { /* * Create indices that we should be able to see when * holding the lock for the namespace. */ for (int i = 0; i < allowed_indices.length; i++) { final String name = allowed_indices[i]; getJournal().dropIndex(name); } // Done return null; }
if(((IJournal)indexManager).isOpen()) { ((IJournal) indexManager).shutdownNow();
new IResourceMetadata[] { store.getResourceMetadata() }, // store.destroy();
/** * Create the named index if it does not exist. * * @return The {@link UUID} of the named index. */ @Override protected UUID doTask() throws Exception { final String name = getOnlyResource(); IIndex ndx = getJournal().getIndex(name); if (ndx != null) { final UUID indexUUID = ndx.getIndexMetadata().getIndexUUID(); if (log.isInfoEnabled()) log.info("Index exists: name=" + name + ", indexUUID=" + indexUUID); return indexUUID; } // register the index. ndx = getJournal().registerIndex(name, metadata); final UUID indexUUID = ndx.getIndexMetadata().getIndexUUID(); if (log.isInfoEnabled()) log.info("Registered index: name=" + name + ", class=" + ndx.getClass() + ", indexUUID=" + indexUUID); return indexUUID; }
.getQuorum(); jnl.awaitHAReady(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (AsynchronousQuorumCloseException e) { throw new RuntimeException(e); if (journal.isGroupCommit() && journal.getRootBlockView().getCommitCounter() == 0L) { journal.getGlobalRowStore(); journal.commit();
@Override protected Object doTask() throws Exception { if(log.isInfoEnabled()) log.info("Will register " + getOnlyResource()); getJournal().registerIndex(getOnlyResource(),new IndexMetadata(resource[0], indexUUID)); if(log.isInfoEnabled()) log.info("Will write on " + getOnlyResource()); final IIndex ndx = getIndex(getOnlyResource()); assert ndx != null; assertEquals("indexUUID",indexUUID,ndx.getIndexMetadata().getIndexUUID()); // // Note: clone values since replaced with old values by the batch op. // ndx.insert(new BatchInsert(ninserts, keys, vals.clone())); for (int i = 0; i < keys.length; i++) { ndx.insert(keys[i], vals[i]); } return null; }
getJournal().dropIndex(name); getJournal().registerIndex(result.name, btree);