i need to serialize a RDD read from HBASE into alluxio memory file system as way to cache and update it periodically to be used in incremental SPARK computation.
Codes are like this, but run into titled exception
val inputTableNameEvent = HBaseTables.TABLE_XXX.tableName
val namedeRDDName = "EventAllCached2Update"
val alluxioPath = "alluxio://hadoop1:19998/"
val fileURI = alluxioPath + namedeRDDName
val path:AlluxioURI = new AlluxioURI("/"+namedeRDDName)
val fs:FileSystem = FileSystem.Factory.get()
val conf = HBaseConfiguration.create()
conf.set(TableInputFormat.INPUT_TABLE, inputTableNameEvent)
val rdd = sc.newAPIHadoopRDD(conf, classOf[TableInputFormat],
classOf[org.apache.hadoop.hbase.io.ImmutableBytesWritable],
classOf[org.apache.hadoop.hbase.client.Result])
numbers = rdd.count()
println("rdd count: " + numbers)
if( fs.exists(path))
fs.delete(path)
rdd.saveAsObjectFile(fileURI)
Can anyone help tell how to map ImmutableBytesWritable to another type to bypass this problem? Also the map need to be revertable, as later i need to use objectFile to read this saved object back and turn it into a [(ImmutableBytesWritable, Result)] RDD to be used for update and computation later.