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

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

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

origin: org.apache.lucene/lucene-core

/**
 * Appends a copy of the given {@link BytesRef} to this {@link BytesRefArray}.
 * @param bytes the bytes to append
 * @return the index of the appended bytes
 */
@Override
public int append(BytesRef bytes) {
 if (lastElement >= offsets.length) {
  int oldLen = offsets.length;
  offsets = ArrayUtil.grow(offsets, offsets.length + 1);
  bytesUsed.addAndGet((offsets.length - oldLen) * Integer.BYTES);
 }
 pool.append(bytes);
 offsets[lastElement++] = currentOffset;
 currentOffset += bytes.length;
 return lastElement-1;
}

origin: org.apache.lucene/lucene-core

public void addPackedValue(int docID, BytesRef value) {
 if (value == null) {
  throw new IllegalArgumentException("field=" + fieldInfo.name + ": point value must not be null");
 }
 if (value.length != packedBytesLength) {
  throw new IllegalArgumentException("field=" + fieldInfo.name + ": this field's value has length=" + value.length + " but should be " + (fieldInfo.getPointDataDimensionCount() * fieldInfo.getPointNumBytes()));
 }
 if (docIDs.length == numPoints) {
  docIDs = ArrayUtil.grow(docIDs, numPoints+1);
  iwBytesUsed.addAndGet((docIDs.length - numPoints) * Integer.BYTES);
 }
 bytes.append(value);
 docIDs[numPoints] = docID;
 if (docID != lastDocID) {
  numDocs++;
  lastDocID = docID;
 }
 numPoints++;
}
origin: harbby/presto-connectors

/**
 * Appends a copy of the given {@link BytesRef} to this {@link BytesRefArray}.
 * @param bytes the bytes to append
 * @return the index of the appended bytes
 */
public int append(BytesRef bytes) {
 if (lastElement >= offsets.length) {
  int oldLen = offsets.length;
  offsets = ArrayUtil.grow(offsets, offsets.length + 1);
  bytesUsed.addAndGet((offsets.length - oldLen)
    * RamUsageEstimator.NUM_BYTES_INT);
 }
 pool.append(bytes);
 offsets[lastElement++] = currentOffset;
 currentOffset += bytes.length;
 return lastElement-1;
}

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

/**
 * Appends a copy of the given {@link BytesRef} to this {@link BytesRefArray}.
 * @param bytes the bytes to append
 * @return the index of the appended bytes
 */
@Override
public int append(BytesRef bytes) {
 if (lastElement >= offsets.length) {
  int oldLen = offsets.length;
  offsets = ArrayUtil.grow(offsets, offsets.length + 1);
  bytesUsed.addAndGet((offsets.length - oldLen) * Integer.BYTES);
 }
 pool.append(bytes);
 offsets[lastElement++] = currentOffset;
 currentOffset += bytes.length;
 return lastElement-1;
}

origin: org.infinispan/infinispan-embedded-query

/**
 * Appends a copy of the given {@link BytesRef} to this {@link BytesRefArray}.
 * @param bytes the bytes to append
 * @return the index of the appended bytes
 */
public int append(BytesRef bytes) {
 if (lastElement >= offsets.length) {
  int oldLen = offsets.length;
  offsets = ArrayUtil.grow(offsets, offsets.length + 1);
  bytesUsed.addAndGet((offsets.length - oldLen)
    * RamUsageEstimator.NUM_BYTES_INT);
 }
 pool.append(bytes);
 offsets[lastElement++] = currentOffset;
 currentOffset += bytes.length;
 return lastElement-1;
}

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

public void addPackedValue(int docID, BytesRef value) {
 if (value == null) {
  throw new IllegalArgumentException("field=" + fieldInfo.name + ": point value must not be null");
 }
 if (value.length != packedBytesLength) {
  throw new IllegalArgumentException("field=" + fieldInfo.name + ": this field's value has length=" + value.length + " but should be " + (fieldInfo.getPointDataDimensionCount() * fieldInfo.getPointNumBytes()));
 }
 if (docIDs.length == numPoints) {
  docIDs = ArrayUtil.grow(docIDs, numPoints+1);
  iwBytesUsed.addAndGet((docIDs.length - numPoints) * Integer.BYTES);
 }
 bytes.append(value);
 docIDs[numPoints] = docID;
 if (docID != lastDocID) {
  numDocs++;
  lastDocID = docID;
 }
 numPoints++;
}
org.apache.lucene.utilByteBlockPoolappend

Javadoc

Appends the bytes in the provided BytesRef at the current position.

Popular methods of ByteBlockPool

  • <init>
  • reset
    Expert: Resets the pool to its initial state reusing the first buffer. Calling ByteBlockPool#nextBuf
  • 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.
  • 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

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Menu (java.awt)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 12 Jupyter Notebook extensions
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