forked from xldrx/cloudapp-mp4
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SuperTable.java
62 lines (37 loc) · 1.46 KB
/
SuperTable.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.util.Bytes;
public class SuperTable{
public static void main(String[] args) throws IOException {
// Instantiate Configuration class
// Instaniate HBaseAdmin class
// Instantiate table descriptor class
// Add column families to table descriptor
// Execute the table through admin
// Instantiating HTable class
// Repeat these steps as many times as necessary
// Instantiating Put class
// Hint: Accepts a row name
// Add values using add() method
// Hints: Accepts column family name, qualifier/row name ,value
// Save the table
// Close table
// Instantiate the Scan class
// Scan the required columns
// Get the scan result
// Read values from scan result
// Print scan result
// Close the scanner
// Htable closer
}
}