Class StringFieldWriter

java.lang.Object
org.apache.druid.frame.field.StringFieldWriter
All Implemented Interfaces:
Closeable, AutoCloseable, FieldWriter

public class StringFieldWriter extends Object implements FieldWriter
Wraps a DimensionSelector and writes to rframe rows. See StringFieldReader for format details.
  • Field Details

    • VALUE_TERMINATOR

      public static final byte VALUE_TERMINATOR
      See Also:
    • ROW_TERMINATOR

      public static final byte ROW_TERMINATOR
      See Also:
    • NULL_ROW

      public static final byte NULL_ROW
      Null rows are represented by NULL_ROW. Same byte value as VALUE_TERMINATOR, but not ambiguous: NULL_ROW can only occur as the first byte in a row, and VALUE_TERMINATOR can never occur as the first byte in a row.
      See Also:
    • NULL_BYTE

      public static final byte NULL_BYTE
      Different from the values in TypeStrategies, since we want to be able to sort as bytes, and we want nulls to come before non-nulls.
      See Also:
    • NOT_NULL_BYTE

      public static final byte NOT_NULL_BYTE
      See Also:
  • Constructor Details

    • StringFieldWriter

      public StringFieldWriter(DimensionSelector selector, boolean removeNullbytes)
  • Method Details

    • writeTo

      public long writeTo(org.apache.datasketches.memory.WritableMemory memory, long position, long maxSize)
      Description copied from interface: FieldWriter
      Writes the current selection at the given memory position.
      Specified by:
      writeTo in interface FieldWriter
      Parameters:
      memory - memory region in little-endian order
      position - position to write
      maxSize - maximum number of bytes to write
      Returns:
      number of bytes written, or -1 if "maxSize" was not enough memory
    • close

      public void close()
      Description copied from interface: FieldWriter
      Releases resources held by this writer.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface FieldWriter