@Override public IBinaryHashFunction createBinaryHashFunction() { // Actual numeric type promotion happens in the createBinaryHashFunction() return AMurmurHash3BinaryHashFunctionFamily.INSTANCE.createBinaryHashFunction(0); } };
@Override public IBinaryHashFunction createBinaryHashFunction() { return new IBinaryHashFunction() { private IBinaryHashFunction genericBinaryHash = MurmurHash3BinaryHashFunctionFamily.INSTANCE.createBinaryHashFunction(0); @Override public int hash(byte[] bytes, int offset, int length) throws HyracksDataException { return genericBinaryHash.hash(bytes, offset, length); } }; } }
@Override public IBinaryHashFunction createBinaryHashFunction() { return MurmurHash3BinaryHashFunctionFamily.INSTANCE.createBinaryHashFunction(0); }
@Override public ITuplePartitionComputer createPartitioner(int seed) { final IBinaryHashFunction[] hashFunctions = new IBinaryHashFunction[hashFunctionGeneratorFactories.length]; for (int i = 0; i < hashFunctionGeneratorFactories.length; ++i) { hashFunctions[i] = hashFunctionGeneratorFactories[i].createBinaryHashFunction(seed); } return new ITuplePartitionComputer() { @Override public int partition(IFrameTupleAccessor accessor, int tIndex, int nParts) throws HyracksDataException { int h = 0; int startOffset = accessor.getTupleStartOffset(tIndex); int slotLength = accessor.getFieldSlotsLength(); for (int j = 0; j < hashFields.length; ++j) { int fIdx = hashFields[j]; IBinaryHashFunction hashFn = hashFunctions[j]; int fStart = accessor.getFieldStartOffset(tIndex, fIdx); int fEnd = accessor.getFieldEndOffset(tIndex, fIdx); int fh = hashFn.hash(accessor.getBuffer().array(), startOffset + slotLength + fStart, fEnd - fStart); h += fh; } if (h < 0) { h = -(h + 1); } return h % nParts; } }; } }
.createBinaryHashFunction(); private IBinaryHashFunction genericBinaryHash = MurmurHash3BinaryHashFunctionFamily.INSTANCE.createBinaryHashFunction(0); private GrowableArray taggedBytes = new GrowableArray();