org.apache.hadoop.mapreduce.lib.db

## Class DBInputFormat.DBInputSplit

- java.lang.Object
- - org.apache.hadoop.mapreduce.InputSplit
  - - org.apache.hadoop.mapreduce.lib.db.DBInputFormat.DBInputSplit

- All Implemented Interfaces:
    org.apache.hadoop.io.Writable
  Direct Known Subclasses:
    DataDrivenDBInputFormat.DataDrivenDBInputSplit, DBInputFormat.DBInputSplit
  Enclosing class:
    DBInputFormat<T extends DBWritable>

      @InterfaceStability.Evolving
      public static class DBInputFormat.DBInputSplit
      extends InputSplit
      implements org.apache.hadoop.io.Writable

  A InputSplit that spans a set of rows

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DBInputSplit()` Default Constructor
    `DBInputSplit(long start, long end)` Convenience Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getEnd()`
    `long` | `getLength()` Get the size of the split, so that the input splits can be sorted by size.
    `String[]` | `getLocations()` Get the list of nodes by name where the data for the split would be local.
    `long` | `getStart()`
    `void` | `readFields(DataInput input)`
    `void` | `write(DataOutput output)`

    - ### Methods inherited from class org.apache.hadoop.mapreduce.InputSplit

      `getLocationInfo`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DBInputSplit

          public DBInputSplit()

      Default Constructor

    - #### DBInputSplit

          public DBInputSplit(long start,
                              long end)

      Convenience Constructor
      Parameters:
        `start` - the index of the first row to select
        `end` - the index of the last row to select

  - ### Method Detail

    - #### 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 class `InputSplit`
      Returns:
        a new array of the node nodes.
      Throws:
        `IOException`

    - #### getStart

          public long getStart()

      Returns:
        The index of the first row to select

    - #### getEnd

          public long getEnd()

      Returns:
        The index of the last row to select

    - #### getLength

          public long getLength()
                         throws IOException

      Description copied from class: `InputSplit`
      Get the size of the split, so that the input splits can be sorted by size.
      Specified by:
        `getLength` in class `InputSplit`
      Returns:
        The total row count in this split
      Throws:
        `IOException`

    - #### readFields

          public void readFields(DataInput input)
                          throws IOException

      Specified by:
        `readFields` in interface `org.apache.hadoop.io.Writable`
      Throws:
        `IOException`

    - #### write

          public void write(DataOutput output)
                     throws IOException

      Specified by:
        `write` in interface `org.apache.hadoop.io.Writable`
      Throws:
        `IOException`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.