test_class.declarator: ROOT_ID = Utils.getIdFromPath("/")
test_class.modifier: private static final
test_class.original_string: private static final String ROOT_ID = Utils.getIdFromPath("/");
test_class.type: String
test_class.var_name: ROOT_ID
test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/SplitOperationsTest.java
test_class.identifier: SplitOperationsTest
test_class.superclass: extends BaseDocumentMKTest
test_case.body: @Test
      public void malformedStalePrev() throws Exception {
          DocumentNodeStore ns = getDocumentMK().getNodeStore();
          DocumentStore ds = ns.getDocumentStore();
          for (int i = 0; i < 5; i++) {
              NodeBuilder nb = ns.getRoot().builder();
              nb.setProperty("p", "v" + i);
              ns.merge(nb, EmptyHook.INSTANCE, CommitInfo.EMPTY);
          }
  
          // add a dangling _stalePrev
          UpdateOp op = new UpdateOp(ROOT_ID, false);
          NodeDocument.setStalePrevious(op, ns.newRevision(), 0);
          assertNotNull(ds.findAndUpdate(NODES, op));
  
          NodeDocument doc = ds.find(NODES, ROOT_ID);
          assertNotNull(doc);
          for (UpdateOp updateOp : SplitOperations.forDocument(
                  doc, ns, ns.getHeadRevision(), NO_BINARY, 3)) {
              ds.createOrUpdate(NODES, updateOp);
          }
  
          doc = ds.find(NODES, ROOT_ID);
          assertNotNull(doc);
          // now _stalePrev entry must be gone
          assertEquals(0, doc.getStalePrev().size());
      }
