@Override public long getEstimatedMemorySize() { return super.getEstimatedMemorySize(); } }
public void verify(VectorMapJoinFastBytesHashSet map) { int mapSize = map.size(); if (mapSize != count) { TestCase.fail("map.size() does not match expected count"); } for (int index = 0; index < count; index++) { FastBytesHashSetElement element = array[index]; byte[] key = element.getKey(); VectorMapJoinHashSetResult hashSetResult = map.createHashSetResult(); JoinUtil.JoinResult joinResult = map.contains(key, 0, key.length, hashSetResult); if (joinResult != JoinUtil.JoinResult.MATCH) { assertTrue(false); } } } }
@Override public JoinUtil.JoinResult contains(byte[] keyBytes, int keyStart, int keyLength, VectorMapJoinHashSetResult hashSetResult) { VectorMapJoinFastHashSet.HashSetResult optimizedHashSetResult = (VectorMapJoinFastHashSet.HashSetResult) hashSetResult; optimizedHashSetResult.forget(); long hashCode = HashCodeUtil.murmurHash(keyBytes, keyStart, keyLength); long existance = findReadSlot(keyBytes, keyStart, keyLength, hashCode, hashSetResult.getReadPos()); JoinUtil.JoinResult joinResult; if (existance == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashSetResult.setJoinResult(joinResult); return joinResult; }
@Override public JoinUtil.JoinResult contains(byte[] keyBytes, int keyStart, int keyLength, VectorMapJoinHashSetResult hashSetResult) { VectorMapJoinFastBytesHashSetStore.HashSetResult fastHashSetResult = (VectorMapJoinFastBytesHashSetStore.HashSetResult) hashSetResult; fastHashSetResult.forget(); long hashCode = HashCodeUtil.murmurHash(keyBytes, keyStart, keyLength); doHashSetContains( keyBytes, keyStart, keyLength, hashCode, fastHashSetResult); return fastHashSetResult.joinResult(); }
public void add(byte[] keyBytes, int keyStart, int keyLength, BytesWritable currentValue) { expandAndRehash();
@Override public JoinUtil.JoinResult contains(byte[] keyBytes, int keyStart, int keyLength, VectorMapJoinHashSetResult hashSetResult) { VectorMapJoinFastHashSet.HashSetResult optimizedHashSetResult = (VectorMapJoinFastHashSet.HashSetResult) hashSetResult; optimizedHashSetResult.forget(); long hashCode = VectorMapJoinFastBytesHashUtil.hashKey(keyBytes, keyStart, keyLength); long existance = findReadSlot(keyBytes, keyStart, keyLength, hashCode); JoinUtil.JoinResult joinResult; if (existance == -1) { joinResult = JoinUtil.JoinResult.NOMATCH; } else { joinResult = JoinUtil.JoinResult.MATCH; } optimizedHashSetResult.setJoinResult(joinResult); return joinResult; }
@Override public long getEstimatedMemorySize() { // adding 16KB constant memory for stringCommon as the rabit hole is deep to implement // MemoryEstimate interface, also it is constant overhead long size = (16 * 1024L); return super.getEstimatedMemorySize() + size; } }