Class HelloHBase
java.lang.Object
org.apache.hbase.archetypes.exemplars.client.HelloHBase
Successful running of this application requires access to an active instance of HBase. For
install instructions for a standalone instance of HBase, please refer to
https://hbase.apache.org/book.html#quickstart
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(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
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
(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.
-
Field Details
-
MY_NAMESPACE_NAME
- See Also:
-
MY_TABLE_NAME
-
MY_COLUMN_FAMILY_NAME
-
MY_FIRST_COLUMN_QUALIFIER
-
MY_SECOND_COLUMN_QUALIFIER
-
MY_ROW_ID
-
-
Constructor Details
-
HelloHBase
private HelloHBase()
-
-
Method Details
-
main
- Throws:
IOException
-
createNamespaceAndTable
Invokes Admin#createNamespace and Admin#createTable to create a namespace with a table that has one column-family.- Parameters:
admin
- Standard Admin object- Throws:
IOException
- If IO problem encountered
-
putRowToTable
Invokes Table#put to store a row (with two new columns created 'on the fly') into the table.- Parameters:
table
- Standard Table object (used for CRUD operations).- Throws:
IOException
- If IO problem encountered
-
getAndPrintRowContents
Invokes Table#get and prints out the contents of the retrieved row.- Parameters:
table
- Standard Table object- Throws:
IOException
- If IO problem encountered
-
namespaceExists
Checks to see whether a namespace exists.- Parameters:
admin
- Standard Admin objectnamespaceName
- Name of namespace- Returns:
- true If namespace exists
- Throws:
IOException
- If IO problem encountered
-
deleteRow
Invokes Table#delete to delete test data (i.e. the row)- Parameters:
table
- Standard Table object- Throws:
IOException
- If IO problem is encountered
-
deleteNamespaceAndTable
Invokes Admin#disableTable, Admin#deleteTable, and Admin#deleteNamespace to disable/delete Table and delete Namespace.- Parameters:
admin
- Standard Admin object- Throws:
IOException
- If IO problem is encountered
-