February 2019
Beginner to intermediate
544 pages
14h 36m
English
The insertion of a record into HBase can be done using the Put object. You have to provide a row to create a Put instance. A row is identified by a unique row key and is the case with most values in HBase—it is a Java byte[] array, as follows:
import org.Apache.Hadoop.conf.Configuration;import org.Apache.Hadoop.hbase.HBaseConfiguration;import org.Apache.Hadoop.hbase.client.HTable;import org.Apache.Hadoop.hbase.client.Put;import org.Apache.Hadoop.hbase.util.Bytes;import java.io.IOException;public class HBasePutExample { public static void main(String[] args) throws IOException { Configuration conf = HBaseConfiguration.create(); HTable table = new HTable(conf, "testtable"); Put recordPuter = new Put(Bytes.toBytes("samplerow"
Read now
Unlock full access