@Override public CacheInvalidationStats invalidateCache(Iterable<String> keys) { for (String key : keys) { invalidateCache(Collection.NODES, key); } return null; }
@Override public CacheInvalidationStats invalidateCache(Iterable<String> keys) { for (String key : keys) { invalidateCache(Collection.NODES, key); } return null; }
@Override public <T extends Document> void invalidateCache(Collection<T> collection, String id) { invalidateCache(collection, id, false); }
@Override public <T extends Document> void invalidateCache(Collection<T> collection, String id) { invalidateCache(collection, id, false); }
@Override public CacheInvalidationStats invalidateCache() { for (CacheValue key : nodesCache.keys()) { invalidateCache(Collection.NODES, key.toString()); } return null; }
@Override public <T extends Document> int remove(Collection<T> collection, Map<String, Long> toRemove) { try { return delete(collection, toRemove); } finally { for (String id : toRemove.keySet()) { invalidateCache(collection, id, true); } } }
@Override public <T extends Document> void remove(Collection<T> collection, String id) { try { delete(collection, id); } finally { invalidateCache(collection, id, true); } }
@Override public <T extends Document> int remove(Collection<T> collection, Map<String, Long> toRemove) { try { return delete(collection, toRemove); } finally { for (String id : toRemove.keySet()) { invalidateCache(collection, id, true); } } }
@Override public <T extends Document> void remove(Collection<T> collection, List<String> ids) { try { delete(collection, ids); } finally { for (String id : ids) { invalidateCache(collection, id, true); } } }
@Override public <T extends Document> void remove(Collection<T> collection, List<String> ids) { try { delete(collection, ids); } finally { for (String id : ids) { invalidateCache(collection, id, true); } } }
@Override public CacheInvalidationStats invalidateCache() { for (CacheValue key : nodesCache.keys()) { invalidateCache(Collection.NODES, key.toString()); } return null; }
private <T extends Document> DocumentStoreException handleException(String message, Exception ex, Collection<T> collection, java.util.Collection<String> ids) { if (collection == Collection.NODES) { for (String id : ids) { invalidateCache(collection, id, false); } } return asDocumentStoreException(ex, message); }
@Override public <T extends Document> void remove(Collection<T> collection, String id) { try { delete(collection, id); } finally { invalidateCache(collection, id, true); } }
private <T extends Document> DocumentStoreException handleException(String message, Exception ex, Collection<T> collection, java.util.Collection<String> ids) { if (collection == Collection.NODES) { for (String id : ids) { invalidateCache(collection, id, false); } } return asDocumentStoreException(ex, message); }
@Override public <T extends Document> int remove(Collection<T> collection, String indexedProperty, long startValue, long endValue) throws DocumentStoreException { try { List<QueryCondition> conditions = new ArrayList<QueryCondition>(); conditions.add(new QueryCondition(indexedProperty, ">", startValue)); conditions.add(new QueryCondition(indexedProperty, "<", endValue)); return deleteWithCondition(collection, conditions); } finally { if (collection == Collection.NODES) { // this method is currently being used only for Journal // collection while GC. But, to keep sanctity of the API, we // need to acknowledge that Nodes collection could've been used. // But, in this signature, there's no useful way to invalidate // cache. // So, we use the hammer for this task invalidateCache(); } } }
@Override public <T extends Document> int remove(Collection<T> collection, String indexedProperty, long startValue, long endValue) throws DocumentStoreException { try { List<QueryCondition> conditions = new ArrayList<QueryCondition>(); conditions.add(new QueryCondition(indexedProperty, ">", startValue)); conditions.add(new QueryCondition(indexedProperty, "<", endValue)); return deleteWithCondition(collection, conditions); } finally { if (collection == Collection.NODES) { // this method is currently being used only for Journal // collection while GC. But, to keep sanctity of the API, we // need to acknowledge that Nodes collection could've been used. // But, in this signature, there's no useful way to invalidate // cache. // So, we use the hammer for this task invalidateCache(); } } }