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

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


            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

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.