public void testBufferCapacity() throws Exception { final BigdataSail sail = getSail(); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); try { // This configuration exceeds StatementBuffer capacity executeQuery(repo, Integer.valueOf(BigdataSail.Options.DEFAULT_BUFFER_CAPACITY) * 5, 1); } finally { repo.shutDown(); sail.__tearDownUnitTest(); } }
public void testMergeUtility() throws Exception { final BigdataSail sail = getSail(); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); try { // This configuration uses MergeUtility, ensuring its capacity is sufficient executeQuery(repo, 35000, 7000); } finally { repo.shutDown(); sail.__tearDownUnitTest(); } }
repo.initialize(); runConcurrentStuff(repo,maxCounter); } finally {
protected void setUp() throws Exception { // instantiate a sail and a Sesame repository m_sail = new BigdataSail(getProperties()); m_repo = new BigdataSailRepository(m_sail); m_repo.initialize(); m_vf = m_sail.getValueFactory(); // Note: This uses a mock endpoint URL. om = new ObjectManager("http://localhost" + BigdataStatics.getContextPath() + "/sparql", m_repo); }
protected void setUp() throws Exception { // instantiate a sail and a Sesame repository m_sail = new BigdataSail(getProperties()); m_repo = new BigdataSailRepository(m_sail); m_repo.initialize(); m_vf = m_sail.getValueFactory(); // Note: This uses a mock endpoint URL. om = new ObjectManager("http://localhost" + BigdataStatics.getContextPath() + "/sparql", m_repo); }
private void executeQuery(final BigdataSailRepository repo) throws UpdateExecutionException, RepositoryException, MalformedQueryException { try { repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); try { String update = "insert {" + "<http://dbpedia.org/resource/Jules_Verne> <http://dbpedia.org/property/period> \"\"^^<http://www.w3.org/2001/XMLSchema#int>\r\n" + "} where {}"; Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } } finally { repo.shutDown(); } }
private void executeQuery(final BigdataSailRepository repo) throws UpdateExecutionException, RepositoryException, MalformedQueryException { try { repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); try {
public void testBufferCapacity() throws Exception { final BigdataSail sail = getSail(); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); try { // This configuration exceeds StatementBuffer capacity executeQuery(repo, Integer.valueOf(BigdataSail.Options.DEFAULT_BUFFER_CAPACITY) * 5, 1); } finally { repo.shutDown(); sail.__tearDownUnitTest(); } }
/** * This version uses the namespace and timestamp provided by the caller. * * @param namespace * @param timestamp * @return * @throws RepositoryException * @throws DatasetNotFoundException */ protected BigdataSailRepositoryConnection getQueryConnection( final String namespace, final long timestamp) throws RepositoryException { // Wrap with SAIL. final BigdataSail sail = new BigdataSail(namespace, getIndexManager()); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); if (TimestampUtility.isReadOnly(timestamp)) { return (BigdataSailRepositoryConnection) repo.getReadOnlyConnection(timestamp); } // Read-write connection. final BigdataSailRepositoryConnection conn = repo.getConnection(); conn.setAutoCommit(false); return conn; }
/** * Return a connection for the namespace. If the task is associated with * either a read/write transaction or an {@link ITx#UNISOLATED} view of the * indices, the connection may be used to read or write on the namespace. * Otherwise the connection will be read-only. * * @return The connection. * * @throws SailException * @throws RepositoryException * @throws DatasetNotFoundException * if the specified namespace does not exist. */ protected BigdataSailRepositoryConnection getConnection() throws SailException, RepositoryException { // Wrap with SAIL. final BigdataSail sail = new BigdataSail(namespace, getIndexManager()); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); conn.setAutoCommit(false); // Setup a change listener. It will notice the #of mutations. conn.addChangeLog(new SailChangeLog()); return conn; }
/** * Return a connection for the namespace. If the task is associated with * either a read/write transaction or an {@link ITx#UNISOLATED} view of the * indices, the connection may be used to read or write on the namespace. * Otherwise the connection will be read-only. * * @return The connection. * * @throws SailException * @throws RepositoryException * @throws DatasetNotFoundException * if the specified namespace does not exist. */ protected BigdataSailRepositoryConnection getConnection() throws SailException, RepositoryException { // Wrap with SAIL. final BigdataSail sail = new BigdataSail(namespace, getIndexManager()); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); conn.setAutoCommit(false); // Setup a change listener. It will notice the #of mutations. conn.addChangeLog(new SailChangeLog()); return conn; }
/** * This version uses the namespace and timestamp provided by the caller. * * @param namespace * @param timestamp * @return * @throws RepositoryException * @throws DatasetNotFoundException */ protected BigdataSailRepositoryConnection getQueryConnection( final String namespace, final long timestamp) throws RepositoryException { // Wrap with SAIL. final BigdataSail sail = new BigdataSail(namespace, getIndexManager()); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); if (TimestampUtility.isReadOnly(timestamp)) { return (BigdataSailRepositoryConnection) repo.getReadOnlyConnection(timestamp); } // Read-write connection. final BigdataSailRepositoryConnection conn = repo.getConnection(); conn.setAutoCommit(false); return conn; }
public void testMergeUtility() throws Exception { final BigdataSail sail = getSail(); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); try { // This configuration uses MergeUtility, ensuring its capacity is sufficient executeQuery(repo, 35000, 7000); } finally { repo.shutDown(); sail.__tearDownUnitTest(); } }
repo.initialize(); final BigdataSailRepositoryConnection cxn = repo.getConnection(); cxn.setAutoCommit(false);
repo.initialize(); runConcurrentStuff(repo,maxCounter); } finally {
private void executeQuery(final BigdataSailRepository repo) throws UpdateExecutionException, RepositoryException, MalformedQueryException { try { repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); try { String update = "insert {" + "<http://dbpedia.org/resource/Jules_Verne> <http://dbpedia.org/property/period> \"\"^^<http://www.w3.org/2001/XMLSchema#int>\r\n" + "} where {}"; Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } } finally { repo.shutDown(); } }
private void executeQuery(final BigdataSailRepository repo) throws UpdateExecutionException, RepositoryException, MalformedQueryException { try { repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); try {
repo.initialize(); final BigdataSailRepositoryConnection cxn = repo.getConnection(); cxn.setAutoCommit(false);
BigdataSailRepository repo = new BigdataSailRepository(sail); try { repo.initialize(); final RepositoryConnection conn = repo.getConnection(); conn.setAutoCommit(false);
BigdataSailRepository repo = new BigdataSailRepository(sail); try { repo.initialize(); final RepositoryConnection conn = repo.getConnection(); conn.setAutoCommit(false);