congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ByteBlockPool.reset
Code IndexAdd Tabnine to your IDE (free)

How to use
reset
method
in
org.apache.lucene.util.ByteBlockPool

Best Java code snippets using org.apache.lucene.util.ByteBlockPool.reset (Showing top 19 results out of 315)

origin: org.apache.lucene/lucene-core

/**
 * 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);
}

origin: org.apache.lucene/lucene-core

/**
 * 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
}

origin: org.apache.lucene/lucene-core

void reset() {
 // we don't reuse so we drop everything and don't fill with 0
 intPool.reset(false, false); 
 bytePool.reset(false, false);
}
origin: org.apache.lucene/lucene-core

/**
 * 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);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * 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);
}

origin: harbby/presto-connectors

/**
 * 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);
}

origin: org.infinispan/infinispan-embedded-query

/**
 * 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);
}

origin: org.infinispan/infinispan-embedded-query

/**
 * 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
}

origin: org.apache.lucene/lucene-spellchecker

/**
 * Clears this {@link BytesRefList}
 */
public void clear() {
 lastElement = 0;
 currentOffset = 0;
 Arrays.fill(offsets, 0);
 pool.reset();
}

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * 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
}

origin: harbby/presto-connectors

/**
 * 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
}

origin: harbby/presto-connectors

void reset() {
 // we don't reuse so we drop everything and don't fill with 0
 intPool.reset(false, false); 
 bytePool.reset(false, false);
}
origin: org.infinispan/infinispan-embedded-query

void reset() {
 // we don't reuse so we drop everything and don't fill with 0
 intPool.reset(false, false); 
 bytePool.reset(false, false);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

void reset() {
 // we don't reuse so we drop everything and don't fill with 0
 intPool.reset(false, false); 
 bytePool.reset(false, false);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * 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);
}
origin: harbby/presto-connectors

/**
 * 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);
}
origin: org.infinispan/infinispan-embedded-query

/**
 * 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);
}
origin: org.apache.lucene/lucene-memory

/**
 * 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;
}

origin: harbby/presto-connectors

/**
 * 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;
}

org.apache.lucene.utilByteBlockPoolreset

Javadoc

Resets the pool to its initial state reusing the first buffer and fills all buffers with 0 bytes before they reused or passed to Allocator#recycleByteBlocks(byte[][],int,int). Calling ByteBlockPool#nextBuffer() is not needed after reset.

Popular methods of ByteBlockPool

  • <init>
  • nextBuffer
    Advances the pool to its next buffer. This method should be called once after the constructor to ini
  • allocSlice
    Creates a new byte slice with the given starting size and returns the slices offset in the pool.
  • append
    Appends the bytes in the provided BytesRef at the current position.
  • newSlice
    Allocates a new slice with the given size.
  • readBytes
    Reads bytes bytes out of the pool starting at the given offset with the given length into the given
  • setBytesRef
    Fill the provided BytesRef with the bytes at the specified offset/length slice. This will avoid copy
  • readByte
    Read a single byte at the given offset.
  • setRawBytesRef
    Set the given BytesRef so that its content is equal to the ref.length bytes starting at offset. Most
  • copy
  • copyFrom
  • copyFrom

Popular in Java

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Path (java.nio.file)
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ImageIO (javax.imageio)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now