@Override public Iterator<Statement> range(final Value[] query, final Literal lower, final boolean equalsLower, final Literal upper, final boolean equalsUpper, final boolean reverse, final int limit) throws CumulusStoreException { try { return _dictionary.toValueTripleIterator(rangeAsIDs(query, lower, equalsLower, upper, equalsUpper, reverse, limit)); } 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 Iterator<Statement> range(final Value[] query, final Literal lower, final boolean equalsLower, final Literal upper, final boolean equalsUpper, final boolean reverse, final int limit) throws CumulusStoreException { try { return _dictionary.toValueTripleIterator(rangeAsIDs(query, lower, equalsLower, upper, equalsUpper, reverse, limit)); } 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 Iterator<byte[][]> queryWithIDs(final byte[][] query, final int limit) throws CumulusStoreException { try { if ((query == null || query.length < 3)) { return Iterators.emptyIterator(); } return _rdfIndexDAO.query(query, limit); } 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 Iterator<byte[][]> queryWithIDs(final byte[][] query, final int limit) throws CumulusStoreException { try { if ((query == null || query.length < 3)) { return Iterators.emptyIterator(); } return _rdfIndexDAO.query(query, limit); } 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 Iterator<byte[][]> queryWithIDs(final byte[][] query, final int limit) throws CumulusStoreException { try { // check if query is valid if (query == null || (query.length > 4 || query.length < 3)) { return Iterators.emptyIterator(); } return _rdfIndexDAO.query(query, limit); } 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 Iterator<byte[][]> queryWithIDs(final byte[][] query, final int limit) throws CumulusStoreException { try { // check if query is valid if (query == null || (query.length > 4 || query.length < 3)) { return Iterators.emptyIterator(); } return _rdfIndexDAO.query(query, limit); } 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 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 protected Iterator<byte[][]> queryAsIDs(final Value[] query, final int limit) throws CumulusStoreException { try { return queryWithIDs(_dictionary.getIDs(query[0], query[1], query[2]), limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected Iterator<byte[][]> queryAsIDs(final Value[] query, final int limit) throws CumulusStoreException { try { return queryWithIDs(_dictionary.getIDs(query[0], query[1], query[2], query.length > 3 ? query[3] : null), limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected Iterator<byte[][]> queryAsIDs(final Value[] query, final int limit) throws CumulusStoreException { try { return queryWithIDs(_dictionary.getIDs(query[0], query[1], query[2]), limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected Iterator<byte[][]> queryAsIDs(final Value[] query, final int limit) throws CumulusStoreException { try { return queryWithIDs(_dictionary.getIDs(query[0], query[1], query[2], query.length > 3 ? query[3] : null), limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_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.toIDQuadIterator(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 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 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.toIDQuadIterator(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); } }