test_class.declarator: empty = Collections.emptyList()
test_class.modifier: private final
test_class.original_string: private final List<String> empty = Collections.emptyList();
test_class.type: List<String>
test_class.var_name: empty
test_class.declarator: builderProvider = new DocumentMKBuilderProvider()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public DocumentMKBuilderProvider builderProvider = new DocumentMKBuilderProvider();
test_class.type: DocumentMKBuilderProvider
test_class.var_name: builderProvider
test_class.declarator: primary
test_class.modifier: private
test_class.original_string: private DocumentNodeStore primary;
test_class.type: DocumentNodeStore
test_class.var_name: primary
test_class.declarator: secondary
test_class.modifier: private
test_class.original_string: private NodeStore secondary;
test_class.type: NodeStore
test_class.var_name: secondary
test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/secondary/SecondaryStoreCacheTest.java
test_class.identifier: SecondaryStoreCacheTest
test_case.body: @Test
      public void updateAndReadAtReadRev() throws Exception{
          SecondaryStoreCache cache = createCache(new PathFilter(of("/a"), empty));
  
          NodeBuilder nb = primary.getRoot().builder();
          create(nb, "/a/b", "/a/c", "/x/y/z");
          AbstractDocumentNodeState r1 = merge(nb);
  
          //Update some other part of tree i.e. which does not change lastRev for /a/c
          nb = primary.getRoot().builder();
          create(nb, "/a/e/d");
          AbstractDocumentNodeState r2 = merge(nb);
  
          //Lookup should work fine
          AbstractDocumentNodeState a_r2 = documentState(r2, "/a/c");
          AbstractDocumentNodeState result
                  = cache.getDocumentNodeState(Path.fromString("/a/c"), r2.getRootRevision(), a_r2.getLastRevision());
          assertTrue(EqualsDiff.equals(a_r2, result));
  
          //Child docs should only have lastRev and not root rev
          assertTrue(result.hasProperty(DelegatingDocumentNodeState.PROP_LAST_REV));
          assertFalse(result.hasProperty(DelegatingDocumentNodeState.PROP_REVISION));
  
          //Root doc would have both meta props
          assertTrue(secondary.getRoot().hasProperty(DelegatingDocumentNodeState.PROP_LAST_REV));
          assertTrue(secondary.getRoot().hasProperty(DelegatingDocumentNodeState.PROP_REVISION));
  
          nb = primary.getRoot().builder();
          nb.child("a").child("c").remove();
          AbstractDocumentNodeState r3 = merge(nb);
  
          //Now look from older revision
          result = cache.getDocumentNodeState(Path.fromString("/a/c"), r3.getRootRevision(), a_r2.getLastRevision());
  
          //now as its not visible from head it would not be visible
          assertNull(result);
      }
