Class IndexPartition.Builder

java.lang.Object
com.here.platform.data.client.javadsl.IndexPartition.Builder
Enclosing class:
IndexPartition

public static final class IndexPartition.Builder extends Object
Builder of IndexPartition that represents a partition of Index layer.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • addBooleanField

      public IndexPartition.Builder addBooleanField(String name, boolean value)
      Add index field with Boolean type to the collection of index fields.

      Parameters:
      name - the name of index field
      value - the value of index field
      Returns:
      this builder
    • addField

      public IndexPartition.Builder addField(String name, IndexValue value)
      Add field to the collection of index fields.

      Parameters:
      name - the name of index field
      value - the value of index field
      Returns:
      this builder
    • addHereTileField

      public IndexPartition.Builder addHereTileField(String name, long tile)
      Add index field with HereTile type to the collection of index fields.

      Parameters:
      name - the name of index field
      tile - the value of index field
      Returns:
      this builder
    • addIntField

      public IndexPartition.Builder addIntField(String name, long value)
      Add index field with 64 bits integer type to the collection of index fields.

      Parameters:
      name - the name of index field
      value - the value of index field
      Returns:
      this builder
    • addMetadata

      public IndexPartition.Builder addMetadata(String name, String value)
      Add metadata name-value pair to index metadata collection.

      Parameters:
      name - name of metadata field
      value - value of metadata field
      Returns:
      this builder
    • addStringField

      public IndexPartition.Builder addStringField(String name, String value)
      Add index field with String type to the collection of index fields.

      Parameters:
      name - the name of index field
      value - the value of index field
      Returns:
      this builder
    • addTimeWindowField

      public IndexPartition.Builder addTimeWindowField(String name, long time)
      Add index field with TimeWindow type to the collection of index fields.

      Parameters:
      name - the name of index field
      time - the value of index field
      Returns:
      this builder
    • build

      public IndexPartition build()
      Build index partition.
    • withChecksum

      public IndexPartition.Builder withChecksum(Optional<String> checksum)
      Sets the checksum.

      Parameters:
      checksum - precomputed checksum value
      Returns:
      this builder
    • withCompressedDataSize

      public IndexPartition.Builder withCompressedDataSize(OptionalLong compressedDataSize)
      Sets the compressedDataSize.

      Parameters:
      compressedDataSize - compressed data size
      Returns:
      this builder
    • withCrc

      public IndexPartition.Builder withCrc(Optional<String> crc)
      Sets the crc.

      Parameters:
      crc - precomputed crc value
      Returns:
      this builder
    • withDataHandle

      public IndexPartition.Builder withDataHandle(String dataHandle)
      Sets the dataHandle.

      Parameters:
      dataHandle - dataHandle
      Returns:
      this builder
    • withDataSize

      public IndexPartition.Builder withDataSize(OptionalLong dataSize)
      Sets the dataSize.

      Parameters:
      dataSize - data size
      Returns:
      this builder
    • withFields

      public IndexPartition.Builder withFields(Optional<Map<String,IndexValue>> fields)
      Set the index fields.

      Parameters:
      fields - the index fields
      Returns:
      this builder
      Note:
      The index fields are collection of name-value pairs that are used to index new partition in Index layer.

      , This method overwrites all fields added before.

    • withLayer

      public IndexPartition.Builder withLayer(String layer)
      Sets the layer name.

      Parameters:
      layer - layer name
      Returns:
      this builder
    • withMetadata

      public IndexPartition.Builder withMetadata(Optional<Map<String,String>> metadata)
      Sets the additional metadata.

      Parameters:
      metadata - the index metadata
      Returns:
      this builder
      Note:
      This method overwrites all metadata values added before.

    • withTimestamp

      public IndexPartition.Builder withTimestamp(OptionalLong timestamp)
      Sets the precomputed timestamp.

      Parameters:
      timestamp - precomputed compressed data size
      Returns:
      this builder