Fixed RobinHoodBackwardShiftHashMap bug on big endian architectures
@@ -201,7 +201,7 @@ public class RobinHoodBackwardShiftHashMap implements LoadedPagesMap {
long pageIdToInsert = pageId;
long valToInsert = val;
int verToInsert = ver;
- long idxIdealToInsert = idxInit;
+ int idxIdealToInsert = idxInit;
for (int i = 0; i < numBuckets; i++) {
int idxCurr = (idxInit + i) % numBuckets;
@@ -478,10 +478,10 @@ public class RobinHoodBackwardShiftHashMap implements LoadedPagesMap {
* @param base Entry base, address in buffer of the entry start.
* @param idxIdeal number of ideal bucket (cell) to insert this value.
*/
- private void setIdealBucket(long base, long idxIdeal) {
+ private void setIdealBucket(long base, int idxIdeal) {
assert idxIdeal >= 0 && idxIdeal < numBuckets;
- putLong(base + IDEAL_BUCKET_OFFSET, idxIdeal);
+ putInt(base + IDEAL_BUCKET_OFFSET, idxIdeal);
}
/**
@@ -541,7 +541,7 @@ public class RobinHoodBackwardShiftHashMap implements LoadedPagesMap {
* @param val Entry value associated with key.
* @param ver Entry version.
*/
- private void setCellValue(long base, long idealBucket, int grpId, long pageId, long val, int ver) {
+ private void setCellValue(long base, int idealBucket, int grpId, long pageId, long val, int ver) {
setIdealBucket(base, idealBucket);
setGrpId(base, grpId);
setPageId(base, pageId);
