test_class.declarator: globalTimeout = new Timeout((int) GridTestUtils.DFLT_TEST_TIMEOUT)
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public Timeout globalTimeout = new Timeout((int) GridTestUtils.DFLT_TEST_TIMEOUT);
test_class.type: Timeout
test_class.var_name: globalTimeout
test_class.file: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/RobinHoodBackwardShiftHashMapTest.java
test_class.identifier: RobinHoodBackwardShiftHashMapTest
test_case.body: @Test
      public void testPutRemoveOnSamePlaces() throws Exception {
          withMap(map -> {
                  doAddRemove(map);
  
                  //fill with 1 space left;
                  for (int i = 0; i < 99; i++) {
                      int grpId = i + 1;
                      int val = grpId * grpId;
                      assertSizeChanged("Unique put should be successful " + grpId, map,
                          () -> map.put(grpId, 1, val, 1));
                  }
  
                  doAddRemove(map);
              }, 100);
      }
test_case.class_method_signature: RobinHoodBackwardShiftHashMapTest.testPutRemoveOnSamePlaces()
test_case.full_signature: @Test public void testPutRemoveOnSamePlaces()
test_case.identifier: testPutRemoveOnSamePlaces
test_case.invocations: withMap doAddRemove assertSizeChanged put doAddRemove
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPutRemoveOnSamePlaces()
focal_class.declarator: LOAD_FACTOR = getFloat(IGNITE_LONG_LONG_HASH_MAP_LOAD_FACTOR, 2.5f)
focal_class.modifier: private static final
focal_class.original_string: private static final float LOAD_FACTOR = getFloat(IGNITE_LONG_LONG_HASH_MAP_LOAD_FACTOR, 2.5f);
focal_class.type: float
focal_class.var_name: LOAD_FACTOR
focal_class.declarator: MAPSIZE_SIZE = 4
focal_class.modifier: private static final
focal_class.original_string: private static final int MAPSIZE_SIZE = 4;
focal_class.type: int
focal_class.var_name: MAPSIZE_SIZE
focal_class.declarator: CELL_PADDING = 4
focal_class.modifier: private static final
focal_class.original_string: private static final int CELL_PADDING = 4;
focal_class.type: int
focal_class.var_name: CELL_PADDING
focal_class.declarator: MAPSIZE_PADDING = 4
focal_class.modifier: private static final
focal_class.original_string: private static final int MAPSIZE_PADDING = 4;
focal_class.type: int
focal_class.var_name: MAPSIZE_PADDING
focal_class.declarator: MAPSIZE_OFFSET = 0
focal_class.modifier: private static final
focal_class.original_string: private static final int MAPSIZE_OFFSET = 0;
focal_class.type: int
focal_class.var_name: MAPSIZE_OFFSET
focal_class.declarator: IDEAL_BUCKET_SIZE = 4
focal_class.modifier: private static final
focal_class.original_string: private static final int IDEAL_BUCKET_SIZE = 4;
focal_class.type: int
focal_class.var_name: IDEAL_BUCKET_SIZE
focal_class.declarator: IDEAL_BUCKET_OFFSET = 0
focal_class.modifier: private static final
focal_class.original_string: private static final int IDEAL_BUCKET_OFFSET = 0;
focal_class.type: int
focal_class.var_name: IDEAL_BUCKET_OFFSET
focal_class.declarator: GRP_ID_SIZE = 4
focal_class.modifier: private static final
focal_class.original_string: private static final int GRP_ID_SIZE = 4;
focal_class.type: int
focal_class.var_name: GRP_ID_SIZE
focal_class.declarator: GRP_ID_OFFSET = IDEAL_BUCKET_OFFSET + IDEAL_BUCKET_SIZE
focal_class.modifier: private static final
focal_class.original_string: private static final int GRP_ID_OFFSET = IDEAL_BUCKET_OFFSET + IDEAL_BUCKET_SIZE;
focal_class.type: int
focal_class.var_name: GRP_ID_OFFSET
focal_class.declarator: PAGE_ID_SIZE = 8
focal_class.modifier: private static final
focal_class.original_string: private static final int PAGE_ID_SIZE = 8;
focal_class.type: int
focal_class.var_name: PAGE_ID_SIZE
focal_class.declarator: PAGE_ID_OFFSET = GRP_ID_OFFSET + GRP_ID_SIZE
focal_class.modifier: private static final
focal_class.original_string: private static final int PAGE_ID_OFFSET = GRP_ID_OFFSET + GRP_ID_SIZE;
focal_class.type: int
focal_class.var_name: PAGE_ID_OFFSET
focal_class.declarator: VALUE_SIZE = 8
focal_class.modifier: private static final
focal_class.original_string: private static final int VALUE_SIZE = 8;
focal_class.type: int
focal_class.var_name: VALUE_SIZE
focal_class.declarator: VALUE_OFFSET = PAGE_ID_OFFSET + PAGE_ID_SIZE
focal_class.modifier: private static final
focal_class.original_string: private static final int VALUE_OFFSET = PAGE_ID_OFFSET + PAGE_ID_SIZE;
focal_class.type: int
focal_class.var_name: VALUE_OFFSET
focal_class.declarator: VERSION_SIZE = 4
focal_class.modifier: private static final
focal_class.original_string: private static final int VERSION_SIZE = 4;
focal_class.type: int
focal_class.var_name: VERSION_SIZE
focal_class.declarator: VERSION_OFFSET = VALUE_OFFSET + VALUE_SIZE
focal_class.modifier: private static final
focal_class.original_string: private static final int VERSION_OFFSET = VALUE_OFFSET + VALUE_SIZE;
focal_class.type: int
focal_class.var_name: VERSION_OFFSET
focal_class.declarator: EMPTY_PAGE_ID = 0
focal_class.modifier: private static final
focal_class.original_string: private static final long EMPTY_PAGE_ID = 0;
focal_class.type: long
focal_class.var_name: EMPTY_PAGE_ID
focal_class.declarator: EMPTY_CACHE_GRP_ID = 0
focal_class.modifier: private static final
focal_class.original_string: private static final int EMPTY_CACHE_GRP_ID = 0;
focal_class.type: int
focal_class.var_name: EMPTY_CACHE_GRP_ID
focal_class.declarator: BYTES_PER_CELL = IDEAL_BUCKET_SIZE
          + GRP_ID_SIZE + PAGE_ID_SIZE
          + VALUE_SIZE + VERSION_SIZE
          + CELL_PADDING
