HBASE-23268 Remove disable/enable ops from doc when altering schema
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
This commit is contained in:
parent
34661050c8
commit
2c1d500828
|
@ -336,9 +336,7 @@ If you are changing codecs, be sure the old codec is still available until all t
|
|||
|
||||
.Enabling Compression on a ColumnFamily of an Existing Table using HBaseShell
|
||||
----
|
||||
hbase> disable 'test'
|
||||
hbase> alter 'test', {NAME => 'cf', COMPRESSION => 'GZ'}
|
||||
hbase> enable 'test'
|
||||
----
|
||||
|
||||
.Creating a New Table with Compression On a ColumnFamily
|
||||
|
@ -436,15 +434,12 @@ Following is an example using HBase Shell:
|
|||
|
||||
.Enable Data Block Encoding On a Table
|
||||
----
|
||||
hbase> disable 'test'
|
||||
hbase> alter 'test', { NAME => 'cf', DATA_BLOCK_ENCODING => 'FAST_DIFF' }
|
||||
Updating all regions with the new schema...
|
||||
0/1 regions updated.
|
||||
1/1 regions updated.
|
||||
Done.
|
||||
0 row(s) in 2.2820 seconds
|
||||
hbase> enable 'test'
|
||||
0 row(s) in 0.1580 seconds
|
||||
----
|
||||
|
||||
.Verifying a ColumnFamily's Data Block Encoding
|
||||
|
|
|
@ -294,13 +294,6 @@ dependencies.
|
|||
[[load_coprocessor_in_shell]]
|
||||
==== Using HBase Shell
|
||||
|
||||
. Disable the table using HBase Shell:
|
||||
+
|
||||
[source]
|
||||
----
|
||||
hbase> disable 'users'
|
||||
----
|
||||
|
||||
. Load the Coprocessor, using a command like the following:
|
||||
+
|
||||
[source]
|
||||
|
@ -330,12 +323,6 @@ observers registered at the same hook using priorities. This field can be left b
|
|||
case the framework will assign a default priority value.
|
||||
* Arguments (Optional): This field is passed to the Coprocessor implementation. This is optional.
|
||||
|
||||
. Enable the table.
|
||||
+
|
||||
----
|
||||
hbase(main):003:0> enable 'users'
|
||||
----
|
||||
|
||||
. Verify that the coprocessor loaded:
|
||||
+
|
||||
----
|
||||
|
@ -356,7 +343,6 @@ String path = "hdfs://<namenode>:<port>/user/<hadoop-user>/coprocessor.jar";
|
|||
Configuration conf = HBaseConfiguration.create();
|
||||
Connection connection = ConnectionFactory.createConnection(conf);
|
||||
Admin admin = connection.getAdmin();
|
||||
admin.disableTable(tableName);
|
||||
HTableDescriptor hTableDescriptor = new HTableDescriptor(tableName);
|
||||
HColumnDescriptor columnFamily1 = new HColumnDescriptor("personalDet");
|
||||
columnFamily1.setMaxVersions(3);
|
||||
|
@ -368,7 +354,6 @@ hTableDescriptor.setValue("COPROCESSOR$1", path + "|"
|
|||
+ RegionObserverExample.class.getCanonicalName() + "|"
|
||||
+ Coprocessor.PRIORITY_USER);
|
||||
admin.modifyTable(tableName, hTableDescriptor);
|
||||
admin.enableTable(tableName);
|
||||
----
|
||||
|
||||
==== Using the Java API (HBase 0.96+ only)
|
||||
|
@ -383,7 +368,6 @@ Path path = new Path("hdfs://<namenode>:<port>/user/<hadoop-user>/coprocessor.ja
|
|||
Configuration conf = HBaseConfiguration.create();
|
||||
Connection connection = ConnectionFactory.createConnection(conf);
|
||||
Admin admin = connection.getAdmin();
|
||||
admin.disableTable(tableName);
|
||||
HTableDescriptor hTableDescriptor = new HTableDescriptor(tableName);
|
||||
HColumnDescriptor columnFamily1 = new HColumnDescriptor("personalDet");
|
||||
columnFamily1.setMaxVersions(3);
|
||||
|
@ -394,7 +378,6 @@ hTableDescriptor.addFamily(columnFamily2);
|
|||
hTableDescriptor.addCoprocessor(RegionObserverExample.class.getCanonicalName(), path,
|
||||
Coprocessor.PRIORITY_USER, null);
|
||||
admin.modifyTable(tableName, hTableDescriptor);
|
||||
admin.enableTable(tableName);
|
||||
----
|
||||
|
||||
WARNING: There is no guarantee that the framework will load a given Coprocessor successfully.
|
||||
|
@ -406,13 +389,6 @@ verifies whether the given class is actually contained in the jar file.
|
|||
|
||||
==== Using HBase Shell
|
||||
|
||||
. Disable the table.
|
||||
+
|
||||
[source]
|
||||
----
|
||||
hbase> disable 'users'
|
||||
----
|
||||
|
||||
. Alter the table to remove the coprocessor.
|
||||
+
|
||||
[source]
|
||||
|
@ -420,13 +396,6 @@ hbase> disable 'users'
|
|||
hbase> alter 'users', METHOD => 'table_att_unset', NAME => 'coprocessor$1'
|
||||
----
|
||||
|
||||
. Enable the table.
|
||||
+
|
||||
[source]
|
||||
----
|
||||
hbase> enable 'users'
|
||||
----
|
||||
|
||||
==== Using the Java API
|
||||
|
||||
Reload the table definition without setting the value of the coprocessor either by
|
||||
|
@ -440,7 +409,6 @@ String path = "hdfs://<namenode>:<port>/user/<hadoop-user>/coprocessor.jar";
|
|||
Configuration conf = HBaseConfiguration.create();
|
||||
Connection connection = ConnectionFactory.createConnection(conf);
|
||||
Admin admin = connection.getAdmin();
|
||||
admin.disableTable(tableName);
|
||||
HTableDescriptor hTableDescriptor = new HTableDescriptor(tableName);
|
||||
HColumnDescriptor columnFamily1 = new HColumnDescriptor("personalDet");
|
||||
columnFamily1.setMaxVersions(3);
|
||||
|
@ -449,7 +417,6 @@ HColumnDescriptor columnFamily2 = new HColumnDescriptor("salaryDet");
|
|||
columnFamily2.setMaxVersions(3);
|
||||
hTableDescriptor.addFamily(columnFamily2);
|
||||
admin.modifyTable(tableName, hTableDescriptor);
|
||||
admin.enableTable(tableName);
|
||||
----
|
||||
|
||||
In HBase 0.96 and newer, you can instead use the `removeCoprocessor()` method of the
|
||||
|
|
|
@ -59,11 +59,9 @@ attribute can have one of four values.
|
|||
* _EAGER_: This is _BASIC_ policy plus in-memory compaction of flushes (much like the on-disk compactions done to hfiles); on compaction we apply on-disk rules eliminating versions, duplicates, ttl'd cells, etc.
|
||||
* _ADAPTIVE_: Adaptive compaction adapts to the workload. It applies either index compaction or data compaction based on the ratio of duplicate cells in the data. Experimental.
|
||||
|
||||
To enable _BASIC_ on the _info_ column family in the table _radish_, disable the table and add the attribute to the _info_ column family, and then reenable:
|
||||
To enable _BASIC_ on the _info_ column family in the table _radish_, add the attribute to the _info_ column family:
|
||||
[source,ruby]
|
||||
----
|
||||
hbase(main):002:0> disable 'radish'
|
||||
Took 0.5570 seconds
|
||||
hbase(main):003:0> alter 'radish', {NAME => 'info', IN_MEMORY_COMPACTION => 'BASIC'}
|
||||
Updating all regions with the new schema...
|
||||
All regions updated.
|
||||
|
@ -77,8 +75,6 @@ COLUMN FAMILIES DESCRIPTION
|
|||
'IN_MEMORY_COMPACTION' => 'BASIC'}}
|
||||
1 row(s)
|
||||
Took 0.0239 seconds
|
||||
hbase(main):005:0> enable 'radish'
|
||||
Took 0.7537 seconds
|
||||
----
|
||||
Note how the IN_MEMORY_COMPACTION attribute shows as part of the _METADATA_ map.
|
||||
|
||||
|
|
Loading…
Reference in New Issue