HBase
  1. HBase
  2. HBASE-4554

Allow set/unset coprocessor table attributes from shell.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.92.0, 0.94.0
    • Component/s: Coprocessors
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Table/region level coprocessor – RegionObserver – can be configured by setting a HTD's attribute which matches Coprocessor$*.

      Current shell – alter – cannot support to set/unset a table's arbitrary attribute. We need it in order to configure region level coprocessors to a table.

      Proposed new shell:

      hbase shell > alter 't1', METHOD => 'table_att', COPROCESSOR$1 => 'hdfs://cp/foo.jar|org.apache.hadoop.hbase.sample|1|'
      
      hbase shell > describe 't1'
       {NAME => 't1', COPROCESSOR$1 => 'hdfs://cp/foo.jar|org.apache.hadoop.hbase.sample|1|', MAX_FILESIZE => '134217728', ...}
      
      hbase shell > alter 't1', METHOD => 'table_att_unset', COPROCESSOR$1
      
      hbase shell > describe 't1'
       {NAME => 't1', MAX_FILESIZE => '134217728', ...}
      

        Issue Links

          Activity

          Hide
          Ted Yu added a comment -

          This would be a useful feature.
          COPROCESSOR$1 needs to be defined as a constant if we follow example from src/main/ruby/hbase/admin.rb:

                 if method == "table_att"
                    htd.setMaxFileSize(JLong.valueOf(arg[MAX_FILESIZE])) if arg[MAX_FILESIZE]
          

          I think table_att method targets known table attributes.
          For HBASE-4554, we can introduce new method, e.g. table_dyn_att, which accepts two parameters: KEY and VALUE:

          hbase> alter 't1', {METHOD => 'table_dyn_att', KEY => 'COPROCESSOR$1', VALUE => 'hdfs://cp/foo.jar|org.apache.hadoop.hbase.sample|1|' }
          
          Show
          Ted Yu added a comment - This would be a useful feature. COPROCESSOR$1 needs to be defined as a constant if we follow example from src/main/ruby/hbase/admin.rb: if method == "table_att" htd.setMaxFileSize(JLong.valueOf(arg[MAX_FILESIZE])) if arg[MAX_FILESIZE] I think table_att method targets known table attributes. For HBASE-4554 , we can introduce new method, e.g. table_dyn_att, which accepts two parameters: KEY and VALUE: hbase> alter 't1', {METHOD => 'table_dyn_att', KEY => 'COPROCESSOR$1', VALUE => 'hdfs: //cp/foo.jar|org.apache.hadoop.hbase.sample|1|' }
          Hide
          Mingjie Lai added a comment -

          Rename the jira title from ``Allow set/unset arbitrary table attributes from shell.'' ``Allow set/unset coprocessor table attributes from shell.''.

          Show
          Mingjie Lai added a comment - Rename the jira title from ``Allow set/unset arbitrary table attributes from shell.'' ``Allow set/unset coprocessor table attributes from shell.''.
          Hide
          Mingjie Lai added a comment -

          @Ted. I changed the title so this jira only deals with cp related htd attributes (no more arbitrary). I still prefer to utilizing the existing table_att method so we can add/change multiple attributes at one time.

          alter 't1', METHOD => 'table_att', 'COPROCESSOR$1' => 'cp1', 'COPROCESSOR$2' => 'cp2'
          

          Code change would be something like:

          --- a/src/main/ruby/hbase/admin.rb
          +++ b/src/main/ruby/hbase/admin.rb
          @@ -359,6 +359,16 @@ module Hbase
             htd.setReadOnly(JBoolean.valueOf(arg[READONLY])) if arg[READONLY]
             htd.setMemStoreFlushSize(JLong.valueOf(arg[MEMSTORE_FLUSHSIZE])) if arg[MEMSTORE_FLUSHSIZE]
             htd.setDeferredLogFlush(JBoolean.valueOf(arg[DEFERRED_LOG_FLUSH])) if arg[DEFERRED_LOG_FLUSH]
          +
          +  # set a coprocessor attribute
          +  if arg.kind_of?(Hash)
          +    arg.each do |key, value|
          +      k = String.new(key) # prepare to strip
          +      k.strip!
          +      htd.setValue(k, value) if (k =~ /coprocessor\$[0-9]*/i)
          +    end
          +  end
          +  
          
          Show
          Mingjie Lai added a comment - @Ted. I changed the title so this jira only deals with cp related htd attributes (no more arbitrary). I still prefer to utilizing the existing table_att method so we can add/change multiple attributes at one time. alter 't1', METHOD => 'table_att', 'COPROCESSOR$1' => 'cp1', 'COPROCESSOR$2' => 'cp2' Code change would be something like: --- a/src/main/ruby/hbase/admin.rb +++ b/src/main/ruby/hbase/admin.rb @@ -359,6 +359,16 @@ module Hbase htd.setReadOnly(JBoolean.valueOf(arg[READONLY])) if arg[READONLY] htd.setMemStoreFlushSize(JLong.valueOf(arg[MEMSTORE_FLUSHSIZE])) if arg[MEMSTORE_FLUSHSIZE] htd.setDeferredLogFlush(JBoolean.valueOf(arg[DEFERRED_LOG_FLUSH])) if arg[DEFERRED_LOG_FLUSH] + + # set a coprocessor attribute + if arg.kind_of?(Hash) + arg.each do |key, value| + k = String . new (key) # prepare to strip + k.strip! + htd.setValue(k, value) if (k =~ /coprocessor\$[0-9]*/i) + end + end +
          Hide
          Andrew Purtell added a comment -

          As originally conceived, the 'COPROCESSOR$' prefix for a table attribute name informs the coprocessor host that the attribute contains a coprocessor specification, and what follows the prefix can be arbitrary. For example, all are equally valid:

          • COPROCESSOR$1
          • COPROCESSOR$8453410222
          • COPROCESSOR$FooBar
          • COPROCESSOR$org.apache.hbase.foo.bar.Baz

          Offhand I'm not sure if the code supports this, but it should.

          Show
          Andrew Purtell added a comment - As originally conceived, the 'COPROCESSOR$' prefix for a table attribute name informs the coprocessor host that the attribute contains a coprocessor specification, and what follows the prefix can be arbitrary. For example, all are equally valid: COPROCESSOR$1 COPROCESSOR$8453410222 COPROCESSOR$FooBar COPROCESSOR$org.apache.hbase.foo.bar.Baz Offhand I'm not sure if the code supports this, but it should.
          Hide
          jiraposter@reviews.apache.org added a comment -

          -----------------------------------------------------------
          This is an automatically generated e-mail. To reply, visit:
          https://reviews.apache.org/r/2350/
          -----------------------------------------------------------

          Review request for hbase and Gary Helmling.

          Summary
          -------

          Features:

          • Support adding table level coprocessors – regionobserver and endpoint – from shell.
          • Support removing table attributes from shell.

          Introduced shell comands:

          hbase> alter 't1', METHOD => 'table_att', \
          'coprocessor$1'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||', \
          'coprocessor$2'=>'hdfs://foo.jar|com.foo.FooRegionObserver|1001|'

          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE'
          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1'

          This addresses bug HBASE-4554.
          https://issues.apache.org/jira/browse/HBASE-4554

          Diffs


          src/main/java/org/apache/hadoop/hbase/HConstants.java 3af1bf0
          src/main/ruby/hbase/admin.rb b244ffe
          src/main/ruby/shell/commands/alter.rb ee3668d
          src/test/ruby/hbase/admin_test.rb 5e491e4

          Diff: https://reviews.apache.org/r/2350/diff

          Testing
          -------

          Test passed after applied HBase-4555 patch locally.

          Thanks,

          Mingjie

          Show
          jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/2350/ ----------------------------------------------------------- Review request for hbase and Gary Helmling. Summary ------- Features: Support adding table level coprocessors – regionobserver and endpoint – from shell. Support removing table attributes from shell. Introduced shell comands: hbase> alter 't1', METHOD => 'table_att', \ 'coprocessor$1'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||', \ 'coprocessor$2'=>'hdfs://foo.jar|com.foo.FooRegionObserver|1001|' hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE' hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1' This addresses bug HBASE-4554 . https://issues.apache.org/jira/browse/HBASE-4554 Diffs src/main/java/org/apache/hadoop/hbase/HConstants.java 3af1bf0 src/main/ruby/hbase/admin.rb b244ffe src/main/ruby/shell/commands/alter.rb ee3668d src/test/ruby/hbase/admin_test.rb 5e491e4 Diff: https://reviews.apache.org/r/2350/diff Testing ------- Test passed after applied HBase-4555 patch locally. Thanks, Mingjie
          Hide
          jiraposter@reviews.apache.org added a comment -

          -----------------------------------------------------------
          This is an automatically generated e-mail. To reply, visit:
          https://reviews.apache.org/r/2350/
          -----------------------------------------------------------

          (Updated 2011-10-12 21:19:35.586880)

          Review request for hbase and Gary Helmling.

          Changes
          -------

          Updated the patch after merging HBase-4555.

          Summary
          -------

          Features:

          • Support adding table level coprocessors – regionobserver and endpoint – from shell.
          • Support removing table attributes from shell.

          Introduced shell comands:

          hbase> alter 't1', METHOD => 'table_att', \
          'coprocessor$1'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||', \
          'coprocessor$2'=>'hdfs://foo.jar|com.foo.FooRegionObserver|1001|'

          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE'
          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1'

          This addresses bug HBASE-4554.
          https://issues.apache.org/jira/browse/HBASE-4554

          Diffs (updated)


          src/main/java/org/apache/hadoop/hbase/HConstants.java 3af1bf0
          src/main/ruby/hbase/admin.rb b244ffe
          src/main/ruby/shell/commands/alter.rb ee3668d
          src/test/ruby/hbase/admin_test.rb 9a096e4

          Diff: https://reviews.apache.org/r/2350/diff

          Testing
          -------

          Test passed after applied HBase-4555 patch locally.

          Thanks,

          Mingjie

          Show
          jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/2350/ ----------------------------------------------------------- (Updated 2011-10-12 21:19:35.586880) Review request for hbase and Gary Helmling. Changes ------- Updated the patch after merging HBase-4555. Summary ------- Features: Support adding table level coprocessors – regionobserver and endpoint – from shell. Support removing table attributes from shell. Introduced shell comands: hbase> alter 't1', METHOD => 'table_att', \ 'coprocessor$1'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||', \ 'coprocessor$2'=>'hdfs://foo.jar|com.foo.FooRegionObserver|1001|' hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE' hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1' This addresses bug HBASE-4554 . https://issues.apache.org/jira/browse/HBASE-4554 Diffs (updated) src/main/java/org/apache/hadoop/hbase/HConstants.java 3af1bf0 src/main/ruby/hbase/admin.rb b244ffe src/main/ruby/shell/commands/alter.rb ee3668d src/test/ruby/hbase/admin_test.rb 9a096e4 Diff: https://reviews.apache.org/r/2350/diff Testing ------- Test passed after applied HBase-4555 patch locally. Thanks, Mingjie
          Hide
          Ted Yu added a comment -

          Looking at HTableDescriptor.addCoprocessor(), we compute maxCoprocessorNumber and assign it as ordinal for the coprocessor class.
          I wonder if the ordinal in the 'coprocessor$' examples for 'table_att' could be omitted. We can resort to the following method in HTD:

            public void addCoprocessor(String className) throws IOException {
          
          Show
          Ted Yu added a comment - Looking at HTableDescriptor.addCoprocessor(), we compute maxCoprocessorNumber and assign it as ordinal for the coprocessor class. I wonder if the ordinal in the 'coprocessor$' examples for 'table_att' could be omitted. We can resort to the following method in HTD: public void addCoprocessor( String className) throws IOException {
          Hide
          Mingjie Lai added a comment -

          @Ted. As we original proposed, we can add arbitrary content after coprocessor$. You suggested to only use (auto-generated) number after $. Either way should work.

          Show
          Mingjie Lai added a comment - @Ted. As we original proposed, we can add arbitrary content after coprocessor$. You suggested to only use (auto-generated) number after $. Either way should work.
          Hide
          jiraposter@reviews.apache.org added a comment -

          -----------------------------------------------------------
          This is an automatically generated e-mail. To reply, visit:
          https://reviews.apache.org/r/2350/
          -----------------------------------------------------------

          (Updated 2011-11-08 23:00:41.226897)

          Review request for hbase and Gary Helmling.

          Changes
          -------

          I had an offline discussion with Ted. And he recommend to have a way to generate coprocessor key ordinal in an automatic way, so users don't have to worry about it.

          The shell commands are changed to:
          hbase> alter 't1', METHOD => 'table_att', \
          'coprocessor'=>'hdfs:///foo.jar|com.sample.foo|1|'

          hbase> describe 't1'
          DESCRIPTION ENABLED
          {NAME => 't1', coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo| true
          1|', FAMILIES => [

          {NAME => 'c1', BLOOMFILTER => 'NONE', REPLICAT ION_SCOPE => '0', VERSIONS => '3', COMPRESSION => 'NONE', MIN_VE RSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false ', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'tr ue'}

          ]}
          1 row(s) in 0.0330 seconds

          hbase> alter 't1', METHOD => 'table_att', \
          'coprocessor'=>'hdfs:///foo2.jar|com.sample.foo2|2|'

          hbase(main):006:0> describe 't1' DESCRIPTION ENABLED
          {NAME => 't1', coprocessor$2 => 'hdfs:///foo2.jar|com.sample.foo true
          2|2|', coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo|1|', FAM
          ILIES => [

          {NAME => 'c1', BLOOMFILTER => 'NONE', REPLICATION_SCOP E => '0', VERSIONS => '3', COMPRESSION => 'NONE', MIN_VERSIONS = > '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false', BLOCK SIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}

          ]}
          1 row(s) in 0.0220 seconds

          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1'

          Summary (updated)
          -------

          Features:

          • Support adding table level coprocessors – regionobserver and endpoint – from shell.
          • Support removing table attributes from shell.

          Introduced shell comands:

          hbase> alter 't1', METHOD => 'table_att', \
          'coprocessor'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||'

          coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo|1' will be added to htd. So that cp framework can load the cp later on.

          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE'
          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1'

          This addresses bug HBASE-4554.
          https://issues.apache.org/jira/browse/HBASE-4554

          Diffs (updated)


          src/main/java/org/apache/hadoop/hbase/HConstants.java 76278a2
          src/main/ruby/hbase/admin.rb 61e04d8
          src/main/ruby/shell/commands/alter.rb ee3668d
          src/test/ruby/hbase/admin_test.rb df88100

          Diff: https://reviews.apache.org/r/2350/diff

          Testing
          -------

          Test passed after applied HBase-4555 patch locally.

          Thanks,

          Mingjie

          Show
          jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/2350/ ----------------------------------------------------------- (Updated 2011-11-08 23:00:41.226897) Review request for hbase and Gary Helmling. Changes ------- I had an offline discussion with Ted. And he recommend to have a way to generate coprocessor key ordinal in an automatic way, so users don't have to worry about it. The shell commands are changed to: hbase> alter 't1', METHOD => 'table_att', \ 'coprocessor'=>'hdfs:///foo.jar|com.sample.foo|1|' hbase> describe 't1' DESCRIPTION ENABLED {NAME => 't1', coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo| true 1|', FAMILIES => [ {NAME => 'c1', BLOOMFILTER => 'NONE', REPLICAT ION_SCOPE => '0', VERSIONS => '3', COMPRESSION => 'NONE', MIN_VE RSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false ', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'tr ue'} ]} 1 row(s) in 0.0330 seconds hbase> alter 't1', METHOD => 'table_att', \ 'coprocessor'=>'hdfs:///foo2.jar|com.sample.foo2|2|' hbase(main):006:0> describe 't1' DESCRIPTION ENABLED {NAME => 't1', coprocessor$2 => 'hdfs:///foo2.jar|com.sample.foo true 2|2|', coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo|1|', FAM ILIES => [ {NAME => 'c1', BLOOMFILTER => 'NONE', REPLICATION_SCOP E => '0', VERSIONS => '3', COMPRESSION => 'NONE', MIN_VERSIONS = > '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false', BLOCK SIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'} ]} 1 row(s) in 0.0220 seconds hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1' Summary (updated) ------- Features: Support adding table level coprocessors – regionobserver and endpoint – from shell. Support removing table attributes from shell. Introduced shell comands: hbase> alter 't1', METHOD => 'table_att', \ 'coprocessor'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||' coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo|1' will be added to htd. So that cp framework can load the cp later on. hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE' hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1' This addresses bug HBASE-4554 . https://issues.apache.org/jira/browse/HBASE-4554 Diffs (updated) src/main/java/org/apache/hadoop/hbase/HConstants.java 76278a2 src/main/ruby/hbase/admin.rb 61e04d8 src/main/ruby/shell/commands/alter.rb ee3668d src/test/ruby/hbase/admin_test.rb df88100 Diff: https://reviews.apache.org/r/2350/diff Testing ------- Test passed after applied HBase-4555 patch locally. Thanks, Mingjie
          Hide
          jiraposter@reviews.apache.org added a comment -

          -----------------------------------------------------------
          This is an automatically generated e-mail. To reply, visit:
          https://reviews.apache.org/r/2350/#review3121
          -----------------------------------------------------------

          Thanks for the improved syntax.

          src/main/java/org/apache/hadoop/hbase/HConstants.java
          <https://reviews.apache.org/r/2350/#comment6937>

          We still assume numerals to follow dollar sign. Why is this change needed ?

          • Ted

          On 2011-11-08 23:00:41, Mingjie Lai wrote:

          -----------------------------------------------------------

          This is an automatically generated e-mail. To reply, visit:

          https://reviews.apache.org/r/2350/

          -----------------------------------------------------------

          (Updated 2011-11-08 23:00:41)

          Review request for hbase and Gary Helmling.

          Summary

          -------

          Features:

          - Support adding table level coprocessors – regionobserver and endpoint – from shell.

          - Support removing table attributes from shell.

          Introduced shell comands:

          hbase> alter 't1', METHOD => 'table_att', \

          'coprocessor'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||'

          coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo|1' will be added to htd. So that cp framework can load the cp later on.

          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE'

          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1'

          This addresses bug HBASE-4554.

          https://issues.apache.org/jira/browse/HBASE-4554

          Diffs

          -----

          src/main/java/org/apache/hadoop/hbase/HConstants.java 76278a2

          src/main/ruby/hbase/admin.rb 61e04d8

          src/main/ruby/shell/commands/alter.rb ee3668d

          src/test/ruby/hbase/admin_test.rb df88100

          Diff: https://reviews.apache.org/r/2350/diff

          Testing

          -------

          Test passed after applied HBase-4555 patch locally.

          Thanks,

          Mingjie

          Show
          jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/2350/#review3121 ----------------------------------------------------------- Thanks for the improved syntax. src/main/java/org/apache/hadoop/hbase/HConstants.java < https://reviews.apache.org/r/2350/#comment6937 > We still assume numerals to follow dollar sign. Why is this change needed ? Ted On 2011-11-08 23:00:41, Mingjie Lai wrote: ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/2350/ ----------------------------------------------------------- (Updated 2011-11-08 23:00:41) Review request for hbase and Gary Helmling. Summary ------- Features: - Support adding table level coprocessors – regionobserver and endpoint – from shell. - Support removing table attributes from shell. Introduced shell comands: hbase> alter 't1', METHOD => 'table_att', \ 'coprocessor'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||' coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo|1' will be added to htd. So that cp framework can load the cp later on. hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE' hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1' This addresses bug HBASE-4554 . https://issues.apache.org/jira/browse/HBASE-4554 Diffs ----- src/main/java/org/apache/hadoop/hbase/HConstants.java 76278a2 src/main/ruby/hbase/admin.rb 61e04d8 src/main/ruby/shell/commands/alter.rb ee3668d src/test/ruby/hbase/admin_test.rb df88100 Diff: https://reviews.apache.org/r/2350/diff Testing ------- Test passed after applied HBase-4555 patch locally. Thanks, Mingjie
          Hide
          jiraposter@reviews.apache.org added a comment -

          -----------------------------------------------------------
          This is an automatically generated e-mail. To reply, visit:
          https://reviews.apache.org/r/2350/
          -----------------------------------------------------------

          (Updated 2011-11-09 07:01:14.224310)

          Review request for hbase and Gary Helmling.

          Changes
          -------

          Minor update by Ted's comments.

          Summary
          -------

          Features:

          • Support adding table level coprocessors – regionobserver and endpoint – from shell.
          • Support removing table attributes from shell.

          Introduced shell comands:

          hbase> alter 't1', METHOD => 'table_att', \
          'coprocessor'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||'

          coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo|1' will be added to htd. So that cp framework can load the cp later on.

          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE'
          hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1'

          This addresses bug HBASE-4554.
          https://issues.apache.org/jira/browse/HBASE-4554

          Diffs (updated)


          src/main/java/org/apache/hadoop/hbase/HConstants.java 76278a2
          src/main/ruby/hbase/admin.rb 61e04d8
          src/main/ruby/shell/commands/alter.rb ee3668d
          src/test/ruby/hbase/admin_test.rb df88100

          Diff: https://reviews.apache.org/r/2350/diff

          Testing
          -------

          Test passed after applied HBase-4555 patch locally.

          Thanks,

          Mingjie

          Show
          jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/2350/ ----------------------------------------------------------- (Updated 2011-11-09 07:01:14.224310) Review request for hbase and Gary Helmling. Changes ------- Minor update by Ted's comments. Summary ------- Features: Support adding table level coprocessors – regionobserver and endpoint – from shell. Support removing table attributes from shell. Introduced shell comands: hbase> alter 't1', METHOD => 'table_att', \ 'coprocessor'=>'|org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver||' coprocessor$1 => 'hdfs:///foo.jar|com.sample.foo|1' will be added to htd. So that cp framework can load the cp later on. hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE' hbase> alter 't1', METHOD => 'table_att_unset', NAME => 'coprocessor$1' This addresses bug HBASE-4554 . https://issues.apache.org/jira/browse/HBASE-4554 Diffs (updated) src/main/java/org/apache/hadoop/hbase/HConstants.java 76278a2 src/main/ruby/hbase/admin.rb 61e04d8 src/main/ruby/shell/commands/alter.rb ee3668d src/test/ruby/hbase/admin_test.rb df88100 Diff: https://reviews.apache.org/r/2350/diff Testing ------- Test passed after applied HBase-4555 patch locally. Thanks, Mingjie
          Hide
          Ted Yu added a comment -

          +1 on latest patch.

          Show
          Ted Yu added a comment - +1 on latest patch.
          Hide
          Andrew Purtell added a comment -

          Committed latest version of patch. TestShell passes. I slightly edited the help text English so it is more clear.

          Show
          Andrew Purtell added a comment - Committed latest version of patch. TestShell passes. I slightly edited the help text English so it is more clear.
          Hide
          Hudson added a comment -

          Integrated in HBase-0.92 #122 (See https://builds.apache.org/job/HBase-0.92/122/)
          HBASE-4554 Allow set/unset coprocessor table attributes from shell (Mingjie Lai)

          apurtell :
          Files :

          • /hbase/branches/0.92/CHANGES.txt
          • /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HConstants.java
          • /hbase/branches/0.92/src/main/ruby/hbase/admin.rb
          • /hbase/branches/0.92/src/main/ruby/shell/commands/alter.rb
          • /hbase/branches/0.92/src/test/ruby/hbase/admin_test.rb
          Show
          Hudson added a comment - Integrated in HBase-0.92 #122 (See https://builds.apache.org/job/HBase-0.92/122/ ) HBASE-4554 Allow set/unset coprocessor table attributes from shell (Mingjie Lai) apurtell : Files : /hbase/branches/0.92/CHANGES.txt /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HConstants.java /hbase/branches/0.92/src/main/ruby/hbase/admin.rb /hbase/branches/0.92/src/main/ruby/shell/commands/alter.rb /hbase/branches/0.92/src/test/ruby/hbase/admin_test.rb
          Hide
          Hudson added a comment -

          Integrated in HBase-TRUNK #2426 (See https://builds.apache.org/job/HBase-TRUNK/2426/)
          HBASE-4554 Allow set/unset coprocessor table attributes from shell (Mingjie Lai)

          apurtell :
          Files :

          • /hbase/trunk/CHANGES.txt
          • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/HConstants.java
          • /hbase/trunk/src/main/ruby/hbase/admin.rb
          • /hbase/trunk/src/main/ruby/shell/commands/alter.rb
          • /hbase/trunk/src/test/ruby/hbase/admin_test.rb
          Show
          Hudson added a comment - Integrated in HBase-TRUNK #2426 (See https://builds.apache.org/job/HBase-TRUNK/2426/ ) HBASE-4554 Allow set/unset coprocessor table attributes from shell (Mingjie Lai) apurtell : Files : /hbase/trunk/CHANGES.txt /hbase/trunk/src/main/java/org/apache/hadoop/hbase/HConstants.java /hbase/trunk/src/main/ruby/hbase/admin.rb /hbase/trunk/src/main/ruby/shell/commands/alter.rb /hbase/trunk/src/test/ruby/hbase/admin_test.rb
          Hide
          Harsh J added a comment -

          Attaching the patch that was committed to the ticket for persistence.

          (Disclaimer: I'm not the author of the patch. I merely grabbed it from https://reviews.apache.org/r/2350/diff/raw/ so that it exists as an object in the issue tracker. I'm hence not checking the grant button.)

          Show
          Harsh J added a comment - Attaching the patch that was committed to the ticket for persistence. (Disclaimer: I'm not the author of the patch. I merely grabbed it from https://reviews.apache.org/r/2350/diff/raw/ so that it exists as an object in the issue tracker. I'm hence not checking the grant button.)

            People

            • Assignee:
              Mingjie Lai
              Reporter:
              Mingjie Lai
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development