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

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • 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