/** * returns zero if the value is not found otherwise it returns the value. * If zero was set as the value there is no way to tell the difference without calling hasItem * @param ht * @param key */ public static int getItem(IntHashTable ht, int key) { int hash = MurmurHash.hash32finalizer(key); return (int)(scanForItem(key, ht.mask, hash, ht.data, ht.data[hash & ht.mask]) >> 32); }
public static boolean hasItem(PipeHashTable ht, long key) { int mask = ht.mask; int hash = MurmurHash.hash64finalizer(key); long keyAtIdx = ht.keys[hash&mask]; while (keyAtIdx != key && keyAtIdx != 0) { keyAtIdx = ht.keys[++hash&mask]; } long value = ht.values[hash&mask]; return 0 != (value&((ht.lowerBounds-(1+value))>>63)); }
public static void visit(LongHashTable ht, LongHashTableVisitor visitor) { int j = ht.mask+1; while (--j>=0) { long key = ht.keys[j]; if (0!=key) { visitor.visit(key,ht.values[j]); } } }
@Override public void visit(long key, long value) { LongLongHashTable.setItem(result, key, value); } };
@Override public void visit(long key) { LongHashSet.setItem(result, key); } };
public static void visit(LongHashSet ht, LongHashSetVisitor visitor) { int j = ht.mask+1; while (--j>=0) { long key = ht.keys[j]; if (0!=key) { visitor.visit(key); } } }
public static void visit(PipeHashTable ht, PipeHashTableVisitor visitor) { int j = ht.mask+1; while (--j>=0) { long key = ht.keys[j]; if (0!=key) { long value = ht.values[j]; if (value >= ht.lowerBounds) { visitor.visit(key, value); } } } }
public static void visit(IntHashTable ht, IntHashTableVisitor visitor) { int j = ht.mask+1; while (--j >= 0) { long block = ht.data[j]; if (0!=block) { int key = (int)block; int value = (int)(block>>32); visitor.visit(key,value); } } }
public static boolean hasItem(IntHashTable ht, int key) { int mask = ht.mask; int hash = MurmurHash.hash32finalizer(key); long block = ht.data[hash & mask]; while (((int)block) != key && block != 0) { block = ht.data[++hash & mask]; } return 0!=block; }
public static long lookupSessionTimeoutNS(int sessionId) { long value = LongLongHashTable.getItem(timeoutHash, sessionId); if (0!=value) { return value; } else { return -1; } }
/** * returns zero if the value is not found otherwise it returns the value. * If zero was set as the value there is no way to tell the difference without calling hasItem * @param ht * @param key */ public static int getItem(IntHashTable ht, int key) { int hash = MurmurHash.hash32finalizer(key); return (int)(scanForItem(key, ht.mask, hash, ht.data, ht.data[hash & ht.mask]) >> 32); }
public static boolean hasItem(LongHashTable ht, long key) { int mask = ht.mask; long[] localKeys = ht.keys; int hash = MurmurHash.hash64finalizer(key); long keyAtIdx = localKeys[hash&mask]; while (keyAtIdx != key && keyAtIdx != 0) { keyAtIdx = localKeys[++hash&mask]; } return 0 != keyAtIdx; }
public static void visit(LongHashTable ht, LongHashTableVisitor visitor) { int j = ht.mask+1; while (--j>=0) { long key = ht.keys[j]; if (0!=key) { visitor.visit(key,ht.values[j]); } } }
/** * returns zero if the value is not found otherwise it returns the value. * If zero was set as the value there is no way to tell the difference without calling hasItem * @param ht * @param key */ public static int getItem(IntHashTable ht, int key) { int hash = MurmurHash.hash32finalizer(key); return (int)(scanForItem(key, ht.mask, hash, ht.data, ht.data[hash & ht.mask]) >> 32); }
public static int getItem(LongHashTable ht, long key) { int mask = ht.mask; long[] localKeys = ht.keys; int hash = MurmurHash.hash64finalizer(key); long keyAtIdx = localKeys[hash&mask]; while (keyAtIdx != key && keyAtIdx != 0) { keyAtIdx = localKeys[++hash&mask]; } return ht.values[hash&mask]; }
public static int getItem(LongHashTable ht, long key) { int mask = ht.mask; long[] localKeys = ht.keys; int hash = MurmurHash.hash64finalizer(key); long keyAtIdx = localKeys[hash&mask]; while (keyAtIdx != key && keyAtIdx != 0) { keyAtIdx = localKeys[++hash&mask]; } return ht.values[hash&mask]; }
public static boolean hasItem(LongHashSet ht, long key) { int mask = ht.mask; long[] localKeys = ht.keys; int hash = MurmurHash.hash64finalizer(key); long keyAtIdx = localKeys[hash&mask]; while (keyAtIdx != key && keyAtIdx != 0) { keyAtIdx = localKeys[++hash&mask]; } return 0 != keyAtIdx; }
public static boolean hasItem(LongHashTable ht, long key) { int mask = ht.mask; long[] localKeys = ht.keys; int hash = MurmurHash.hash64finalizer(key); long keyAtIdx = localKeys[hash&mask]; while (keyAtIdx != key && keyAtIdx != 0) { keyAtIdx = localKeys[++hash&mask]; } return 0 != keyAtIdx; }
public static boolean hasItem(PipeHashTable ht, long key) { int mask = ht.mask; int hash = MurmurHash.hash64finalizer(key); long keyAtIdx = ht.keys[hash&mask]; while (keyAtIdx != key && keyAtIdx != 0) { keyAtIdx = ht.keys[++hash&mask]; } long value = ht.values[hash&mask]; return 0 != (value&((ht.lowerBounds-(1+value))>>63)); }
public static long getItem(LongLongHashTable ht, long key) { int mask = ht.mask; long[] localKeys = ht.keys; int hash = MurmurHash.hash64finalizer(key); long keyAtIdx = localKeys[hash&mask]; while (keyAtIdx != key && keyAtIdx != 0) { keyAtIdx = localKeys[++hash&mask]; } return ht.values[hash&mask]; }