test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/counter/ApproximateCounterTest.java
test_class.identifier: ApproximateCounterTest
test_case.body: @Test
      public void keepAboveZero() {
          // adjustOffset ensures that the resulting count is larger or equal to 0
          assertEquals(1234, ApproximateCounter.adjustOffset(-1234, -100, 10));
      }
test_case.class_method_signature: ApproximateCounterTest.keepAboveZero()
test_case.full_signature: @Test public void keepAboveZero()
test_case.identifier: keepAboveZero
test_case.invocations: assertEquals adjustOffset
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void keepAboveZero()
focal_class.declarator: COUNT_PROPERTY_PREFIX = ":count_"
focal_class.modifier: public static final
focal_class.original_string: public static final String COUNT_PROPERTY_PREFIX = ":count_";
focal_class.type: String
focal_class.var_name: COUNT_PROPERTY_PREFIX
focal_class.declarator: COUNT_RESOLUTION = 100
focal_class.modifier: public static final
focal_class.original_string: public static final int COUNT_RESOLUTION = 100;
focal_class.type: int
focal_class.var_name: COUNT_RESOLUTION
focal_class.declarator: COUNT_MAX = 10000000
focal_class.modifier: public static final
focal_class.original_string: public static final int COUNT_MAX = 10000000;
focal_class.type: int
focal_class.var_name: COUNT_MAX
focal_class.declarator: RANDOM = new Random()
focal_class.modifier: private static final
focal_class.original_string: private static final Random RANDOM = new Random();
focal_class.type: Random
focal_class.var_name: RANDOM
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/counter/ApproximateCounter.java
focal_class.identifier: ApproximateCounter
focal_class.class_method_signature: ApproximateCounter.ApproximateCounter()
focal_class.full_signature: private  ApproximateCounter()
focal_class.identifier: ApproximateCounter
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  ApproximateCounter()
focal_class.class_method_signature: ApproximateCounter.calculateOffset(long offset, int resolution)
focal_class.full_signature: public static long calculateOffset(long offset, int resolution)
focal_class.identifier: calculateOffset
focal_class.modifiers: public static
focal_class.parameters: (long offset, int resolution)
focal_class.return: long
focal_class.signature: long calculateOffset(long offset, int resolution)
focal_class.class_method_signature: ApproximateCounter.adjustOffset(long oldCount, long calculatedOffset,
              int resolution)
focal_class.full_signature: public static long adjustOffset(long oldCount, long calculatedOffset,
              int resolution)
focal_class.identifier: adjustOffset
focal_class.modifiers: public static
focal_class.parameters: (long oldCount, long calculatedOffset,
              int resolution)
focal_class.return: long
focal_class.signature: long adjustOffset(long oldCount, long calculatedOffset,
              int resolution)
focal_class.class_method_signature: ApproximateCounter.setSeed(int seed)
focal_class.full_signature: static void setSeed(int seed)
focal_class.identifier: setSeed
focal_class.modifiers: static
focal_class.parameters: (int seed)
focal_class.return: void
focal_class.signature: void setSeed(int seed)
focal_class.class_method_signature: ApproximateCounter.adjustCountSync(NodeBuilder builder, long offset)
focal_class.full_signature: public static void adjustCountSync(NodeBuilder builder, long offset)
focal_class.identifier: adjustCountSync
focal_class.modifiers: public static
focal_class.parameters: (NodeBuilder builder, long offset)
focal_class.return: void
focal_class.signature: void adjustCountSync(NodeBuilder builder, long offset)
focal_class.class_method_signature: ApproximateCounter.adjustCountSync(NodeBuilder builder, boolean added)
focal_class.full_signature: private static void adjustCountSync(NodeBuilder builder, boolean added)
focal_class.identifier: adjustCountSync
focal_class.modifiers: private static
focal_class.parameters: (NodeBuilder builder, boolean added)
focal_class.return: void
focal_class.signature: void adjustCountSync(NodeBuilder builder, boolean added)
focal_class.class_method_signature: ApproximateCounter.getMaxCount(NodeBuilder node, boolean added)
focal_class.full_signature: private static int getMaxCount(NodeBuilder node, boolean added)
focal_class.identifier: getMaxCount
focal_class.modifiers: private static
focal_class.parameters: (NodeBuilder node, boolean added)
focal_class.return: int
focal_class.signature: int getMaxCount(NodeBuilder node, boolean added)
focal_class.class_method_signature: ApproximateCounter.getCountSync(NodeState node)
focal_class.full_signature: public static long getCountSync(NodeState node)
focal_class.identifier: getCountSync
focal_class.modifiers: public static
focal_class.parameters: (NodeState node)
focal_class.return: long
focal_class.signature: long getCountSync(NodeState node)
focal_method.body: public static long adjustOffset(long oldCount, long calculatedOffset,
              int resolution) {
          if (oldCount + calculatedOffset < 0) {
              return -oldCount;
          }
          if (resolution <= 10 || oldCount < resolution * 10) {
              return calculatedOffset;
          }
          return RANDOM.nextInt(10) == 0 ? calculatedOffset * 10 : 0;
      }
focal_method.class_method_signature: ApproximateCounter.adjustOffset(long oldCount, long calculatedOffset,
              int resolution)
focal_method.full_signature: public static long adjustOffset(long oldCount, long calculatedOffset,
              int resolution)
focal_method.identifier: adjustOffset
focal_method.invocations: nextInt
focal_method.modifiers: public static
focal_method.parameters: (long oldCount, long calculatedOffset,
              int resolution)
focal_method.return: long
focal_method.signature: long adjustOffset(long oldCount, long calculatedOffset,
              int resolution)