HBASE-4004 book.xml - adding schema maintenance code example

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1138310 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-06-22 05:33:15 +00:00
parent ad82eefcd0
commit 73037604e0
1 changed files with 18 additions and 0 deletions

View File

@ -149,6 +149,24 @@ throws InterruptedException, IOException {
<para>HBase schemas can be created or updated with <xref linkend="shell" /> <para>HBase schemas can be created or updated with <xref linkend="shell" />
or by using <link xlink:href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/HBaseAdmin.html">HBaseAdmin</link> in the Java API. or by using <link xlink:href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/HBaseAdmin.html">HBaseAdmin</link> in the Java API.
</para> </para>
<para>Tables must be disabled when making ColumnFamily modifications, for example..
<programlisting>
Configuration config = HBaseConfiguration.create();
HBaseAdmin admin = new HBaseAdmin(conf);
String table = "myTable";
admin.disableTable(table);
HColumnDescriptor cf1 = ...;
admin.addColumn(table, cf1 ); // adding new ColumnFamily
HColumnDescriptor cf2 = ...;
admin.modifyColumn(table, cf2 ); // modifying existing ColumnFamily
admin.enableTable(table);
</programlisting>
</para>See <xref linkend="client_dependencies"/> for more information about configuring client connections.
<para>
</para>
</section> </section>
<section xml:id="number.of.cfs"> <section xml:id="number.of.cfs">
<title> <title>