|
24 | 24 | import java.util.concurrent.locks.LockSupport; |
25 | 25 | import java.util.concurrent.locks.ReentrantLock; |
26 | 26 |
|
| 27 | +import org.eclipse.rdf4j.common.annotation.Experimental; |
27 | 28 | import org.eclipse.rdf4j.common.annotation.InternalUseOnly; |
28 | 29 | import org.eclipse.rdf4j.common.concurrent.locks.Lock; |
29 | 30 | import org.eclipse.rdf4j.common.concurrent.locks.diagnostics.ConcurrentCleaner; |
@@ -733,10 +734,8 @@ protected void endUpdateInternal(UpdateContext op) throws SailException { |
733 | 734 | synchronized (added) { |
734 | 735 | model = added.remove(op); |
735 | 736 | } |
736 | | - if (model != null) { |
737 | | - for (Statement st : model) { |
738 | | - addStatementInternal(st.getSubject(), st.getPredicate(), st.getObject(), st.getContext()); |
739 | | - } |
| 737 | + if (model != null && !model.isEmpty()) { |
| 738 | + bulkAddStatementsInternal(model); |
740 | 739 | } |
741 | 740 | } |
742 | 741 |
|
@@ -973,6 +972,14 @@ protected void prepareInternal() throws SailException { |
973 | 972 | protected abstract void addStatementInternal(Resource subj, IRI pred, Value obj, Resource... contexts) |
974 | 973 | throws SailException; |
975 | 974 |
|
| 975 | + @Experimental |
| 976 | + protected void bulkAddStatementsInternal(final Collection<? extends Statement> statements) |
| 977 | + throws SailException { |
| 978 | + for (final Statement st : statements) { |
| 979 | + addStatementInternal(st.getSubject(), st.getPredicate(), st.getObject(), st.getContext()); |
| 980 | + } |
| 981 | + } |
| 982 | + |
976 | 983 | protected abstract void removeStatementsInternal(Resource subj, IRI pred, Value obj, Resource... contexts) |
977 | 984 | throws SailException; |
978 | 985 |
|
|
0 commit comments