focal_class.modifier: private static final
focal_class.original_string: private static final int BYTES_PER_CELL = IDEAL_BUCKET_SIZE
          + GRP_ID_SIZE + PAGE_ID_SIZE
          + VALUE_SIZE + VERSION_SIZE
          + CELL_PADDING;
focal_class.type: int
focal_class.var_name: BYTES_PER_CELL
focal_class.declarator: numBuckets
focal_class.modifier: private final
focal_class.original_string: private final int numBuckets;
focal_class.type: int
focal_class.var_name: numBuckets
focal_class.declarator: baseAddr
focal_class.modifier: private
focal_class.original_string: private long baseAddr;
focal_class.type: long
focal_class.var_name: baseAddr
focal_class.file: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/RobinHoodBackwardShiftHashMap.java
focal_class.identifier: RobinHoodBackwardShiftHashMap
focal_class.interfaces: implements LoadedPagesMap
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.requiredMemory(long elementsCnt)
focal_class.full_signature: public static long requiredMemory(long elementsCnt)
focal_class.identifier: requiredMemory
focal_class.modifiers: public static
focal_class.parameters: (long elementsCnt)
focal_class.return: long
focal_class.signature: long requiredMemory(long elementsCnt)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.requiredMemoryByBuckets(long numBuckets)
focal_class.full_signature: static long requiredMemoryByBuckets(long numBuckets)
focal_class.identifier: requiredMemoryByBuckets
focal_class.modifiers: static
focal_class.parameters: (long numBuckets)
focal_class.return: long
focal_class.signature: long requiredMemoryByBuckets(long numBuckets)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.RobinHoodBackwardShiftHashMap(long baseAddr, long size)
focal_class.full_signature: public  RobinHoodBackwardShiftHashMap(long baseAddr, long size)
focal_class.identifier: RobinHoodBackwardShiftHashMap
focal_class.modifiers: public
focal_class.parameters: (long baseAddr, long size)
focal_class.signature:  RobinHoodBackwardShiftHashMap(long baseAddr, long size)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.entryBase(int idx)
focal_class.full_signature: private long entryBase(int idx)
focal_class.identifier: entryBase
focal_class.modifiers: private
focal_class.parameters: (int idx)
focal_class.return: long
focal_class.signature: long entryBase(int idx)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.get(int grpId, long pageId, int reqVer, long absent, long outdated)
focal_class.full_signature: @Override public long get(int grpId, long pageId, int reqVer, long absent, long outdated)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (int grpId, long pageId, int reqVer, long absent, long outdated)
focal_class.return: long
focal_class.signature: long get(int grpId, long pageId, int reqVer, long absent, long outdated)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.put(int grpId, long pageId, long val, int ver)
focal_class.full_signature: @Override public void put(int grpId, long pageId, long val, int ver)
focal_class.identifier: put
focal_class.modifiers: @Override public
focal_class.parameters: (int grpId, long pageId, long val, int ver)
focal_class.return: void
focal_class.signature: void put(int grpId, long pageId, long val, int ver)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.remove(int grpId, long pageId)
focal_class.full_signature: @Override public boolean remove(int grpId, long pageId)
focal_class.identifier: remove
focal_class.modifiers: @Override public
focal_class.parameters: (int grpId, long pageId)
focal_class.return: boolean
focal_class.signature: boolean remove(int grpId, long pageId)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.doBackwardShift(int idxRmv)
focal_class.full_signature: private void doBackwardShift(int idxRmv)
focal_class.identifier: doBackwardShift
focal_class.modifiers: private
focal_class.parameters: (int idxRmv)
focal_class.return: void
focal_class.signature: void doBackwardShift(int idxRmv)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.getNearestAt(final int idxStart)
focal_class.full_signature: @Override public ReplaceCandidate getNearestAt(final int idxStart)
focal_class.identifier: getNearestAt
focal_class.modifiers: @Override public
focal_class.parameters: (final int idxStart)
focal_class.return: ReplaceCandidate
focal_class.signature: ReplaceCandidate getNearestAt(final int idxStart)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.isEmptyAt(int idx)
focal_class.full_signature: private boolean isEmptyAt(int idx)
focal_class.identifier: isEmptyAt
focal_class.modifiers: private
focal_class.parameters: (int idx)
focal_class.return: boolean
focal_class.signature: boolean isEmptyAt(int idx)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.refresh(int grpId, long pageId, int ver)
focal_class.full_signature: @Override public long refresh(int grpId, long pageId, int ver)
focal_class.identifier: refresh
focal_class.modifiers: @Override public
focal_class.parameters: (int grpId, long pageId, int ver)
focal_class.return: long
focal_class.signature: long refresh(int grpId, long pageId, int ver)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.removeIf(int startIdxToClear, int endIdxToClear, KeyPredicate keyPred)
focal_class.full_signature: @Override public GridLongList removeIf(int startIdxToClear, int endIdxToClear, KeyPredicate keyPred)
focal_class.identifier: removeIf
focal_class.modifiers: @Override public
focal_class.parameters: (int startIdxToClear, int endIdxToClear, KeyPredicate keyPred)
focal_class.return: GridLongList
focal_class.signature: GridLongList removeIf(int startIdxToClear, int endIdxToClear, KeyPredicate keyPred)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.capacity()
focal_class.full_signature: @Override public int capacity()
focal_class.identifier: capacity
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int capacity()
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.distance(int curr, int baseIdx)
focal_class.full_signature: private int distance(int curr, int baseIdx)
focal_class.identifier: distance
focal_class.modifiers: private
focal_class.parameters: (int curr, int baseIdx)
focal_class.return: int
focal_class.signature: int distance(int curr, int baseIdx)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.isEmpty(int grpId, long pageId)
focal_class.full_signature: private boolean isEmpty(int grpId, long pageId)
focal_class.identifier: isEmpty
focal_class.modifiers: private
focal_class.parameters: (int grpId, long pageId)
focal_class.return: boolean
focal_class.signature: boolean isEmpty(int grpId, long pageId)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.setEmpty(long addr)
focal_class.full_signature: private void setEmpty(long addr)
focal_class.identifier: setEmpty
focal_class.modifiers: private
focal_class.parameters: (long addr)
focal_class.return: void
focal_class.signature: void setEmpty(long addr)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.setIdealBucket(long base, int idxIdeal)
focal_class.full_signature: private void setIdealBucket(long base, int idxIdeal)
focal_class.identifier: setIdealBucket
focal_class.modifiers: private
focal_class.parameters: (long base, int idxIdeal)
focal_class.return: void
focal_class.signature: void setIdealBucket(long base, int idxIdeal)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.dump()
focal_class.full_signature: public String dump()
focal_class.identifier: dump
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String dump()
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.dumpEntry(int idx)
focal_class.full_signature: private String dumpEntry(int idx)
focal_class.identifier: dumpEntry
focal_class.modifiers: private
focal_class.parameters: (int idx)
focal_class.return: String
focal_class.signature: String dumpEntry(int idx)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.dumpEntry(StringBuilder sb, int idx)
focal_class.full_signature: private void dumpEntry(StringBuilder sb, int idx)
focal_class.identifier: dumpEntry
focal_class.modifiers: private
focal_class.parameters: (StringBuilder sb, int idx)
focal_class.return: void
focal_class.signature: void dumpEntry(StringBuilder sb, int idx)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.setCellValue(long base, int idealBucket, int grpId, long pageId, long val, int ver)
focal_class.full_signature: private void setCellValue(long base, int idealBucket, int grpId, long pageId, long val, int ver)
focal_class.identifier: setCellValue
focal_class.modifiers: private
focal_class.parameters: (long base, int idealBucket, int grpId, long pageId, long val, int ver)
focal_class.return: void
focal_class.signature: void setCellValue(long base, int idealBucket, int grpId, long pageId, long val, int ver)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.getIdealBucket(long base)
focal_class.full_signature: private int getIdealBucket(long base)
focal_class.identifier: getIdealBucket
focal_class.modifiers: private
focal_class.parameters: (long base)
focal_class.return: int
focal_class.signature: int getIdealBucket(long base)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.getPageId(long base)
focal_class.full_signature: private long getPageId(long base)
focal_class.identifier: getPageId
focal_class.modifiers: private
focal_class.parameters: (long base)
focal_class.return: long
focal_class.signature: long getPageId(long base)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.setPageId(long base, long pageId)
focal_class.full_signature: private void setPageId(long base, long pageId)
focal_class.identifier: setPageId
focal_class.modifiers: private
focal_class.parameters: (long base, long pageId)
focal_class.return: void
focal_class.signature: void setPageId(long base, long pageId)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.getGrpId(long base)
focal_class.full_signature: private int getGrpId(long base)
focal_class.identifier: getGrpId
focal_class.modifiers: private
focal_class.parameters: (long base)
focal_class.return: int
focal_class.signature: int getGrpId(long base)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.setGrpId(long base, int grpId)
focal_class.full_signature: private void setGrpId(long base, int grpId)
focal_class.identifier: setGrpId
focal_class.modifiers: private
focal_class.parameters: (long base, int grpId)
focal_class.return: void
focal_class.signature: void setGrpId(long base, int grpId)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.getValue(long base)
focal_class.full_signature: private long getValue(long base)
focal_class.identifier: getValue
focal_class.modifiers: private
focal_class.parameters: (long base)
focal_class.return: long
focal_class.signature: long getValue(long base)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.setValue(long base, long val)
focal_class.full_signature: private void setValue(long base, long val)
focal_class.identifier: setValue
focal_class.modifiers: private
focal_class.parameters: (long base, long val)
focal_class.return: void
focal_class.signature: void setValue(long base, long val)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.getVersion(long base)
focal_class.full_signature: private int getVersion(long base)
focal_class.identifier: getVersion
focal_class.modifiers: private
focal_class.parameters: (long base)
focal_class.return: int
focal_class.signature: int getVersion(long base)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.setVersion(long base, int ver)
focal_class.full_signature: private void setVersion(long base, int ver)
focal_class.identifier: setVersion
focal_class.modifiers: private
focal_class.parameters: (long base, int ver)
focal_class.return: void
focal_class.signature: void setVersion(long base, int ver)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.size()
focal_class.full_signature: @Override public final int size()
focal_class.identifier: size
focal_class.modifiers: @Override public final
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int size()
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.setSize(int sz)
focal_class.full_signature: private void setSize(int sz)
focal_class.identifier: setSize
focal_class.modifiers: private
focal_class.parameters: (int sz)
focal_class.return: void
focal_class.signature: void setSize(int sz)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.forEach(BiConsumer<FullPageId, Long> act)
focal_class.full_signature: @Override public void forEach(BiConsumer<FullPageId, Long> act)
focal_class.identifier: forEach
focal_class.modifiers: @Override public
focal_class.parameters: (BiConsumer<FullPageId, Long> act)
focal_class.return: void
focal_class.signature: void forEach(BiConsumer<FullPageId, Long> act)
focal_class.class_method_signature: RobinHoodBackwardShiftHashMap.getFullPageId(long base)
focal_class.full_signature: @NotNull private FullPageId getFullPageId(long base)
focal_class.identifier: getFullPageId
focal_class.modifiers: @NotNull private
focal_class.parameters: (long base)
focal_class.return: FullPageId
focal_class.signature: FullPageId getFullPageId(long base)
focal_method.body: @Override public void put(int grpId, long pageId, long val, int ver) {
          assert grpId != 0;
  
          // initial index is also ideal for inserted element
          int idxInit = U.safeAbs(FullPageId.hashCode(grpId, pageId)) % numBuckets;
  
          int swapCnt = 0;
  
          int grpIdToInsert = grpId;
          long pageIdToInsert = pageId;
          long valToInsert = val;
          int verToInsert = ver;
          int idxIdealToInsert = idxInit;
  
          for (int i = 0; i < numBuckets; i++) {
              int idxCurr = (idxInit + i) % numBuckets;
  
              final long base = entryBase(idxCurr);
              final int dibEntryToInsert = distance(idxCurr, idxInit);
  
              final int curGrpId = getGrpId(base);
              final long curPageId = getPageId(base);
              final int curIdealBucket = getIdealBucket(base);
              final long curVal = getValue(base);
              final int curVer = getVersion(base);
              final int dibCurEntry = distance(idxCurr, curIdealBucket);
  
              if (isEmpty(curGrpId, curPageId)) {
                  setCellValue(base, idxIdealToInsert, grpIdToInsert, pageIdToInsert, valToInsert, verToInsert);
  
                  setSize(size() + 1);
  
                  return;
              }
              else if (curGrpId == grpIdToInsert && curPageId == pageIdToInsert) {
                  if (swapCnt != 0)
                      throw new IllegalStateException("Swapped " + swapCnt + " times. Entry: " + dumpEntry(idxCurr));
  
                  setValue(base, valToInsert);
  
                  return; //equal value found
              }
              else if (dibCurEntry < dibEntryToInsert) {
                  //swapping *toInsert and state in bucket: save cur state to bucket
                  setCellValue(base, idxIdealToInsert, grpIdToInsert, pageIdToInsert, valToInsert, verToInsert);
  
                  idxIdealToInsert = curIdealBucket;
                  pageIdToInsert = curPageId;
                  grpIdToInsert = curGrpId;
                  valToInsert = curVal;
                  verToInsert = curVer;
  
                  swapCnt++;
              }
          }
  
          // no free space left
          throw new IgniteOutOfMemoryException("No room for a new key");
      }
focal_method.class_method_signature: RobinHoodBackwardShiftHashMap.put(int grpId, long pageId, long val, int ver)
focal_method.full_signature: @Override public void put(int grpId, long pageId, long val, int ver)
focal_method.identifier: put
focal_method.invocations: safeAbs hashCode entryBase distance getGrpId getPageId getIdealBucket getValue getVersion distance isEmpty setCellValue setSize size dumpEntry setValue setCellValue
focal_method.modifiers: @Override public
focal_method.parameters: (int grpId, long pageId, long val, int ver)
focal_method.return: void
focal_method.signature: void put(int grpId, long pageId, long val, int ver)