public final class HelloHBase extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static byte[] |
MY_COLUMN_FAMILY_NAME |
(package private) static byte[] |
MY_FIRST_COLUMN_QUALIFIER |
(package private) static String |
MY_NAMESPACE_NAME |
(package private) static byte[] |
MY_ROW_ID |
(package private) static byte[] |
MY_SECOND_COLUMN_QUALIFIER |
(package private) static TableName |
MY_TABLE_NAME |
Modifier | Constructor and Description |
---|---|
private |
HelloHBase() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
createNamespaceAndTable(Admin admin)
Invokes Admin#createNamespace and Admin#createTable to create a namespace with a table that has
one column-family.
|
(package private) static void |
deleteNamespaceAndTable(Admin admin)
Invokes Admin#disableTable, Admin#deleteTable, and Admin#deleteNamespace to disable/delete
Table and delete Namespace.
|
(package private) static void |
deleteRow(Table table)
Invokes Table#delete to delete test data (i.e.
|
(package private) static void |
getAndPrintRowContents(Table table)
Invokes Table#get and prints out the contents of the retrieved row.
|
static void |
main(String[] args) |
(package private) static boolean |
namespaceExists(Admin admin,
String namespaceName)
Checks to see whether a namespace exists.
|
(package private) static void |
putRowToTable(Table table)
Invokes Table#put to store a row (with two new columns created 'on the fly') into the table.
|
static final String MY_NAMESPACE_NAME
static final TableName MY_TABLE_NAME
static final byte[] MY_COLUMN_FAMILY_NAME
static final byte[] MY_FIRST_COLUMN_QUALIFIER
static final byte[] MY_SECOND_COLUMN_QUALIFIER
static final byte[] MY_ROW_ID
private HelloHBase()
public static void main(String[] args) throws IOException
IOException
static void createNamespaceAndTable(Admin admin) throws IOException
admin
- Standard Admin objectIOException
- If IO problem encounteredstatic void putRowToTable(Table table) throws IOException
table
- Standard Table object (used for CRUD operations).IOException
- If IO problem encounteredstatic void getAndPrintRowContents(Table table) throws IOException
table
- Standard Table objectIOException
- If IO problem encounteredstatic boolean namespaceExists(Admin admin, String namespaceName) throws IOException
admin
- Standard Admin objectnamespaceName
- Name of namespaceIOException
- If IO problem encounteredstatic void deleteRow(Table table) throws IOException
table
- Standard Table objectIOException
- If IO problem is encounteredstatic void deleteNamespaceAndTable(Admin admin) throws IOException
admin
- Standard Admin objectIOException
- If IO problem is encounteredCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.