use of nl.knaw.huygens.timbuctoo.v5.berkeleydb.exceptions.DatabaseWriteException in project timbuctoo by HuygensING.
the class StoreUpdater method deleteQuad.
private void deleteQuad(String subject, String predicate, Direction direction, String object, String valueType, String language) throws RdfProcessingFailedException {
try {
final boolean wasChanged = tripleStore.deleteQuad(subject, predicate, direction, object, valueType, language);
if (wasChanged && currentversion >= 0) {
truePatchStore.put(subject, currentversion, predicate, direction, false, object, valueType, language);
updatedPerPatchStore.put(currentversion, subject);
}
} catch (DatabaseWriteException e) {
throw new RdfProcessingFailedException(e);
}
}
use of nl.knaw.huygens.timbuctoo.v5.berkeleydb.exceptions.DatabaseWriteException in project timbuctoo by HuygensING.
the class StoreUpdater method putQuad.
private void putQuad(String subject, String predicate, Direction direction, String object, String valueType, String language) throws RdfProcessingFailedException {
try {
final boolean wasChanged = tripleStore.putQuad(subject, predicate, direction, object, valueType, language);
if (wasChanged && currentversion >= 0) {
truePatchStore.put(subject, currentversion, predicate, direction, true, object, valueType, language);
updatedPerPatchStore.put(currentversion, subject);
}
} catch (DatabaseWriteException e) {
throw new RdfProcessingFailedException(e);
}
}
use of nl.knaw.huygens.timbuctoo.v5.berkeleydb.exceptions.DatabaseWriteException in project timbuctoo by HuygensING.
the class StoreUpdater method commit.
@Override
public void commit() throws RdfProcessingFailedException {
try {
String msg = "processing " + count + " triples took " + stopwatch.elapsed(TimeUnit.SECONDS) + " seconds";
LOG.info(msg);
importStatus.setStatus(msg);
stopwatch.reset();
stopwatch.start();
updateListeners();
msg = "post-processing took " + stopwatch.elapsed(TimeUnit.SECONDS) + " seconds";
LOG.info(msg);
importStatus.setStatus(msg);
stopwatch.reset();
stopwatch.start();
versionStore.setVersion(currentversion);
commitChanges();
dbFactory.commitTransaction();
msg = "committing took " + stopwatch.elapsed(TimeUnit.SECONDS) + " seconds";
LOG.info(msg);
importStatus.setStatus(msg);
} catch (DatabaseWriteException | JsonProcessingException e) {
throw new RdfProcessingFailedException(e);
}
}
Aggregations