@Override public void setHashKey() { hashcode = isNull0 ? nullHashcode : HashCodeUtil.calculateLongHashCode(longValue0); }
public static void calculateLongArrayHashCodes(long[] longs, int[] hashCodes, final int count) { for (int v = 0; v < count; v++) { hashCodes[v] = (int) calculateLongHashCode(longs[v]); } }
@Override public void setHashKey() { if (isNull0 || isNull1) { hashcode = (isNull0 && isNull1 ? twoNullHashcode : (isNull0 ? null0Hashcode ^ HashCodeUtil.calculateLongHashCode(longValue1) : HashCodeUtil.calculateLongHashCode(longValue0) ^ null1Hashcode)); } else { hashcode = HashCodeUtil.calculateTwoLongHashCode(longValue0, longValue1); } }
long hashCode = HashCodeUtil.calculateLongHashCode(tableKey); int intHashCode = (int) hashCode; int newSlot = intHashCode & newLogicalHashBucketMask;
long hashCode = HashCodeUtil.calculateLongHashCode(tableKey); int intHashCode = (int) hashCode; int newSlot = intHashCode & newLogicalHashBucketMask;
long hashCode = HashCodeUtil.calculateLongHashCode(key); int intHashCode = (int) hashCode; int slot = (intHashCode & logicalHashBucketMask);
long hashCode = HashCodeUtil.calculateLongHashCode(key); int intHashCode = (int) hashCode; int slot = (intHashCode & logicalHashBucketMask);
@Override public JoinResult contains(long key, VectorMapJoinHashSetResult hashSetResult) { VectorMapJoinFastHashSet.HashSetResult optimizedHashSetResult = (VectorMapJoinFastHashSet.HashSetResult) hashSetResult; optimizedHashSetResult.forget(); long hashCode = HashCodeUtil.calculateLongHashCode(key); long existance = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (existance == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashSetResult.setJoinResult(joinResult); return joinResult; }
@Override public JoinResult contains(long key, VectorMapJoinHashSetResult hashSetResult) { VectorMapJoinFastHashSet.HashSetResult optimizedHashSetResult = (VectorMapJoinFastHashSet.HashSetResult) hashSetResult; optimizedHashSetResult.forget(); long hashCode = HashCodeUtil.calculateLongHashCode(key); int pairIndex = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (pairIndex == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { /* * NOTE: Support for trackMatched not needed yet for Set. if (matchTracker != null) { matchTracker.trackMatch(pairIndex / 2); } */ joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashSetResult.setJoinResult(joinResult); return joinResult; }
@Override public JoinUtil.JoinResult lookup(long key, VectorMapJoinHashMapResult hashMapResult) { VectorMapJoinFastValueStore.HashMapResult optimizedHashMapResult = (VectorMapJoinFastValueStore.HashMapResult) hashMapResult; optimizedHashMapResult.forget(); long hashCode = HashCodeUtil.calculateLongHashCode(key); int pairIndex = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (pairIndex == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { optimizedHashMapResult.set(valueStore, slotPairs[pairIndex]); joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashMapResult.setJoinResult(joinResult); return joinResult; }
@Override public JoinUtil.JoinResult contains(long key, VectorMapJoinHashMultiSetResult hashMultiSetResult) { VectorMapJoinFastHashMultiSet.HashMultiSetResult optimizedHashMultiSetResult = (VectorMapJoinFastHashMultiSet.HashMultiSetResult) hashMultiSetResult; optimizedHashMultiSetResult.forget(); long hashCode = HashCodeUtil.calculateLongHashCode(key); long count = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (count == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { optimizedHashMultiSetResult.set(count); joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashMultiSetResult.setJoinResult(joinResult); return joinResult; }
@Override public JoinUtil.JoinResult contains(long key, VectorMapJoinHashMultiSetResult hashMultiSetResult) { VectorMapJoinFastHashMultiSet.HashMultiSetResult optimizedHashMultiSetResult = (VectorMapJoinFastHashMultiSet.HashMultiSetResult) hashMultiSetResult; optimizedHashMultiSetResult.forget(); long hashCode = HashCodeUtil.calculateLongHashCode(key); int pairIndex = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (pairIndex == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { /* * NOTE: Support for trackMatched not needed yet for Set. if (matchTracker != null) { matchTracker.trackMatch(pairIndex / 2); } */ optimizedHashMultiSetResult.set(slotPairs[pairIndex]); joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashMultiSetResult.setJoinResult(joinResult); return joinResult; }
@Override public JoinUtil.JoinResult lookup(long key, VectorMapJoinHashMapResult hashMapResult) { VectorMapJoinFastValueStore.HashMapResult optimizedHashMapResult = (VectorMapJoinFastValueStore.HashMapResult) hashMapResult; optimizedHashMapResult.forget(); long hashCode = HashCodeUtil.calculateLongHashCode(key); // LOG.debug("VectorMapJoinFastLongHashMap lookup " + key + " hashCode " + hashCode); long valueRef = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (valueRef == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { optimizedHashMapResult.set(valueStore, valueRef); joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashMapResult.setJoinResult(joinResult); return joinResult; }
@Override public JoinUtil.JoinResult lookup(long key, VectorMapJoinHashMapResult hashMapResult, MatchTracker matchTracker) { VectorMapJoinFastValueStore.HashMapResult optimizedHashMapResult = (VectorMapJoinFastValueStore.HashMapResult) hashMapResult; optimizedHashMapResult.forget(); long hashCode = HashCodeUtil.calculateLongHashCode(key); int pairIndex = findReadSlot(key, hashCode); JoinUtil.JoinResult joinResult; if (pairIndex == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { if (matchTracker != null) { matchTracker.trackMatch(pairIndex / 2); } optimizedHashMapResult.set(valueStore, slotPairs[pairIndex]); joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashMapResult.setJoinResult(joinResult); return joinResult; }
public static void calculateLongArrayHashCodes(long[] longs, int[] hashCodes, final int count) { for (int v = 0; v < count; v++) { hashCodes[v] = (int) calculateLongHashCode(longs[v]); } }