@Override public String toString() { return super.toString() + "{sparqlEndpoint=" + sparqlEndpointURL + ", mgr=" + getRemoteRepositoryManager() + (tx == null ? "" : ", tx=" + tx) + "}"; }
repo.getRemoteRepository().getRemoteRepositoryManager().getExecutor().execute(new Runnable() { @Override public void run() {
final RemoteRepositoryManager mgr = m_repo.getRemoteRepositoryManager();
try { request = m_repo.getRemoteRepositoryManager().newRequest(urlString.toString(), opts.method);
/** * Return a {@link RemoteRepository} for this connection. * * @see RemoteRepositoryManager#new */ protected RemoteRepository getRepositoryForConnection() { final IRemoteTx tx = remoteTx.get(); if (tx != null) { /* * Return a RemoteRepository that will use a view that is consistent * with an isolated view of the transaction. */ final RemoteRepository rtmp = repo.getRemoteRepository(); final String sparqlEndpointURL = rtmp.getSparqlEndPoint(); final RemoteRepositoryManager rmgr = rtmp.getRemoteRepositoryManager(); return rmgr.getRepositoryForURL(sparqlEndpointURL, tx); } /* * The returned repository does not add the ×tamp= URL query * parameter. */ return repo.getRemoteRepository(); }
@Override public void begin() throws RepositoryException { assertOpen(); // non-blocking. synchronized (remoteTx) { assertOpen(); if (remoteTx.get() != null) throw new RepositoryException("Active transaction exists"); try { remoteTx.set(repo.getRemoteRepository() .getRemoteRepositoryManager().getTransactionManager() .createTx(RemoteTransactionManager.UNISOLATED)); } catch (RuntimeException e) { throw new RepositoryException(e); } } }
/** * Begin a read-only transaction. Since all read operations have snapshot * isolation, this is only necessary when multiple read operations need to * read on the same commit point. */ public void beginReadOnly() throws RepositoryException { assertOpen(); // non-blocking. synchronized (remoteTx) { assertOpen(); if (remoteTx.get() != null) throw new RepositoryException("Active transaction exists"); try { remoteTx.set(repo.getRemoteRepository() .getRemoteRepositoryManager().getTransactionManager() .createTx(RemoteTransactionManager.READ_COMMITTED)); } catch (RuntimeException e) { throw new RepositoryException(e); } } }
try { remoteTx.set(repo.getRemoteRepository() .getRemoteRepositoryManager().getTransactionManager() .createTx(timestamp)); } catch (RuntimeException e) {
try { request = m_repo.getRemoteRepositoryManager().newRequest(urlString.toString(), opts.method);
final RemoteRepositoryManager mgr = m_repo.getRemoteRepositoryManager();
/** * Execute an ASK query including a SERVICE keyword which gets sent back to this server. * The test succeeeds if the query returns true, and fails otherwise * @param args * @throws IOException */ public void test_simple() throws Exception { setMethodisPostUrlEncodedData(); // m_repo.getRemoteRepositoryManager().createRepository(namespace, properties); BigdataSailRemoteRepositoryConnection conn = m_repo.getBigdataSailRemoteRepository().getConnection(); conn.prepareUpdate(QueryLanguage.SPARQL, "INSERT { <http://s1> <http://p> \"Test123\" } WHERE { }").execute(); checkResults(conn, 1); conn.prepareUpdate(QueryLanguage.SPARQL, "INSERT { <http://s2> <http://p> \"Test234\"^^xsd:string } WHERE { }").execute(); checkResults(conn, 2); conn.prepareUpdate(QueryLanguage.SPARQL, "INSERT { <http://s3> <http://p> \"Test345\" } WHERE { }").execute(); checkResults(conn, 3); m_repo.getRemoteRepositoryManager().rebuildTextIndex(namespace, true); checkResults(conn, 3); }
/** * Execute an ASK query including a SERVICE keyword which gets sent back to this server. * The test succeeeds if the query returns true, and fails otherwise * @param args * @throws IOException */ public void test_simple() throws Exception { setMethodisPostUrlEncodedData(); // m_repo.getRemoteRepositoryManager().createRepository(namespace, properties); BigdataSailRemoteRepositoryConnection conn = m_repo.getBigdataSailRemoteRepository().getConnection(); conn.prepareUpdate(QueryLanguage.SPARQL, "INSERT { <http://s1> <http://p> \"Test123\" } WHERE { }").execute(); checkResults(conn, 1); conn.prepareUpdate(QueryLanguage.SPARQL, "INSERT { <http://s2> <http://p> \"Test234\"^^xsd:string } WHERE { }").execute(); checkResults(conn, 2); conn.prepareUpdate(QueryLanguage.SPARQL, "INSERT { <http://s3> <http://p> \"Test345\" } WHERE { }").execute(); checkResults(conn, 3); m_repo.getRemoteRepositoryManager().rebuildTextIndex(namespace, true); checkResults(conn, 3); }