@Override protected void removeAndAdd(long index) { final long id = id(index, -1); assert id >= 0; final int code = hashes.get(id); reset(code, id); }
private long set(BytesRef key, int code, long id) { assert rehash(key.hashCode()) == code; assert size < maxSize; final long slot = slot(code, mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key, code); ++size; return id; } else if (key.bytesEquals(get(curId, spare))) { return -1 - curId; } } }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }
@Override protected void removeAndAdd(long index) { final long id = id(index, -1); assert id >= 0; final int code = hashes.get(id); reset(code, id); }
@Override protected void removeAndAdd(long index) { final long id = id(index, -1); assert id >= 0; final int code = hashes.get(id); reset(code, id); }
@Override protected void removeAndAdd(long index) { final long id = id(index, -1); assert id >= 0; final int code = hashes.get(id); reset(code, id); }
@Override protected void removeAndAdd(long index) { final long id = id(index, -1); assert id >= 0; final int code = hashes.get(id); reset(code, id); }
private long set(BytesRef key, int code, long id) { assert rehash(key.hashCode()) == code; assert size < maxSize; final long slot = slot(code, mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key, code); ++size; return id; } else if (key.bytesEquals(get(curId, spare))) { return -1 - curId; } } }
private long set(BytesRef key, int code, long id) { assert rehash(key.hashCode()) == code; assert size < maxSize; final long slot = slot(code, mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key, code); ++size; return id; } else if (key.bytesEquals(get(curId, spare))) { return -1 - curId; } } }
private long set(BytesRef key, int code, long id) { assert rehash(key.hashCode()) == code; assert size < maxSize; final long slot = slot(code, mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key, code); ++size; return id; } else if (key.bytesEquals(get(curId, spare))) { return -1 - curId; } } }
private long set(BytesRef key, int code, long id) { assert rehash(key.hashCode()) == code; assert size < maxSize; final long slot = slot(code, mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key, code); ++size; return id; } else if (key.bytesEquals(get(curId, spare))) { return -1 - curId; } } }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }