/** * Simple start/kill in which we verify that the default KB was NOT created * and that the explicitly create KB instance can still be resolved. This is * basically a test of the ability to override the init parameters in * <code>web.xml</code> to specify the {@link ConfigParams#NAMESPACE} and * {@link ConfigParams#CREATE} properties. If those overrides are not * applied then the default KB will be created and this test will fail. If * the test fails, the place to look is {@link NanoSparqlServer} where it is * overriding the init parameters for the {@link WebAppContext}. * * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/730" > * Allow configuration of embedded NSS jetty server using jetty-web.xml * </a> */ public void test_start_stop() { final AbstractTripleStore tripleStore = (AbstractTripleStore) m_indexManager .getResourceLocator().locate(namespace, ITx.UNISOLATED); assertNotNull("Explicitly create KB not found: namespace=" + namespace, tripleStore); final AbstractTripleStore tripleStore2 = (AbstractTripleStore) m_indexManager .getResourceLocator().locate( BigdataSail.Options.DEFAULT_NAMESPACE, ITx.UNISOLATED); /* * Note: A failure here means that our override of * ConfigParams.NAMESPACE was ignored. */ assertNull("Default KB should not exist.", tripleStore2); }
this.rel = (R) jnl.getResourceLocator().locate(namespace, ITx.READ_COMMITTED);
.getResourceLocator().locate(namespace, ITx.UNISOLATED);
.getResourceLocator().locate(namespace, ITx.UNISOLATED);
this.rel = (R) jnl.getResourceLocator().locate(namespace, ITx.READ_COMMITTED);
ts1 = (AbstractTripleStore) j1.getResourceLocator().locate( namespace, TimestampUtility.asHistoricalRead(j1 ts2 = (AbstractTripleStore) j2.getResourceLocator().locate( namespace, TimestampUtility.asHistoricalRead(j2
ts1 = (AbstractTripleStore) j1.getResourceLocator().locate( namespace, TimestampUtility.asHistoricalRead(j1 ts2 = (AbstractTripleStore) j2.getResourceLocator().locate( namespace, TimestampUtility.asHistoricalRead(j2
.getResourceLocator().locate(namespace, timestamp);
.getResourceLocator().locate(namespace, timestamp);
.getResourceLocator().locate(namespace, ITx.UNISOLATED); .getResourceLocator().locate(namespace, ITx.UNISOLATED);
.getResourceLocator().locate(nm, ITx.UNISOLATED); .getResourceLocator().locate(namespace, ITx.UNISOLATED);
.getResourceLocator().locate(namespace, ITx.UNISOLATED); .getResourceLocator().locate(namespace, ITx.UNISOLATED);
.getResourceLocator().locate(nm, ITx.UNISOLATED); .getResourceLocator().locate(namespace, ITx.UNISOLATED);
@Override public void loadFiles() throws IOException { final BigdataOptionData opt = getOptionData(); final Journal jnl = opt.jnl; final String namespace = opt.namespace; final String[] loadSet = opt.loadSet.toArray(new String[0]); // Load data using the unisolated view. final AbstractTripleStore kb = (AbstractTripleStore) jnl .getResourceLocator().locate(namespace, ITx.UNISOLATED); if (opt.newKB && loadSet.length > 0) { final BigdataSail sail = new BigdataSail(kb); try { try { sail.initialize(); loadFiles(sail, loadSet); } finally { if (sail.isOpen()) sail.shutDown(); } } catch (Exception ex) { throw new RuntimeException(ex); } } // total #of edges in that graph. opt.nedges = kb.getStatementCount(); }
@Override public void loadFiles() throws IOException { final BigdataOptionData opt = getOptionData(); final Journal jnl = opt.jnl; final String namespace = opt.namespace; final String[] loadSet = opt.loadSet.toArray(new String[0]); // Load data using the unisolated view. final AbstractTripleStore kb = (AbstractTripleStore) jnl .getResourceLocator().locate(namespace, ITx.UNISOLATED); if (opt.newKB && loadSet.length > 0) { final BigdataSail sail = new BigdataSail(kb); try { try { sail.initialize(); loadFiles(sail, loadSet); } finally { if (sail.isOpen()) sail.shutDown(); } } catch (Exception ex) { throw new RuntimeException(ex); } } // total #of edges in that graph. opt.nedges = kb.getStatementCount(); }
/** * Simple start/kill in which we verify that the default KB was NOT created * and that the explicitly create KB instance can still be resolved. This is * basically a test of the ability to override the init parameters in * <code>web.xml</code> to specify the {@link ConfigParams#NAMESPACE} and * {@link ConfigParams#CREATE} properties. If those overrides are not * applied then the default KB will be created and this test will fail. If * the test fails, the place to look is {@link NanoSparqlServer} where it is * overriding the init parameters for the {@link WebAppContext}. * * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/730" > * Allow configuration of embedded NSS jetty server using jetty-web.xml * </a> */ public void test_start_stop() { final AbstractTripleStore tripleStore = (AbstractTripleStore) m_indexManager .getResourceLocator().locate(namespace, ITx.UNISOLATED); assertNotNull("Explicitly create KB not found: namespace=" + namespace, tripleStore); final AbstractTripleStore tripleStore2 = (AbstractTripleStore) m_indexManager .getResourceLocator().locate( BigdataSail.Options.DEFAULT_NAMESPACE, ITx.UNISOLATED); /* * Note: A failure here means that our override of * ConfigParams.NAMESPACE was ignored. */ assertNull("Default KB should not exist.", tripleStore2); }
assertNotNull(store.getResourceLocator().locate(namespace, ITx.UNISOLATED)); assertTrue(((MockRelation) store.getResourceLocator().locate( namespace, ITx.UNISOLATED)) == mockRelation); assertNotNull(store.getResourceLocator().locate(namespace, ITx.READ_COMMITTED)); assertTrue(((MockRelation) store.getResourceLocator().locate( namespace, ITx.READ_COMMITTED)) != mockRelation); assertNotNull(((MockRelation) store.getResourceLocator() .locate(namespace, ITx.UNISOLATED)).getIndex()); assertTrue(((MockRelation) store.getResourceLocator().locate( namespace, ITx.UNISOLATED)) == mockRelation);
assertNotNull(store.getResourceLocator().locate(namespace, ITx.UNISOLATED)); assertTrue(((MockRelation) store.getResourceLocator().locate( namespace, ITx.UNISOLATED)) == mockRelation); assertNotNull(store.getResourceLocator().locate(namespace, ITx.READ_COMMITTED)); assertTrue(((MockRelation) store.getResourceLocator().locate( namespace, ITx.READ_COMMITTED)) != mockRelation); assertNotNull(((MockRelation) store.getResourceLocator() .locate(namespace, ITx.UNISOLATED)).getIndex()); assertTrue(((MockRelation) store.getResourceLocator().locate( namespace, ITx.UNISOLATED)) == mockRelation);
/** * Create and populate relation in the {@link #namespace}. */ private void loadData(final Journal store) { // create the relation. final R rel = new R(store, namespace, ITx.UNISOLATED, new Properties()); rel.create(); // data to insert. final E[] a = {// new E("John", "Mary"),// new E("Mary", "Paul"),// new E("Paul", "Leon"),// new E("Leon", "Paul"),// new E("Mary", "John"),// }; // insert data (the records are not pre-sorted). rel.insert(new ChunkedArrayIterator<E>(a.length, a, null/* keyOrder */)); // Do commit since not scale-out. store.commit(); // should exist as of the last commit point. this.rel = (R) jnl.getResourceLocator().locate(namespace, ITx.READ_COMMITTED); assertNotNull(rel); }
/** * Create and populate relation in the {@link #namespace}. */ private void loadData(final Journal store) { // create the relation. final R rel = new R(store, namespace, ITx.UNISOLATED, new Properties()); rel.create(); // data to insert. final E[] a = {// new E("John", "Mary"),// new E("Mary", "Paul"),// new E("Paul", "Leon"),// new E("Leon", "Paul"),// new E("Mary", "John"),// }; // insert data (the records are not pre-sorted). rel.insert(new ChunkedArrayIterator<E>(a.length, a, null/* keyOrder */)); // Do commit since not scale-out. store.commit(); // should exist as of the last commit point. this.rel = (R) jnl.getResourceLocator().locate(namespace, ITx.READ_COMMITTED); assertNotNull(rel); }