Class BatchEncoder.BytesRefs

All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.lucene.util.Accountable, org.elasticsearch.core.Releasable
Enclosing class:
BatchEncoder

protected abstract static class BatchEncoder.BytesRefs extends BatchEncoder.MVEncoder
  • Constructor Details

    • BytesRefs

      protected BytesRefs(int batchSize)
  • Method Details

    • hasCapacity

      protected final boolean hasCapacity(int totalBytes, int count)
      Is there capacity for totalBytes and spread across #count BytesRefs? You could call this with something like hasCapacity(Arrays.stream(bytes).mapToInt(b -> b.length).sum(), bytes.length).
    • ensureCapacity

      protected final void ensureCapacity(int totalBytes, int count)
      Make sure there is capacity for totalBytes and spread across #count BytesRefs? You could call this with something like ensureCapacity(Arrays.stream(bytes).mapToInt(b -> b.length).sum(), bytes.length).
    • encode

      protected final void encode(org.apache.lucene.util.BytesRef v)
      Encode a BytesRef and advance to the next position.