test_case.class_method_signature: SplitOperationsTest.malformedStalePrev()
test_case.full_signature: @Test public void malformedStalePrev()
test_case.identifier: malformedStalePrev
test_case.invocations: getNodeStore getDocumentMK getDocumentStore builder getRoot setProperty merge setStalePrevious newRevision assertNotNull findAndUpdate find assertNotNull forDocument getHeadRevision createOrUpdate find assertNotNull assertEquals size getStalePrev
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void malformedStalePrev()
focal_class.declarator: LOG = LoggerFactory.getLogger(SplitOperations.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(SplitOperations.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: GARBAGE_LIMIT = Integer.getInteger("oak.documentMK.garbage.limit", 1000)
focal_class.modifier: private static final
focal_class.original_string: private static final int GARBAGE_LIMIT = Integer.getInteger("oak.documentMK.garbage.limit", 1000);
focal_class.type: int
focal_class.var_name: GARBAGE_LIMIT
focal_class.declarator: BINARY_FOR_SPLIT_THRESHOLD = new Predicate<Long>() {
          @Override
          public boolean apply(Long input) {
              // only force trigger split for binaries bigger than 4k
              return input > 4096;
          }
      }
focal_class.modifier: private static final
focal_class.original_string: private static final Predicate<Long> BINARY_FOR_SPLIT_THRESHOLD = new Predicate<Long>() {
          @Override
          public boolean apply(Long input) {
              // only force trigger split for binaries bigger than 4k
              return input > 4096;
          }
      };
focal_class.type: Predicate<Long>
focal_class.var_name: BINARY_FOR_SPLIT_THRESHOLD
focal_class.declarator: STORE = new MemoryDocumentStore()
focal_class.modifier: private static final
focal_class.original_string: private static final DocumentStore STORE = new MemoryDocumentStore();
focal_class.type: DocumentStore
focal_class.var_name: STORE
focal_class.declarator: doc
focal_class.modifier: private final
focal_class.original_string: private final NodeDocument doc;
focal_class.type: NodeDocument
focal_class.var_name: doc
focal_class.declarator: path
focal_class.modifier: private final
focal_class.original_string: private final Path path;
focal_class.type: Path
focal_class.var_name: path
focal_class.declarator: id
focal_class.modifier: private final
focal_class.original_string: private final String id;
focal_class.type: String
focal_class.var_name: id
focal_class.declarator: headRevision
focal_class.modifier: private final
focal_class.original_string: private final Revision headRevision;
focal_class.type: Revision
focal_class.var_name: headRevision
focal_class.declarator: context
focal_class.modifier: private final
focal_class.original_string: private final RevisionContext context;
focal_class.type: RevisionContext
focal_class.var_name: context
focal_class.declarator: binarySize
focal_class.modifier: private final
focal_class.original_string: private final Function<String, Long> binarySize;
focal_class.type: Function<String, Long>
focal_class.var_name: binarySize
focal_class.declarator: numRevsThreshold
focal_class.modifier: private final
focal_class.original_string: private final int numRevsThreshold;
focal_class.type: int
focal_class.var_name: numRevsThreshold
focal_class.declarator: high
focal_class.modifier: private
focal_class.original_string: private Revision high;
focal_class.type: Revision
focal_class.var_name: high
focal_class.declarator: low
focal_class.modifier: private
focal_class.original_string: private Revision low;
focal_class.type: Revision
focal_class.var_name: low
focal_class.declarator: numValues
focal_class.modifier: private
focal_class.original_string: private int numValues;
focal_class.type: int
focal_class.var_name: numValues
focal_class.declarator: hasBinaryToSplit
focal_class.modifier: private
focal_class.original_string: private boolean hasBinaryToSplit;
focal_class.type: boolean
focal_class.var_name: hasBinaryToSplit
focal_class.declarator: nodeExistsAtHeadRevision
focal_class.modifier: private
focal_class.original_string: private Supplier<Boolean> nodeExistsAtHeadRevision;
focal_class.type: Supplier<Boolean>
focal_class.var_name: nodeExistsAtHeadRevision
focal_class.declarator: committedChanges
focal_class.modifier: private
focal_class.original_string: private Map<String, NavigableMap<Revision, String>> committedChanges;
focal_class.type: Map<String, NavigableMap<Revision, String>>
focal_class.var_name: committedChanges
focal_class.declarator: changes
focal_class.modifier: private
focal_class.original_string: private Set<Revision> changes;
focal_class.type: Set<Revision>
focal_class.var_name: changes
focal_class.declarator: garbage
focal_class.modifier: private
focal_class.original_string: private Map<String, Set<Revision>> garbage;
focal_class.type: Map<String, Set<Revision>>
focal_class.var_name: garbage
focal_class.declarator: garbageCount = 0
focal_class.modifier: private
focal_class.original_string: private int garbageCount = 0;
focal_class.type: int
focal_class.var_name: garbageCount
focal_class.declarator: mostRecentRevs
focal_class.modifier: private
focal_class.original_string: private Set<Revision> mostRecentRevs;
focal_class.type: Set<Revision>
focal_class.var_name: mostRecentRevs
focal_class.declarator: splitRevs
focal_class.modifier: private
focal_class.original_string: private Set<Revision> splitRevs;
focal_class.type: Set<Revision>
focal_class.var_name: splitRevs
focal_class.declarator: splitOps
focal_class.modifier: private
focal_class.original_string: private List<UpdateOp> splitOps;
focal_class.type: List<UpdateOp>
focal_class.var_name: splitOps
focal_class.declarator: main
focal_class.modifier: private
focal_class.original_string: private UpdateOp main;
focal_class.type: UpdateOp
focal_class.var_name: main
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/SplitOperations.java
focal_class.identifier: SplitOperations
focal_class.class_method_signature: SplitOperations.SplitOperations(@NotNull final NodeDocument doc,
                              @NotNull final RevisionContext context,
                              @NotNull final RevisionVector headRev,
                              @NotNull final Function<String, Long> binarySize,
                              int numRevsThreshold)
focal_class.full_signature: private  SplitOperations(@NotNull final NodeDocument doc,
                              @NotNull final RevisionContext context,
                              @NotNull final RevisionVector headRev,
                              @NotNull final Function<String, Long> binarySize,
                              int numRevsThreshold)
focal_class.identifier: SplitOperations
focal_class.modifiers: private
focal_class.parameters: (@NotNull final NodeDocument doc,
                              @NotNull final RevisionContext context,
                              @NotNull final RevisionVector headRev,
                              @NotNull final Function<String, Long> binarySize,
                              int numRevsThreshold)
focal_class.signature:  SplitOperations(@NotNull final NodeDocument doc,
                              @NotNull final RevisionContext context,
                              @NotNull final RevisionVector headRev,
                              @NotNull final Function<String, Long> binarySize,
                              int numRevsThreshold)
focal_class.class_method_signature: SplitOperations.forDocument(@NotNull NodeDocument doc,
                                        @NotNull RevisionContext context,
                                        @NotNull RevisionVector headRevision,
                                        @NotNull Function<String, Long> binarySize,
                                        int numRevsThreshold)
focal_class.full_signature: @NotNull static List<UpdateOp> forDocument(@NotNull NodeDocument doc,
                                        @NotNull RevisionContext context,
                                        @NotNull RevisionVector headRevision,
                                        @NotNull Function<String, Long> binarySize,
                                        int numRevsThreshold)
focal_class.identifier: forDocument
focal_class.modifiers: @NotNull static
focal_class.parameters: (@NotNull NodeDocument doc,
                                        @NotNull RevisionContext context,
                                        @NotNull RevisionVector headRevision,
                                        @NotNull Function<String, Long> binarySize,
                                        int numRevsThreshold)
focal_class.return: List<UpdateOp>
focal_class.signature: List<UpdateOp> forDocument(@NotNull NodeDocument doc,
                                        @NotNull RevisionContext context,
                                        @NotNull RevisionVector headRevision,
                                        @NotNull Function<String, Long> binarySize,
                                        int numRevsThreshold)
focal_class.class_method_signature: SplitOperations.create()
focal_class.full_signature: private List<UpdateOp> create()
focal_class.identifier: create
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: List<UpdateOp>
focal_class.signature: List<UpdateOp> create()
focal_class.class_method_signature: SplitOperations.considerSplit()
focal_class.full_signature: private boolean considerSplit()
focal_class.identifier: considerSplit
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean considerSplit()
focal_class.class_method_signature: SplitOperations.populateSplitRevs()
focal_class.full_signature: private void populateSplitRevs()
focal_class.identifier: populateSplitRevs
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void populateSplitRevs()
focal_class.class_method_signature: SplitOperations.hasBinaryPropertyForSplit(Iterable<String> values)
focal_class.full_signature: private boolean hasBinaryPropertyForSplit(Iterable<String> values)
focal_class.identifier: hasBinaryPropertyForSplit
focal_class.modifiers: private
focal_class.parameters: (Iterable<String> values)
focal_class.return: boolean
focal_class.signature: boolean hasBinaryPropertyForSplit(Iterable<String> values)
focal_class.class_method_signature: SplitOperations.collectRevisionsAndCommitRoot()
focal_class.full_signature: private void collectRevisionsAndCommitRoot()
focal_class.identifier: collectRevisionsAndCommitRoot
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void collectRevisionsAndCommitRoot()
focal_class.class_method_signature: SplitOperations.createIntermediateDocs()
focal_class.full_signature: private void createIntermediateDocs()
focal_class.identifier: createIntermediateDocs
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void createIntermediateDocs()
focal_class.class_method_signature: SplitOperations.createSplitOps()
focal_class.full_signature: @Nullable private UpdateOp createSplitOps()
focal_class.identifier: createSplitOps
focal_class.modifiers: @Nullable private
focal_class.parameters: ()
focal_class.return: UpdateOp
focal_class.signature: UpdateOp createSplitOps()
focal_class.class_method_signature: SplitOperations.getPreviousDocsHistogram()
focal_class.full_signature: private Map<Integer, List<Range>> getPreviousDocsHistogram()
focal_class.identifier: getPreviousDocsHistogram
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Map<Integer, List<Range>>
focal_class.signature: Map<Integer, List<Range>> getPreviousDocsHistogram()
focal_class.class_method_signature: SplitOperations.collectLocalChanges(
              Map<String, NavigableMap<Revision, String>> committedLocally,
              Set<Revision> changes)
focal_class.full_signature: private void collectLocalChanges(
              Map<String, NavigableMap<Revision, String>> committedLocally,
              Set<Revision> changes)
focal_class.identifier: collectLocalChanges
focal_class.modifiers: private
focal_class.parameters: (
              Map<String, NavigableMap<Revision, String>> committedLocally,
              Set<Revision> changes)
focal_class.return: void
focal_class.signature: void collectLocalChanges(
              Map<String, NavigableMap<Revision, String>> committedLocally,
              Set<Revision> changes)
focal_class.class_method_signature: SplitOperations.isGarbage(Revision rev)
focal_class.full_signature: private boolean isGarbage(Revision rev)
focal_class.identifier: isGarbage
focal_class.modifiers: private
focal_class.parameters: (Revision rev)
focal_class.return: boolean
focal_class.signature: boolean isGarbage(Revision rev)
focal_class.class_method_signature: SplitOperations.addGarbage(Revision rev, String property)
focal_class.full_signature: private void addGarbage(Revision rev, String property)
focal_class.identifier: addGarbage
focal_class.modifiers: private
focal_class.parameters: (Revision rev, String property)
focal_class.return: void
focal_class.signature: void addGarbage(Revision rev, String property)
focal_class.class_method_signature: SplitOperations.disconnectStalePrevDocs()
focal_class.full_signature: private void disconnectStalePrevDocs()
focal_class.identifier: disconnectStalePrevDocs
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void disconnectStalePrevDocs()
focal_class.class_method_signature: SplitOperations.removeGarbage()
focal_class.full_signature: private void removeGarbage()
focal_class.identifier: removeGarbage
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void removeGarbage()
focal_class.class_method_signature: SplitOperations.trackHigh(Revision r)
focal_class.full_signature: private void trackHigh(Revision r)
focal_class.identifier: trackHigh
focal_class.modifiers: private
focal_class.parameters: (Revision r)
focal_class.return: void
focal_class.signature: void trackHigh(Revision r)
focal_class.class_method_signature: SplitOperations.trackLow(Revision r)
focal_class.full_signature: private void trackLow(Revision r)
focal_class.identifier: trackLow
focal_class.modifiers: private
focal_class.parameters: (Revision r)
focal_class.return: void
focal_class.signature: void trackLow(Revision r)
focal_class.class_method_signature: SplitOperations.setSplitDocProps(NodeDocument mainDoc, NodeDocument oldDoc,
                                           UpdateOp old, Revision maxRev)
focal_class.full_signature: private static void setSplitDocProps(NodeDocument mainDoc, NodeDocument oldDoc,
                                           UpdateOp old, Revision maxRev)
focal_class.identifier: setSplitDocProps
focal_class.modifiers: private static
focal_class.parameters: (NodeDocument mainDoc, NodeDocument oldDoc,
                                           UpdateOp old, Revision maxRev)
focal_class.return: void
focal_class.signature: void setSplitDocProps(NodeDocument mainDoc, NodeDocument oldDoc,
                                           UpdateOp old, Revision maxRev)
focal_class.class_method_signature: SplitOperations.setIntermediateDocProps(UpdateOp intermediate, Revision maxRev)
focal_class.full_signature: private static void setIntermediateDocProps(UpdateOp intermediate, Revision maxRev)
focal_class.identifier: setIntermediateDocProps
focal_class.modifiers: private static
focal_class.parameters: (UpdateOp intermediate, Revision maxRev)
focal_class.return: void
focal_class.signature: void setIntermediateDocProps(UpdateOp intermediate, Revision maxRev)
focal_class.class_method_signature: SplitOperations.setSplitDocType(@NotNull UpdateOp op,
                                          @NotNull SplitDocType type)
focal_class.full_signature: private static void setSplitDocType(@NotNull UpdateOp op,
                                          @NotNull SplitDocType type)
focal_class.identifier: setSplitDocType
focal_class.modifiers: private static
focal_class.parameters: (@NotNull UpdateOp op,
                                          @NotNull SplitDocType type)
focal_class.return: void
focal_class.signature: void setSplitDocType(@NotNull UpdateOp op,
                                          @NotNull SplitDocType type)
focal_class.class_method_signature: SplitOperations.setSplitDocMaxRev(@NotNull UpdateOp op,
                                            @NotNull Revision maxRev)
focal_class.full_signature: private static void setSplitDocMaxRev(@NotNull UpdateOp op,
                                            @NotNull Revision maxRev)
focal_class.identifier: setSplitDocMaxRev
focal_class.modifiers: private static
focal_class.parameters: (@NotNull UpdateOp op,
                                            @NotNull Revision maxRev)
focal_class.return: void
focal_class.signature: void setSplitDocMaxRev(@NotNull UpdateOp op,
                                            @NotNull Revision maxRev)
focal_method.body: @NotNull
      static List<UpdateOp> forDocument(@NotNull NodeDocument doc,
                                        @NotNull RevisionContext context,
                                        @NotNull RevisionVector headRevision,
                                        @NotNull Function<String, Long> binarySize,
                                        int numRevsThreshold) {
          if (doc.isSplitDocument()) {
              throw new IllegalArgumentException(
                      "Not a main document: " + doc.getId());
          }
          return new SplitOperations(doc, context, headRevision,
                  binarySize, numRevsThreshold).create();
  
      }
focal_method.class_method_signature: SplitOperations.forDocument(@NotNull NodeDocument doc,
                                        @NotNull RevisionContext context,
                                        @NotNull RevisionVector headRevision,
                                        @NotNull Function<String, Long> binarySize,
                                        int numRevsThreshold)
focal_method.full_signature: @NotNull static List<UpdateOp> forDocument(@NotNull NodeDocument doc,
                                        @NotNull RevisionContext context,
                                        @NotNull RevisionVector headRevision,
                                        @NotNull Function<String, Long> binarySize,
                                        int numRevsThreshold)
focal_method.identifier: forDocument
focal_method.invocations: isSplitDocument getId create
focal_method.modifiers: @NotNull static
focal_method.parameters: (@NotNull NodeDocument doc,
                                        @NotNull RevisionContext context,
                                        @NotNull RevisionVector headRevision,
                                        @NotNull Function<String, Long> binarySize,
                                        int numRevsThreshold)
focal_method.return: List<UpdateOp>
focal_method.signature: List<UpdateOp> forDocument(@NotNull NodeDocument doc,
                                        @NotNull RevisionContext context,
                                        @NotNull RevisionVector headRevision,
                                        @NotNull Function<String, Long> binarySize,
                                        int numRevsThreshold)