/** * Get a singleton instance of hash function of a given type. * @param type predefined hash type * @return hash function instance, or null if type is invalid */ public static Hash getInstance(int type) { switch(type) { case JENKINS_HASH: return JenkinsHash.getInstance(); case MURMUR_HASH: return MurmurHash.getInstance(); default: return null; } }
@Override public int hash(byte[] data, int length, int seed) { return hash(data, 0, length, seed); }
Hash murmur = MurmurHash.getInstance(); for (int i = 0; i < numcat; ++i) { ByteBuffer buf = ByteBuffer.allocate(4);
protected final int computeMurmurHash(HiveKey firstKey) { return hash.hash(firstKey.getBytes(), firstKey.getDistKeyLength(), 0); }
/** * Get a singleton instance of hash function of a given type. * @param type predefined hash type * @return hash function instance, or null if type is invalid */ public static Hash getInstance(int type) { switch(type) { case JENKINS_HASH: return JenkinsHash.getInstance(); case MURMUR_HASH: return MurmurHash.getInstance(); default: return null; } }
@Override public int hash(byte[] data, int length, int seed) { return hash(data, 0, length, seed); }
/** * Get a singleton instance of hash function of a given type. * @param type predefined hash type * @return hash function instance, or null if type is invalid */ public static Hash getInstance(int type) { switch(type) { case JENKINS_HASH: return JenkinsHash.getInstance(); case MURMUR_HASH: return MurmurHash.getInstance(); default: return null; } }
protected final int computeMurmurHash(HiveKey firstKey) { return hash.hash(firstKey.getBytes(), firstKey.getDistKeyLength(), 0); }
/** * Get a singleton instance of hash function of a given type. * @param type predefined hash type * @return hash function instance, or null if type is invalid */ public static Hash getInstance(int type) { switch(type) { case JENKINS_HASH: return JenkinsHash.getInstance(); case MURMUR_HASH: return MurmurHash.getInstance(); default: return null; } }
/** * Get a singleton instance of hash function of a given type. * @param type predefined hash type * @return hash function instance, or null if type is invalid */ public static Hash getInstance(int type) { switch(type) { case JENKINS_HASH: return JenkinsHash.getInstance(); case MURMUR_HASH: return MurmurHash.getInstance(); default: return null; } }
/** * Get a singleton instance of hash function of a given type. * @param type predefined hash type * @return hash function instance, or null if type is invalid */ public static Hash getInstance(int type) { switch(type) { case JENKINS_HASH: return JenkinsHash.getInstance(); case MURMUR_HASH: return MurmurHash.getInstance(); default: return null; } }
assertTrue("testHash", MurmurHash.getInstance() == Hash.getInstance(cfg)); MurmurHash.getInstance() == Hash.getInstance(cfg)); MurmurHash.getInstance() == Hash.getInstance(Hash.MURMUR_HASH));
assertTrue("testHash", MurmurHash.getInstance() == Hash.getInstance(cfg)); MurmurHash.getInstance() == Hash.getInstance(cfg)); MurmurHash.getInstance() == Hash.getInstance(Hash.MURMUR_HASH));