Package org.apache.jackrabbit.oak.plugins.document

Examples of org.apache.jackrabbit.oak.plugins.document.CachedNodeDocument


            for (DBObject obj : cursor) {
                result.cacheEntriesProcessedCount++;
                String id = (String) obj.get(Document.ID);
                Number modCount = (Number) obj.get(Document.MOD_COUNT);

                CachedNodeDocument cachedDoc = documentStore.getCachedNodeDoc(id);
                if (cachedDoc != null
                        && !Objects.equal(cachedDoc.getModCount(), modCount)) {
                    documentStore.invalidateCache(Collection.NODES, id);
                    result.invalidationCount++;
                } else {
                    result.upToDateCount++;
                }
View Full Code Here


                        Number latestModCount = (Number) obj.get(Document.MOD_COUNT);
                        String id = (String) obj.get(Document.ID);

                        final TreeNode tn2 = sameLevelNodes.get(id);
                        CachedNodeDocument cachedDoc = tn2.getDocument();
                        if (cachedDoc != null) {
                            boolean noChangeInModCount = Objects.equal(latestModCount, cachedDoc.getModCount());
                            if (noChangeInModCount) {
                                result.upToDateCount++;
                                tn2.markUptodate(startTime);
                            } else {
                                result.invalidationCount++;
View Full Code Here

            public CachedNodeDocument getDocument() {
                return documentStore.getCachedNodeDoc(id);
            }

            public boolean isUptodate(long time) {
                CachedNodeDocument doc = documentStore.getCachedNodeDoc(id);
                if (doc != null) {
                    return doc.isUpToDate(time);
                } else {
                    // If doc is not present in cache then its already
                    // up-to-date i.e. no further consistency check required
                    // for this document
                    return true;
View Full Code Here

                    return true;
                }
            }

            public void markUptodate(long cacheCheckTime) {
                CachedNodeDocument doc = getDocument();
                if (doc == null) {
                    return;
                }
                markUptodate(cacheCheckTime, doc);
            }
View Full Code Here

                // Update the parent after child
                markUptodate(getId(), cacheCheckTime, upToDateRoot);
            }

            private void markUptodate(String key, long time, CachedNodeDocument upToDateRoot) {
                CachedNodeDocument doc = documentStore.getCachedNodeDoc(key);

                if (doc == null) {
                    return;
                }
                // Only mark the cachedDoc up-to-date if
                // 1. it got created i.e. cached document creation
                //    time is greater or same as the time of the root node on which markUptodate
                //    is invoked. As in typical cache population child node would be added
                //    later than the parent.
                //    If the creation time is less then it means that parent got replaced/updated later
                //    and hence its _lastRev property would not truly reflect the state of child nodes
                //    present in cache
                // 2. OR Check if both documents have been marked up-to-date in last cycle. As in that case
                //    previous cycle would have done the required checks

                if (doc.getCreated() >= upToDateRoot.getCreated()
                        || doc.getLastCheckTime() == upToDateRoot.getLastCheckTime()) {
                    doc.markUpToDate(time);
                }
            }
View Full Code Here

            for (DBObject obj : cursor) {
                result.cacheEntriesProcessedCount++;
                String id = (String) obj.get(Document.ID);
                Number modCount = (Number) obj.get(Document.MOD_COUNT);

                CachedNodeDocument cachedDoc = documentStore.getCachedNodeDoc(id);
                if (cachedDoc != null
                        && !Objects.equal(cachedDoc.getModCount(), modCount)) {
                    documentStore.invalidateCache(Collection.NODES, id);
                    result.invalidationCount++;
                } else {
                    result.upToDateCount++;
                }
View Full Code Here

                                Number latestModCount = (Number) obj.get(Document.MOD_COUNT);
                                String id = (String) obj.get(Document.ID);

                                final TreeNode tn2 = sameLevelNodes.get(id);
                                CachedNodeDocument cachedDoc = tn2.getDocument();
                                if (cachedDoc != null) {
                                    boolean noChangeInModCount = Objects.equal(latestModCount, cachedDoc.getModCount());
                                    if (noChangeInModCount) {
                                        result.upToDateCount++;
                                        tn2.markUptodate(startTime);
                                    } else {
                                        result.invalidationCount++;
View Full Code Here

                //TODO Split documents are immutable hence no need to
                //check them
                //TODO Need to determine way to determine if the
                //key is referring to a split document
                result.cacheSize++;
                CachedNodeDocument doc = e.getValue();
                String path;
                if (doc == NodeDocument.NULL) {
                    String id = e.getKey().toString();
                    if (Utils.isIdFromLongPath(id)) {
                        LOG.debug("Negative cache entry with long path {}. Invalidating", id);
                        documentStore.invalidateCache(Collection.NODES, id);
                        path = null;
                    } else {
                        path = Utils.getPathFromId(id);
                    }
                } else {
                    path = doc.getPath();
                }
                if (path != null) {
                    for (String name : PathUtils.elements(path)) {
                        current = current.child(name);
                    }
View Full Code Here

            public CachedNodeDocument getDocument() {
                return documentStore.getCachedNodeDoc(id);
            }

            public boolean isUptodate(long time) {
                CachedNodeDocument doc = documentStore.getCachedNodeDoc(id);
                if (doc != null) {
                    return doc.isUpToDate(time);
                } else {
                    // If doc is not present in cache then its already
                    // up-to-date i.e. no further consistency check required
                    // for this document
                    return true;
View Full Code Here

                    return true;
                }
            }

            public void markUptodate(long cacheCheckTime) {
                CachedNodeDocument doc = getDocument();
                if (doc == null) {
                    return;
                }
                markUptodate(cacheCheckTime, doc);
            }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.document.CachedNodeDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.