test_case.class_method_signature: SecondaryStoreCacheTest.updateAndReadAtReadRev()
test_case.full_signature: @Test public void updateAndReadAtReadRev()
test_case.identifier: updateAndReadAtReadRev
test_case.invocations: createCache of builder getRoot create merge builder getRoot create merge documentState getDocumentNodeState fromString getRootRevision getLastRevision assertTrue equals assertTrue hasProperty assertFalse hasProperty assertTrue hasProperty getRoot assertTrue hasProperty getRoot builder getRoot remove child child merge getDocumentNodeState fromString getRootRevision getLastRevision assertNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void updateAndReadAtReadRev()
focal_class.declarator: log = LoggerFactory.getLogger(getClass())
focal_class.modifier: private final
focal_class.original_string: private final Logger log = LoggerFactory.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: EMPTY = new AbstractDocumentNodeState[0]
focal_class.modifier: private static final
focal_class.original_string: private static final AbstractDocumentNodeState[] EMPTY = new AbstractDocumentNodeState[0];
focal_class.type: AbstractDocumentNodeState[]
focal_class.var_name: EMPTY
focal_class.declarator: store
focal_class.modifier: private final
focal_class.original_string: private final NodeStore store;
focal_class.type: NodeStore
focal_class.var_name: store
focal_class.declarator: pathFilter
focal_class.modifier: private final
focal_class.original_string: private final PathFilter pathFilter;
focal_class.type: PathFilter
focal_class.var_name: pathFilter
focal_class.declarator: differ
focal_class.modifier: private final
focal_class.original_string: private final NodeStateDiffer differ;
focal_class.type: NodeStateDiffer
focal_class.var_name: differ
focal_class.declarator: unknownPaths
focal_class.modifier: private final
focal_class.original_string: private final MeterStats unknownPaths;
focal_class.type: MeterStats
focal_class.var_name: unknownPaths
focal_class.declarator: knownMissed
focal_class.modifier: private final
focal_class.original_string: private final MeterStats knownMissed;
focal_class.type: MeterStats
focal_class.var_name: knownMissed
focal_class.declarator: knownMissedOld
focal_class.modifier: private final
focal_class.original_string: private final MeterStats knownMissedOld;
focal_class.type: MeterStats
focal_class.var_name: knownMissedOld
focal_class.declarator: knownMissedNew
focal_class.modifier: private final
focal_class.original_string: private final MeterStats knownMissedNew;
focal_class.type: MeterStats
focal_class.var_name: knownMissedNew
focal_class.declarator: knownMissedInRange
focal_class.modifier: private final
focal_class.original_string: private final MeterStats knownMissedInRange;
focal_class.type: MeterStats
focal_class.var_name: knownMissedInRange
focal_class.declarator: headRevMatched
focal_class.modifier: private final
focal_class.original_string: private final MeterStats headRevMatched;
focal_class.type: MeterStats
focal_class.var_name: headRevMatched
focal_class.declarator: prevRevMatched
focal_class.modifier: private final
focal_class.original_string: private final MeterStats prevRevMatched;
focal_class.type: MeterStats
focal_class.var_name: prevRevMatched
focal_class.declarator: maxSize = 10000
focal_class.modifier: private final
focal_class.original_string: private final int maxSize = 10000;
focal_class.type: int
focal_class.var_name: maxSize
focal_class.declarator: queue
focal_class.modifier: private final
focal_class.original_string: private final EvictingQueue<AbstractDocumentNodeState> queue;
focal_class.type: EvictingQueue<AbstractDocumentNodeState>
focal_class.var_name: queue
focal_class.declarator: previousRoots = EMPTY
focal_class.modifier: private volatile
focal_class.original_string: private volatile AbstractDocumentNodeState[] previousRoots = EMPTY;
focal_class.type: AbstractDocumentNodeState[]
focal_class.var_name: previousRoots
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/secondary/SecondaryStoreCache.java
focal_class.identifier: SecondaryStoreCache
focal_class.interfaces: implements DocumentNodeStateCache, SecondaryStoreRootObserver
focal_class.class_method_signature: SecondaryStoreCache.SecondaryStoreCache(NodeStore nodeStore, NodeStateDiffer differ, PathFilter pathFilter,
                                 StatisticsProvider statisticsProvider)
focal_class.full_signature: public  SecondaryStoreCache(NodeStore nodeStore, NodeStateDiffer differ, PathFilter pathFilter,
                                 StatisticsProvider statisticsProvider)
focal_class.identifier: SecondaryStoreCache
focal_class.modifiers: public
focal_class.parameters: (NodeStore nodeStore, NodeStateDiffer differ, PathFilter pathFilter,
                                 StatisticsProvider statisticsProvider)
focal_class.signature:  SecondaryStoreCache(NodeStore nodeStore, NodeStateDiffer differ, PathFilter pathFilter,
                                 StatisticsProvider statisticsProvider)
focal_class.class_method_signature: SecondaryStoreCache.getDocumentNodeState(Path path, RevisionVector rootRevision,
                                                            RevisionVector lastRev)
focal_class.full_signature: @Nullable @Override public AbstractDocumentNodeState getDocumentNodeState(Path path, RevisionVector rootRevision,
                                                            RevisionVector lastRev)
focal_class.identifier: getDocumentNodeState
focal_class.modifiers: @Nullable @Override public
focal_class.parameters: (Path path, RevisionVector rootRevision,
                                                            RevisionVector lastRev)
focal_class.return: AbstractDocumentNodeState
focal_class.signature: AbstractDocumentNodeState getDocumentNodeState(Path path, RevisionVector rootRevision,
                                                            RevisionVector lastRev)
focal_class.class_method_signature: SecondaryStoreCache.isCached(Path path)
focal_class.full_signature: @Override public boolean isCached(Path path)
focal_class.identifier: isCached
focal_class.modifiers: @Override public
focal_class.parameters: (Path path)
focal_class.return: boolean
focal_class.signature: boolean isCached(Path path)
focal_class.class_method_signature: SecondaryStoreCache.findByMatchingLastRev(AbstractDocumentNodeState root, Path path,
                                                        RevisionVector lastRev)
focal_class.full_signature: @Nullable private AbstractDocumentNodeState findByMatchingLastRev(AbstractDocumentNodeState root, Path path,
                                                        RevisionVector lastRev)
focal_class.identifier: findByMatchingLastRev
focal_class.modifiers: @Nullable private
focal_class.parameters: (AbstractDocumentNodeState root, Path path,
                                                        RevisionVector lastRev)
focal_class.return: AbstractDocumentNodeState
focal_class.signature: AbstractDocumentNodeState findByMatchingLastRev(AbstractDocumentNodeState root, Path path,
                                                        RevisionVector lastRev)
