@Override protected void removeDataWithIDs(final Iterator<byte[][]> triples) throws DataAccessLayerException { notifyListeners(_startChangesEvent); batchDeleteWithIDs(triples, _batchLimit); notifyListeners(_finishedChangesEvent); }
@Override protected void removeDataWithIDs(final Iterator<byte[][]> triples) throws DataAccessLayerException { notifyListeners(_startChangesEvent); batchDeleteWithIDs(triples, _batchLimit); notifyListeners(_finishedChangesEvent); }
@Override public void addData(final Iterator<Statement> iterator) throws CumulusStoreException { try { notifyListeners(_startChangesEvent); batchInsert(iterator, _batchLimit); notifyListeners(_finishedChangesEvent); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public void addData(final Iterator<Statement> iterator) throws CumulusStoreException { try { notifyListeners(_startChangesEvent); batchInsert(iterator, _batchLimit); notifyListeners(_finishedChangesEvent); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public void addData(final Statement data) throws CumulusStoreException { try { notifyListeners(_startChangesEvent); batchInsert(Iterators.singletonIterator(data), _batchLimit); notifyListeners(_finishedChangesEvent); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
/** * Deletes the given triples/quads from the store. * The triples/quads are represented as ids. * * @param nodes an iterator iterating over the triples/quads to delete. * @param batchSize the maximum size of a batch query. * @throws DataAccessLayerException in case of data access failure. */ void batchDeleteWithIDs(final Iterator<byte[][]> nodes, final int batchSize) throws DataAccessLayerException { List<byte[][]> deleted = null; try { deleted = _rdfIndexDAO.deleteTriples(nodes, batchSize, _idxRanges); } catch (final Exception exception) { _log.error(MessageCatalog._00055_DELETION_FAILURE, exception); } if (deleted != null && !deleted.isEmpty()) { notifyListeners(new RemoveTriplesEvent(this, deleted)); } }
/** * Deletes the given triples/quads from the store. * The triples/quads are represented as ids. * * @param nodes an iterator iterating over the triples/quads to delete. * @param batchSize the maximum size of a batch query. * @throws DataAccessLayerException in case of data access failure. */ void batchDeleteWithIDs(final Iterator<byte[][]> nodes, final int batchSize) throws DataAccessLayerException { List<byte[][]> deleted = null; try { deleted = _rdfIndexDAO.deleteTriples(nodes, batchSize, _idxRanges); } catch (final Exception exception) { _log.error(MessageCatalog._00055_DELETION_FAILURE, exception); } if (deleted != null && !deleted.isEmpty()) { notifyListeners(new RemoveTriplesEvent(this, deleted)); } }
@Override public void addData(final Statement data) throws CumulusStoreException { try { notifyListeners(_startChangesEvent); batchInsert(Iterators.singletonIterator(data), _batchLimit); notifyListeners(_finishedChangesEvent); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public void removeData(final Iterator<Statement> iterator) throws CumulusStoreException { try { notifyListeners(_startChangesEvent); batchDeleteWithIDs(_dictionary.toIDTripleIterator(iterator), _batchLimit); notifyListeners(_finishedChangesEvent); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public void removeData(final Iterator<Statement> iterator) throws CumulusStoreException { try { notifyListeners(_startChangesEvent); batchDeleteWithIDs(_dictionary.toIDTripleIterator(iterator), _batchLimit); notifyListeners(_finishedChangesEvent); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected void removeDataWithIDs(final byte[][] pattern) throws CumulusStoreException { try { if (Util.ALL_CONSTANTS_WITH_IDS.apply(pattern)) { notifyListeners(_startChangesEvent); batchDeleteWithIDs(Iterators.singletonIterator(pattern), _batchLimit); notifyListeners(_finishedChangesEvent); } else { removeDataWithIDs(queryWithIDs(pattern)); } } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected void removeDataWithIDs(final byte[][] pattern) throws CumulusStoreException { try { if (Util.ALL_CONSTANTS_WITH_IDS.apply(pattern)) { notifyListeners(_startChangesEvent); batchDeleteWithIDs(Iterators.singletonIterator(pattern), _batchLimit); notifyListeners(_finishedChangesEvent); } else { removeDataWithIDs(queryWithIDs(pattern)); } } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public void removeData(final Value[] pattern) throws CumulusStoreException { try { if (Util.ALL_CONSTANTS.apply(pattern)) { notifyListeners(_startChangesEvent); batchDeleteWithIDs(_dictionary.toIDTripleIterator(Iterators.singletonIterator(CumulusRDFSesameUtil.valuesToStatement(pattern))), _batchLimit); notifyListeners(_finishedChangesEvent); } else if (Util.ALL_VARS.apply(pattern)) { clear(); } else { removeDataWithIDs(queryWithIDs(pattern)); } } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public void removeData(final Value[] pattern) throws CumulusStoreException { try { if (Util.ALL_CONSTANTS.apply(pattern)) { notifyListeners(_startChangesEvent); batchDeleteWithIDs(_dictionary.toIDTripleIterator(Iterators.singletonIterator(CumulusRDFSesameUtil.valuesToStatement(pattern))), _batchLimit); notifyListeners(_finishedChangesEvent); } else if (Util.ALL_VARS.apply(pattern)) { clear(); } else { removeDataWithIDs(queryWithIDs(pattern)); } } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }