use of org.apache.jackrabbit.oak.cache.CacheValue in project jackrabbit-oak by apache.
the class MongoDocumentStore method invalidateCache.
@Override
public CacheInvalidationStats invalidateCache() {
InvalidationResult result = new InvalidationResult();
for (CacheValue key : nodesCache.keys()) {
result.invalidationCount++;
invalidateCache(Collection.NODES, key.toString());
}
return result;
}
use of org.apache.jackrabbit.oak.cache.CacheValue in project jackrabbit-oak by apache.
the class DocumentNodeStoreBuilder method buildNodeDocumentCache.
public NodeDocumentCache buildNodeDocumentCache(DocumentStore docStore, NodeDocumentLocks locks) {
Cache<CacheValue, NodeDocument> nodeDocumentsCache = buildDocumentCache(docStore);
CacheStats nodeDocumentsCacheStats = new CacheStats(nodeDocumentsCache, "Document-Documents", getWeigher(), getDocumentCacheSize());
Cache<StringValue, NodeDocument> prevDocumentsCache = buildPrevDocumentsCache(docStore);
CacheStats prevDocumentsCacheStats = new CacheStats(prevDocumentsCache, "Document-PrevDocuments", getWeigher(), getPrevDocumentCacheSize());
return new NodeDocumentCache(nodeDocumentsCache, nodeDocumentsCacheStats, prevDocumentsCache, prevDocumentsCacheStats, locks);
}
use of org.apache.jackrabbit.oak.cache.CacheValue in project jackrabbit-oak by apache.
the class CacheChangesTrackerTest method createCache.
private NodeDocumentCache createCache() {
Cache<CacheValue, NodeDocument> nodeDocumentsCache = new CacheLIRS<CacheValue, NodeDocument>(10);
Cache<StringValue, NodeDocument> prevDocumentsCache = new CacheLIRS<StringValue, NodeDocument>(10);
CacheStats nodeDocumentsCacheStats = Mockito.mock(CacheStats.class);
CacheStats prevDocumentsCacheStats = Mockito.mock(CacheStats.class);
NodeDocumentLocks locks = new StripedNodeDocumentLocks();
return new NodeDocumentCache(nodeDocumentsCache, nodeDocumentsCacheStats, prevDocumentsCache, prevDocumentsCacheStats, locks);
}
Aggregations