You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Hadoop QA (JIRA)" <ji...@apache.org> on 2014/06/12 07:51:01 UTC
[jira] [Commented] (HBASE-11337) Document how to create a table
using Java
[ https://issues.apache.org/jira/browse/HBASE-11337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14028855#comment-14028855 ]
Hadoop QA commented on HBASE-11337:
-----------------------------------
{color:green}+1 overall{color}. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12649996/HBASE-11337.patch
against trunk revision .
ATTACHMENT ID: 12649996
{color:green}+1 @author{color}. The patch does not contain any @author tags.
{color:green}+0 tests included{color}. The patch appears to be a documentation patch that doesn't require tests.
{color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings.
{color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages.
{color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 1.3.9) warnings.
{color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings.
{color:green}+1 lineLengths{color}. The patch does not introduce lines longer than 100
{color:green}+1 site{color}. The mvn site goal succeeds with this patch.
{color:green}+1 core tests{color}. The patch passed unit tests in .
Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//testReport/
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-examples.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-prefix-tree.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-thrift.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-client.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-protocol.html
Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/9752//console
This message is automatically generated.
> Document how to create a table using Java
> -----------------------------------------
>
> Key: HBASE-11337
> URL: https://issues.apache.org/jira/browse/HBASE-11337
> Project: HBase
> Issue Type: Bug
> Components: Admin, documentation
> Reporter: Misty Stanley-Jones
> Assignee: Misty Stanley-Jones
> Attachments: HBASE-11337.patch
>
>
> Example code from [~jmspaggi]
> {quote}
> package com.cloudera.sa.hp.hbase.admin;
> import java.io.IOException;
> 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.io.compress.Compression.Algorithm;
> import org.apache.hadoop.conf.Configuration;
> import static com.cloudera.sa.hp.hbase.Constants.*;
> public class CreateSchema {
> public static void createIfNotExist(HBaseAdmin admin, HTableDescriptor table) throws IOException {
> if (admin.tableExists(table.getName())) {
> admin.disableTable(table.getName());
> admin.deleteTable(table.getName());
> }
> admin.createTable(table);
> }
> public static void main(String[] args) {
> /**********************************************************************/
> /***** Create application schema. *************************************/
> /**********************************************************************/
> Configuration config = HBaseConfiguration.create();
> config.set("hbase.zookeeper.quorum", "192.168.56.102"); // Here we are running zookeeper locally
> try {
> final HBaseAdmin admin = new HBaseAdmin(config);
> HTableDescriptor table_assetmeta = new HTableDescriptor(TableName.valueOf(TABLE_ASSETMETA));
> table_assetmeta.addFamily(new HColumnDescriptor(CF_DEFAULT).setCompressionType(Algorithm.GZ));
> System.out.print("Creating table_assetmeta. ");
> admin.createTable(table_assetmeta);
> System.out.println(" Done.");
> admin.close();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> {quote}
--
This message was sent by Atlassian JIRA
(v6.2#6252)