Class TableHiveInputSplit

All Implemented Interfaces:
Writable, InputSplit, InputSplitWithLocationInfo

public class TableHiveInputSplit extends FileSplit
Concrete implementation of the InputSplit interface required by version 1 of MapReduce to support Hive queries. A RecordReader will take instances of this class, where each such instance corresponds to data stored in an Oracle NoSQL Database store via the Table API, and use those instances to retrieve that data when performing a given Hive query against the store's data.

Note that the Hive infrastructure requires that even though the data associated with instances of this class resides in a table in an Oracle NoSQL Database store rather than an HDFS file, this class still must subclass FileSplit. As a result, a Hadoop HDFS Path must be specified for this class.

Also note that although this InputSplit is based on version 1 of MapReduce (as requied by the Hive infrastructure), it wraps and delegates to a YARN based (MapReduce version 2) InputSplit. This is done because the InputSplit class Oracle NoSQL Database provides to support Hadoop integration is YARN based, and this class wishes to exploit and reuse the functionality already provided by the YARN based InputSplit class.

  • Constructor Details

    • TableHiveInputSplit

      public TableHiveInputSplit()
    • TableHiveInputSplit

      public TableHiveInputSplit(Path filePath, TableInputSplit v2Split)
  • Method Details

    • getPath

      public Path getPath()
      Returns the HDFS Path associated with this split.
      Overrides:
      getPath in class FileSplit
      Returns:
      the HDFS Path associated with this split
    • getLength

      public long getLength()
      Get the size of the split, so that the input splits can be sorted by size.
      Specified by:
      getLength in interface InputSplit
      Overrides:
      getLength in class FileSplit
      Returns:
      the number of bytes in the split
    • getLocations

      public String[] getLocations() throws IOException
      Get the list of nodes by name where the data for the split would be local. The locations do not need to be serialized.
      Specified by:
      getLocations in interface InputSplit
      Overrides:
      getLocations in class FileSplit
      Returns:
      a new array of the node nodes.
      Throws:
      IOException - if an I/O error occurs
    • write

      public void write(DataOutput out) throws IOException
      Serialize the fields of this object to out.
      Specified by:
      write in interface Writable
      Overrides:
      write in class FileSplit
      Parameters:
      out - DataOuput to serialize this object into.
      Throws:
      IOException - if an I/O error occurs
    • readFields

      public void readFields(DataInput in) throws IOException
      Deserialize the fields of this object from in.

      For efficiency, implementations should attempt to re-use storage in the existing object where possible.

      Specified by:
      readFields in interface Writable
      Overrides:
      readFields in class FileSplit
      Parameters:
      in - DataInput to deseriablize this object from.
      Throws:
      IOException - if an I/O error occurs
    • equals

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

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

      public String toString()
      Overrides:
      toString in class FileSplit
    • getKVStoreName

      public String getKVStoreName()
    • getKVHelperHosts

      public String[] getKVHelperHosts()
    • getTableName

      public String getTableName()
    • getQueryBy

      public int getQueryBy()
    • getWhereClause

      public String getWhereClause()
    • getSecurityLogin

      public String getSecurityLogin()
    • getSecurityCredentials

      public PasswordCredentials getSecurityCredentials()
    • getSecurityTrust

      public String getSecurityTrust()