org.apache.hadoop.hbase.spark

JavaHBaseContext

class JavaHBaseContext extends Serializable

This is the Java Wrapper over HBaseContext which is written in Scala. This class will be used by developers that want to work with Spark or Spark Streaming in Java

Annotations
@Public()
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JavaHBaseContext
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JavaHBaseContext(jsc: JavaSparkContext, config: Configuration)

    jsc

    This is the JavaSparkContext that we will wrap

    config

    This is the config information to out HBase cluster

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def bulkDelete[T](javaRdd: JavaRDD[T], tableName: TableName, f: Function[T, Delete], batchSize: Integer): Unit

    A simple abstraction over the HBaseContext.

    A simple abstraction over the HBaseContext.foreachPartition method.

    It allow addition support for a user to take a JavaRDD and generate delete and send them to HBase.

    The complexity of managing the Connection is removed from the developer

    javaRdd

    Original JavaRDD with data to iterate over

    tableName

    The name of the table to delete from

    f

    Function to convert a value in the JavaRDD to a HBase Deletes

    batchSize

    The number of deletes to batch before sending to HBase

  8. def bulkGet[T, U](tableName: TableName, batchSize: Integer, javaRdd: JavaRDD[T], makeGet: Function[T, Get], convertResult: Function[Result, U]): JavaRDD[U]

    A simple abstraction over the HBaseContext.

    A simple abstraction over the HBaseContext.mapPartition method.

    It allow addition support for a user to take a JavaRDD and generates a new RDD based on Gets and the results they bring back from HBase

    tableName

    The name of the table to get from

    batchSize

    batch size of how many gets to retrieve in a single fetch

    javaRdd

    Original JavaRDD with data to iterate over

    makeGet

    Function to convert a value in the JavaRDD to a HBase Get

    convertResult

    This will convert the HBase Result object to what ever the user wants to put in the resulting JavaRDD

    returns

    New JavaRDD that is created by the Get to HBase

  9. def bulkLoad[T](javaRdd: JavaRDD[T], tableName: TableName, mapFunc: Function[T, Pair[KeyFamilyQualifier, Array[Byte]]], stagingDir: String, familyHFileWriteOptionsMap: Map[Array[Byte], FamilyHFileWriteOptions], compactionExclude: Boolean, maxSize: Long): Unit

    A simple abstraction over the HBaseContext.

    A simple abstraction over the HBaseContext.bulkLoad method. It allow addition support for a user to take a JavaRDD and convert into new JavaRDD[Pair] based on MapFunction, and HFiles will be generated in stagingDir for bulk load

    javaRdd

    The javaRDD we are bulk loading from

    tableName

    The HBase table we are loading into

    mapFunc

    A Function that will convert a value in JavaRDD to Pair(KeyFamilyQualifier, Array[Byte])

    stagingDir

    The location on the FileSystem to bulk load into

    familyHFileWriteOptionsMap

    Options that will define how the HFile for a column family is written

    compactionExclude

    Compaction excluded for the HFiles

    maxSize

    Max size for the HFiles before they roll

  10. def bulkLoadThinRows[T](javaRdd: JavaRDD[T], tableName: TableName, mapFunc: Function[T, Pair[ByteArrayWrapper, FamiliesQualifiersValues]], stagingDir: String, familyHFileWriteOptionsMap: Map[Array[Byte], FamilyHFileWriteOptions], compactionExclude: Boolean, maxSize: Long): Unit

    A simple abstraction over the HBaseContext.

    A simple abstraction over the HBaseContext.bulkLoadThinRows method. It allow addition support for a user to take a JavaRDD and convert into new JavaRDD[Pair] based on MapFunction, and HFiles will be generated in stagingDir for bulk load

    javaRdd

    The javaRDD we are bulk loading from

    tableName

    The HBase table we are loading into

    mapFunc

    A Function that will convert a value in JavaRDD to Pair(ByteArrayWrapper, FamiliesQualifiersValues)

    stagingDir

    The location on the FileSystem to bulk load into

    familyHFileWriteOptionsMap

    Options that will define how the HFile for a column family is written

    compactionExclude

    Compaction excluded for the HFiles

    maxSize

    Max size for the HFiles before they roll

  11. def bulkPut[T](javaRdd: JavaRDD[T], tableName: TableName, f: Function[T, Put]): Unit

    A simple abstraction over the HBaseContext.

    A simple abstraction over the HBaseContext.foreachPartition method.

    It allow addition support for a user to take JavaRDD and generate puts and send them to HBase. The complexity of managing the Connection is removed from the developer

    javaRdd

    Original JavaRDD with data to iterate over

    tableName

    The name of the table to put into

    f

    Function to convert a value in the JavaRDD to a HBase Put

  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def foreachPartition[T](javaDstream: JavaDStream[T], f: VoidFunction[(Iterator[T], Connection)]): Unit

    A simple enrichment of the traditional Spark Streaming dStream foreach This function differs from the original in that it offers the developer access to a already connected Connection object

    A simple enrichment of the traditional Spark Streaming dStream foreach This function differs from the original in that it offers the developer access to a already connected Connection object

    Note: Do not close the Connection object. All Connection management is handled outside this method

    javaDstream

    Original DStream with data to iterate over

    f

    Function to be given a iterator to iterate through the JavaDStream values and a Connection object to interact with HBase

  17. def foreachPartition[T](javaRdd: JavaRDD[T], f: VoidFunction[(Iterator[T], Connection)]): Unit

    A simple enrichment of the traditional Spark javaRdd foreachPartition.

    A simple enrichment of the traditional Spark javaRdd foreachPartition. This function differs from the original in that it offers the developer access to a already connected Connection object

    Note: Do not close the Connection object. All Connection management is handled outside this method

    javaRdd

    Original javaRdd with data to iterate over

    f

    Function to be given a iterator to iterate through the RDD values and a Connection object to interact with HBase

  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. val hbaseContext: HBaseContext

  21. def hbaseRDD(tableName: TableName, scans: Scan): JavaRDD[(ImmutableBytesWritable, Result)]

    A overloaded version of HBaseContext hbaseRDD that define the type of the resulting JavaRDD

    A overloaded version of HBaseContext hbaseRDD that define the type of the resulting JavaRDD

    tableName

    The name of the table to scan

    scans

    The HBase scan object to use to read data from HBase

    returns

    New JavaRDD with results from scan

  22. def hbaseRDD[U](tableName: TableName, scans: Scan, f: Function[(ImmutableBytesWritable, Result), U]): JavaRDD[U]

    This function will use the native HBase TableInputFormat with the given scan object to generate a new JavaRDD

    This function will use the native HBase TableInputFormat with the given scan object to generate a new JavaRDD

    tableName

    The name of the table to scan

    scans

    The HBase scan object to use to read data from HBase

    f

    Function to convert a Result object from HBase into What the user wants in the final generated JavaRDD

    returns

    New JavaRDD with results from scan

  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. def mapPartitions[T, R](javaRdd: JavaRDD[T], f: FlatMapFunction[(Iterator[T], Connection), R]): JavaRDD[R]

    A simple enrichment of the traditional Spark JavaRDD mapPartition.

    A simple enrichment of the traditional Spark JavaRDD mapPartition. This function differs from the original in that it offers the developer access to a already connected Connection object

    Note: Do not close the Connection object. All Connection management is handled outside this method

    Note: Make sure to partition correctly to avoid memory issue when getting data from HBase

    javaRdd

    Original JavaRdd with data to iterate over

    f

    Function to be given a iterator to iterate through the RDD values and a Connection object to interact with HBase

    returns

    Returns a new RDD generated by the user definition function just like normal mapPartition

  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  28. def streamBulkDelete[T](javaDStream: JavaDStream[T], tableName: TableName, f: Function[T, Delete], batchSize: Integer): Unit

    A simple abstraction over the HBaseContext.

    A simple abstraction over the HBaseContext.streamBulkMutation method.

    It allow addition support for a user to take a JavaDStream and generate Delete and send them to HBase.

    The complexity of managing the Connection is removed from the developer

    javaDStream

    Original DStream with data to iterate over

    tableName

    The name of the table to delete from

    f

    Function to convert a value in the JavaDStream to a HBase Delete

    batchSize

    The number of deletes to be sent at once

  29. def streamBulkGet[T, U](tableName: TableName, batchSize: Integer, javaDStream: JavaDStream[T], makeGet: Function[T, Get], convertResult: Function[Result, U]): JavaDStream[U]

    A simple abstraction over the HBaseContext.

    A simple abstraction over the HBaseContext.streamMap method.

    It allow addition support for a user to take a DStream and generates a new DStream based on Gets and the results they bring back from HBase

    tableName

    The name of the table to get from

    batchSize

    The number of gets to be batched together

    javaDStream

    Original DStream with data to iterate over

    makeGet

    Function to convert a value in the JavaDStream to a HBase Get

    convertResult

    This will convert the HBase Result object to what ever the user wants to put in the resulting JavaDStream

    returns

    New JavaDStream that is created by the Get to HBase

  30. def streamBulkPut[T](javaDstream: JavaDStream[T], tableName: TableName, f: Function[T, Put]): Unit

    A simple abstraction over the HBaseContext.

    A simple abstraction over the HBaseContext.streamMapPartition method.

    It allow addition support for a user to take a JavaDStream and generate puts and send them to HBase.

    The complexity of managing the Connection is removed from the developer

    javaDstream

    Original DStream with data to iterate over

    tableName

    The name of the table to put into

    f

    Function to convert a value in the JavaDStream to a HBase Put

  31. def streamMap[T, U](javaDstream: JavaDStream[T], mp: Function[(Iterator[T], Connection), Iterator[U]]): JavaDStream[U]

    A simple enrichment of the traditional Spark Streaming JavaDStream mapPartition.

    A simple enrichment of the traditional Spark Streaming JavaDStream mapPartition.

    This function differs from the original in that it offers the developer access to a already connected Connection object

    Note: Do not close the Connection object. All Connection management is handled outside this method

    Note: Make sure to partition correctly to avoid memory issue when getting data from HBase

    javaDstream

    Original JavaDStream with data to iterate over

    mp

    Function to be given a iterator to iterate through the JavaDStream values and a Connection object to interact with HBase

    returns

    Returns a new JavaDStream generated by the user definition function just like normal mapPartition

  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. def toString(): String

    Definition Classes
    AnyRef → Any
  34. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped