val hbasecontentrdd01 = contentrdd01.map(p => {
(Bytes.toBytes(p._1),Array((Bytes.toBytes(columnFamily), Bytes.toBytes(qualifier), Bytes.toBytes(p._2))))
})
val tableName = args(3)
hbaseContext.bulkPut[(Array[Byte], Array[(Array[Byte], Array[Byte], Array[Byte])])](hbasecontentrdd01,
tableName,
(putRecord) => {
val put = new Put(putRecord._1)
putRecord._2.foreach((putValue) => put.addColumn(putValue._1, putValue._2, putValue._3))
put
}
)
if (args.length < 5) {
System.err.println("Usage: SaveToHbaseByMinute_shenzhen 20150610 hivetable boxtype hbasetable [areacode] dns")
System.exit(1)
}
|
|