Skip to content

Commit

Permalink
GH-5210 Enable implementing sails to benefit from parent sail buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
bherber1 committed Nov 26, 2024
1 parent 6e64a12 commit 9034649
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,8 @@ protected void endUpdateInternal(UpdateContext op) throws SailException {
synchronized (added) {
model = added.remove(op);
}
if (model != null) {
for (Statement st : model) {
addStatementInternal(st.getSubject(), st.getPredicate(), st.getObject(), st.getContext());
}
if (model != null && !model.isEmpty()) {
bulkAddStatementsInternal(model);
}
}

Expand Down Expand Up @@ -973,6 +971,13 @@ protected void prepareInternal() throws SailException {
protected abstract void addStatementInternal(Resource subj, IRI pred, Value obj, Resource... contexts)
throws SailException;

protected void bulkAddStatementsInternal(final Collection<? extends Statement> statements)
throws SailException {
for (final Statement st : statements) {
addStatementInternal(st.getSubject(), st.getPredicate(), st.getObject(), st.getContext());
}
}

protected abstract void removeStatementsInternal(Resource subj, IRI pred, Value obj, Resource... contexts)
throws SailException;

Expand Down

0 comments on commit 9034649

Please sign in to comment.