Class VortexOptions

java.lang.Object
dev.vortex.spark.VortexOptions
All Implemented Interfaces:
Serializable

public final class VortexOptions extends Object implements Serializable
The format options of one Spark read or write, resolved without regard to key case.

Spark treats data source options as case-insensitive, but the connector is reached through maps that disagree: a V2 scan carries the keys as the user typed them, while the V1 file format lower-cases them first. Every vortex.* lookup goes through here so both paths answer the same.

The keys as given are kept too. Hadoop configuration keys are case-sensitive, so asCaseSensitiveMap() is what feeds a Hadoop Configuration.

Built on the driver and shipped to executors inside the reader and writer factories.

See Also:
  • Method Details

    • of

      public static VortexOptions of(Map<String,String> options)
      Captures options as given. A null map is read as no options at all.
    • empty

      public static VortexOptions empty()
      No options at all, for callers with no Spark read or write to draw them from.
    • asCaseSensitiveMap

      public Map<String,String> asCaseSensitiveMap()
      The options with the keys as given, for the case-sensitive world of Hadoop configuration.
    • get

      public Optional<String> get(String key)
      The value set for key under any casing.
    • get

      public String get(String key, String fallback)
      The value set for key under any casing, or fallback when it is not set.
    • getInt

      public int getInt(String key, int fallback)
      The value set for key as an integer, or fallback when it is not set.
      Throws:
      IllegalArgumentException - if the value is not an integer
    • getBoolean

      public boolean getBoolean(String key, boolean fallback)
      The value set for key as a boolean, or fallback when it is not set.
      Throws:
      IllegalArgumentException - if the value is neither true nor false
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object