@VisibleForTesting public int find(long key) { long h = hash(key); int step = 0; int idx = (int) h & (numBuckets - 1); while (step < maxSteps) { // Return bucket index if it's either an empty slot or already contains the key if (buckets[idx] == -1) { return idx; } else if (equals(idx, key)) { return idx; } idx = (idx + 1) & (numBuckets - 1); step++; } // Didn't find it return -1; }
public MutableColumnarRow findOrInsert(long key) { int idx = find(key); if (idx != -1 && buckets[idx] == -1) { columnVectors[0].putLong(numRows, key); columnVectors[1].putLong(numRows, 0); buckets[idx] = numRows++; } aggBufferRow.rowId = buckets[idx]; return aggBufferRow; }
public MutableColumnarRow findOrInsert(long key) { int idx = find(key); if (idx != -1 && buckets[idx] == -1) { columnVectors[0].putLong(numRows, key); columnVectors[1].putLong(numRows, 0); buckets[idx] = numRows++; } aggBufferRow.rowId = buckets[idx]; return aggBufferRow; }
@VisibleForTesting public int find(long key) { long h = hash(key); int step = 0; int idx = (int) h & (numBuckets - 1); while (step < maxSteps) { // Return bucket index if it's either an empty slot or already contains the key if (buckets[idx] == -1) { return idx; } else if (equals(idx, key)) { return idx; } idx = (idx + 1) & (numBuckets - 1); step++; } // Didn't find it return -1; }
public ColumnarBatch.Row findOrInsert(long key) { int idx = find(key); if (idx != -1 && buckets[idx] == -1) { batch.column(0).putLong(numRows, key); batch.column(1).putLong(numRows, 0); buckets[idx] = numRows++; } return batch.getRow(buckets[idx]); }
@VisibleForTesting public int find(long key) { long h = hash(key); int step = 0; int idx = (int) h & (numBuckets - 1); while (step < maxSteps) { // Return bucket index if it's either an empty slot or already contains the key if (buckets[idx] == -1) { return idx; } else if (equals(idx, key)) { return idx; } idx = (idx + 1) & (numBuckets - 1); step++; } // Didn't find it return -1; }
public ColumnarBatch.Row findOrInsert(long key) { int idx = find(key); if (idx != -1 && buckets[idx] == -1) { batch.column(0).putLong(numRows, key); batch.column(1).putLong(numRows, 0); buckets[idx] = numRows++; } return batch.getRow(buckets[idx]); }
@VisibleForTesting public int find(long key) { long h = hash(key); int step = 0; int idx = (int) h & (numBuckets - 1); while (step < maxSteps) { // Return bucket index if it's either an empty slot or already contains the key if (buckets[idx] == -1) { return idx; } else if (equals(idx, key)) { return idx; } idx = (idx + 1) & (numBuckets - 1); step++; } // Didn't find it return -1; }