Search in sources :

Example 1 with CacheValue

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;
}
Also used : CacheValue(org.apache.jackrabbit.oak.cache.CacheValue)

Example 2 with CacheValue

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);
}
Also used : NodeDocumentCache(org.apache.jackrabbit.oak.plugins.document.cache.NodeDocumentCache) CacheValue(org.apache.jackrabbit.oak.cache.CacheValue) CacheStats(org.apache.jackrabbit.oak.cache.CacheStats) PersistentCacheStats(org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCacheStats) StringValue(org.apache.jackrabbit.oak.plugins.document.util.StringValue)

Example 3 with CacheValue

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);
}
Also used : NodeDocumentLocks(org.apache.jackrabbit.oak.plugins.document.locks.NodeDocumentLocks) StripedNodeDocumentLocks(org.apache.jackrabbit.oak.plugins.document.locks.StripedNodeDocumentLocks) StripedNodeDocumentLocks(org.apache.jackrabbit.oak.plugins.document.locks.StripedNodeDocumentLocks) CacheValue(org.apache.jackrabbit.oak.cache.CacheValue) CacheStats(org.apache.jackrabbit.oak.cache.CacheStats) NodeDocument(org.apache.jackrabbit.oak.plugins.document.NodeDocument) StringValue(org.apache.jackrabbit.oak.plugins.document.util.StringValue) CacheLIRS(org.apache.jackrabbit.oak.cache.CacheLIRS)

Aggregations

CacheValue (org.apache.jackrabbit.oak.cache.CacheValue)3 CacheStats (org.apache.jackrabbit.oak.cache.CacheStats)2 StringValue (org.apache.jackrabbit.oak.plugins.document.util.StringValue)2 CacheLIRS (org.apache.jackrabbit.oak.cache.CacheLIRS)1 NodeDocument (org.apache.jackrabbit.oak.plugins.document.NodeDocument)1 NodeDocumentCache (org.apache.jackrabbit.oak.plugins.document.cache.NodeDocumentCache)1 NodeDocumentLocks (org.apache.jackrabbit.oak.plugins.document.locks.NodeDocumentLocks)1 StripedNodeDocumentLocks (org.apache.jackrabbit.oak.plugins.document.locks.StripedNodeDocumentLocks)1 PersistentCacheStats (org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCacheStats)1