Class MetadataVersion

java.lang.Object
org.apache.drill.exec.store.parquet.metadata.MetadataVersion
All Implemented Interfaces:
Comparable<MetadataVersion>

public class MetadataVersion extends Object implements Comparable<MetadataVersion>
  • Constructor Details

    • MetadataVersion

      public MetadataVersion(int major, int minor)
    • MetadataVersion

      public MetadataVersion(String metadataVersion)
  • Method Details

    • getMajor

      public int getMajor()
    • getMinor

      public int getMinor()
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      string representation of the metadata file version, for example: "1", "10", "4.13"

      String metadata version consists of the following characters:

      major metadata version (any number of digits, except a single zero digit),

      optional "." delimiter (used if minor metadata version is specified),

      minor metadata version (not specified for "0" minor version)

    • compareTo

      public int compareTo(MetadataVersion o)
      Specified by:
      compareTo in interface Comparable<MetadataVersion>
    • isAtLeast

      public boolean isAtLeast(int major, int minor)
      Check if this version is at least (equals or higher) the one identified by major and minor versions integer literals.
      Parameters:
      major - major version
      minor - minor version
      Returns:
      true if the version is equal to or higher than the one it is being checked against
    • isEqualTo

      public boolean isEqualTo(int major, int minor)
      Check if the version is the same as the one identified by major and minor versions integer literals.
      Parameters:
      major - major version
      minor - minor version
      Returns:
      true if the version is equal to the one it is being checked against
    • isHigherThan

      public boolean isHigherThan(int major, int minor)
      Check if this version comes after the one identified by major and minor versions integer literals. That is, this one was introduced later.
      Parameters:
      major - major version
      minor - minor version
      Returns:
      true if the version is defined later than the one it is being checked against