@Override public void flush(final Map<TopicPartition, OffsetAndMetadata> currentOffsets) { requireNonNull(currentOffsets); // Flush the current transaction. conn.commit(); }
private void commitLocalTransaction() throws RepositoryException { getConnection().commit(); }
private static void addTriples(final SailRepositoryConnection conn, final File triplesFile, final RDFFormat rdfFormat) throws RDFParseException, RepositoryException, IOException { conn.begin(); conn.add(triplesFile, "", rdfFormat); conn.commit(); }
protected void loadData(final Collection<Statement> statements) throws Exception { requireNonNull(statements); final SailRepositoryConnection ryaConn = getRyaSailRepository().getConnection(); ryaConn.begin(); ryaConn.add(statements); ryaConn.commit(); ryaConn.close(); // Wait for the Fluo application to finish computing the end result. super.getMiniFluo().waitForObservers(); }
private void addStatementsAndWait(final Collection<Statement> statements) throws RepositoryException, Exception { // Write the data to Rya. final SailRepositoryConnection ryaConn = super.getRyaSailRepository().getConnection(); ryaConn.begin(); ryaConn.add(statements); ryaConn.commit(); ryaConn.close(); // Wait for the Fluo application to finish computing the end result. super.getMiniFluo().waitForObservers(); } }
private String loadData(final String sparql, final Collection<Statement> statements) throws Exception { requireNonNull(sparql); requireNonNull(statements); // Register the PCJ with Rya. final RyaClient ryaClient = AccumuloRyaClientFactory.build(createConnectionDetails(), getAccumuloConnector()); final String pcjId = ryaClient.getCreatePCJ().createPCJ(getRyaInstanceName(), sparql, Sets.newHashSet()); // Write the data to Rya. final SailRepositoryConnection ryaConn = getRyaSailRepository().getConnection(); ryaConn.begin(); ryaConn.add(statements); ryaConn.commit(); ryaConn.close(); // Wait for the Fluo application to finish computing the end result. getMiniFluo().waitForObservers(); // The PCJ Id is the topic name the results will be written to. return pcjId; }