/** * Resets the pool to its initial state reusing the first buffer and fills all * buffers with <tt>0</tt> bytes before they reused or passed to * {@link Allocator#recycleByteBlocks(byte[][], int, int)}. Calling * {@link ByteBlockPool#nextBuffer()} is not needed after reset. */ public void reset() { reset(true, true); }
/** * Clears this {@link BytesRefArray} */ @Override public void clear() { lastElement = 0; currentOffset = 0; // TODO: it's trappy that this does not return storage held by int[] offsets array! Arrays.fill(offsets, 0); pool.reset(false, true); // no need to 0 fill the buffers we control the allocator }
void reset() { // we don't reuse so we drop everything and don't fill with 0 intPool.reset(false, false); bytePool.reset(false, false); }
/** * Clears the {@link BytesRef} which maps to the given {@link BytesRef} */ public void clear(boolean resetPool) { lastCount = count; count = 0; if (resetPool) { pool.reset(false, false); // we don't need to 0-fill the buffers } bytesStart = bytesStartArray.clear(); if (lastCount != -1 && shrink(lastCount)) { // shrink clears the hash entries return; } Arrays.fill(ids, -1); }
/** * Resets the pool to its initial state reusing the first buffer and fills all * buffers with <tt>0</tt> bytes before they reused or passed to * {@link Allocator#recycleByteBlocks(byte[][], int, int)}. Calling * {@link ByteBlockPool#nextBuffer()} is not needed after reset. */ public void reset() { reset(true, true); }
/** * Resets the pool to its initial state reusing the first buffer and fills all * buffers with <tt>0</tt> bytes before they reused or passed to * {@link Allocator#recycleByteBlocks(byte[][], int, int)}. Calling * {@link ByteBlockPool#nextBuffer()} is not needed after reset. */ public void reset() { reset(true, true); }
/** * Resets the pool to its initial state reusing the first buffer and fills all * buffers with <tt>0</tt> bytes before they reused or passed to * {@link Allocator#recycleByteBlocks(byte[][], int, int)}. Calling * {@link ByteBlockPool#nextBuffer()} is not needed after reset. */ public void reset() { reset(true, true); }
/** * Clears this {@link BytesRefArray} */ public void clear() { lastElement = 0; currentOffset = 0; Arrays.fill(offsets, 0); pool.reset(false, true); // no need to 0 fill the buffers we control the allocator }
/** * Clears this {@link BytesRefList} */ public void clear() { lastElement = 0; currentOffset = 0; Arrays.fill(offsets, 0); pool.reset(); }
/** * Clears this {@link BytesRefArray} */ @Override public void clear() { lastElement = 0; currentOffset = 0; // TODO: it's trappy that this does not return storage held by int[] offsets array! Arrays.fill(offsets, 0); pool.reset(false, true); // no need to 0 fill the buffers we control the allocator }
/** * Clears this {@link BytesRefArray} */ public void clear() { lastElement = 0; currentOffset = 0; Arrays.fill(offsets, 0); pool.reset(false, true); // no need to 0 fill the buffers we control the allocator }
void reset() { // we don't reuse so we drop everything and don't fill with 0 intPool.reset(false, false); bytePool.reset(false, false); }
void reset() { // we don't reuse so we drop everything and don't fill with 0 intPool.reset(false, false); bytePool.reset(false, false); }
void reset() { // we don't reuse so we drop everything and don't fill with 0 intPool.reset(false, false); bytePool.reset(false, false); }
/** * Clears the {@link BytesRef} which maps to the given {@link BytesRef} */ public void clear(boolean resetPool) { lastCount = count; count = 0; if (resetPool) { pool.reset(false, false); // we don't need to 0-fill the buffers } bytesStart = bytesStartArray.clear(); if (lastCount != -1 && shrink(lastCount)) { // shrink clears the hash entries return; } Arrays.fill(ids, -1); }
/** * Clears the {@link BytesRef} which maps to the given {@link BytesRef} */ public void clear(boolean resetPool) { lastCount = count; count = 0; if (resetPool) { pool.reset(false, false); // we don't need to 0-fill the buffers } bytesStart = bytesStartArray.clear(); if (lastCount != -1 && shrink(lastCount)) { // shrink clears the hash entries return; } Arrays.fill(ids, -1); }
/** * Clears the {@link BytesRef} which maps to the given {@link BytesRef} */ public void clear(boolean resetPool) { lastCount = count; count = 0; if (resetPool) { pool.reset(false, false); // we don't need to 0-fill the buffers } bytesStart = bytesStartArray.clear(); if (lastCount != -1 && shrink(lastCount)) { // shrink clears the hash entries return; } Arrays.fill(ids, -1); }
/** * Resets the {@link MemoryIndex} to its initial state and recycles all internal buffers. */ public void reset() { fields.clear(); this.normSimilarity = IndexSearcher.getDefaultSimilarity(); byteBlockPool.reset(false, false); // no need to 0-fill the buffers intBlockPool.reset(true, false); // here must must 0-fill since we use slices if (payloadsBytesRefs != null) { payloadsBytesRefs.clear(); } this.frozen = false; }
/** * Resets the {@link MemoryIndex} to its initial state and recycles all internal buffers. */ public void reset() { fields.clear(); this.normSimilarity = IndexSearcher.getDefaultSimilarity(); byteBlockPool.reset(false, false); // no need to 0-fill the buffers intBlockPool.reset(true, false); // here must must 0-fill since we use slices if (payloadsBytesRefs != null) { payloadsBytesRefs.clear(); } this.frozen = false; }