focal_class.class_method_signature: SecondaryStoreCache.findMatchingRoot(RevisionVector rr)
focal_class.full_signature: @Nullable private AbstractDocumentNodeState findMatchingRoot(RevisionVector rr)
focal_class.identifier: findMatchingRoot
focal_class.modifiers: @Nullable private
focal_class.parameters: (RevisionVector rr)
focal_class.return: AbstractDocumentNodeState
focal_class.signature: AbstractDocumentNodeState findMatchingRoot(RevisionVector rr)
focal_class.class_method_signature: SecondaryStoreCache.contentChanged(@NotNull AbstractDocumentNodeState root)
focal_class.full_signature: @Override public void contentChanged(@NotNull AbstractDocumentNodeState root)
focal_class.identifier: contentChanged
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull AbstractDocumentNodeState root)
focal_class.return: void
focal_class.signature: void contentChanged(@NotNull AbstractDocumentNodeState root)
focal_class.class_method_signature: SecondaryStoreCache.isEmpty()
focal_class.full_signature: private boolean isEmpty()
focal_class.identifier: isEmpty
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isEmpty()
focal_class.class_method_signature: SecondaryStoreCache.findMatchingRoot(AbstractDocumentNodeState[] roots, RevisionVector key)
focal_class.full_signature: static AbstractDocumentNodeState findMatchingRoot(AbstractDocumentNodeState[] roots, RevisionVector key)
focal_class.identifier: findMatchingRoot
focal_class.modifiers: static
focal_class.parameters: (AbstractDocumentNodeState[] roots, RevisionVector key)
focal_class.return: AbstractDocumentNodeState
focal_class.signature: AbstractDocumentNodeState findMatchingRoot(AbstractDocumentNodeState[] roots, RevisionVector key)
focal_class.class_method_signature: SecondaryStoreCache.asDocState(NodeState state)
focal_class.full_signature: private static AbstractDocumentNodeState asDocState(NodeState state)
focal_class.identifier: asDocState
focal_class.modifiers: private static
focal_class.parameters: (NodeState state)
focal_class.return: AbstractDocumentNodeState
focal_class.signature: AbstractDocumentNodeState asDocState(NodeState state)
focal_method.body: @Nullable
      @Override
      public AbstractDocumentNodeState getDocumentNodeState(Path path, RevisionVector rootRevision,
                                                            RevisionVector lastRev) {
          //TODO We might need skip the calls if they occur due to SecondaryStoreObserver
          //doing the diff or in the startup when we try to sync the state
          String p = path.toString();
          PathFilter.Result result = pathFilter.filter(p);
          if (result != PathFilter.Result.INCLUDE) {
              unknownPaths.mark();
              return null;
          }
  
          if (!DelegatingDocumentNodeState.hasMetaProps(store.getRoot())){
              return null;
          }
  
          AbstractDocumentNodeState currentRoot = DelegatingDocumentNodeState.wrap(store.getRoot(), differ);
  
          //If the root rev is < lastRev then secondary store is lagging and would
          //not have the matching result
          if (lastRev.compareTo(currentRoot.getLastRevision()) > 0){
              return null;
          }
  
          AbstractDocumentNodeState nodeState = findByMatchingLastRev(currentRoot, path, lastRev);
          if (nodeState != null){
              headRevMatched.mark();
              return nodeState;
          }
  
          AbstractDocumentNodeState matchingRoot = findMatchingRoot(rootRevision);
          if (matchingRoot != null){
              NodeState state = NodeStateUtils.getNode(matchingRoot, p);
              if (state.exists()){
                  AbstractDocumentNodeState docState = asDocState(state);
                  prevRevMatched.mark();
                  return docState;
              }
          }
  
          knownMissed.mark();
          return null;
      }
focal_method.class_method_signature: SecondaryStoreCache.getDocumentNodeState(Path path, RevisionVector rootRevision,
                                                            RevisionVector lastRev)
focal_method.full_signature: @Nullable @Override public AbstractDocumentNodeState getDocumentNodeState(Path path, RevisionVector rootRevision,
                                                            RevisionVector lastRev)
focal_method.identifier: getDocumentNodeState
focal_method.invocations: toString filter mark hasMetaProps getRoot wrap getRoot compareTo getLastRevision findByMatchingLastRev mark findMatchingRoot getNode exists asDocState mark mark
focal_method.modifiers: @Nullable @Override public
focal_method.parameters: (Path path, RevisionVector rootRevision,
                                                            RevisionVector lastRev)
focal_method.return: AbstractDocumentNodeState
focal_method.signature: AbstractDocumentNodeState getDocumentNodeState(Path path, RevisionVector rootRevision,
                                                            RevisionVector lastRev)