You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Mingjie Lai (Commented) (JIRA)" <ji...@apache.org> on 2011/10/08 02:09:29 UTC
[jira] [Commented] (HBASE-4554) Allow set/unset coprocessor table
attributes from shell.
[ https://issues.apache.org/jira/browse/HBASE-4554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13123315#comment-13123315 ]
Mingjie Lai commented on HBASE-4554:
------------------------------------
@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.
{code}
alter 't1', METHOD => 'table_att', 'COPROCESSOR$1' => 'cp1', 'COPROCESSOR$2' => 'cp2'
{code}
Code change would be something like:
{code}
--- 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
+
{code}
> Allow set/unset coprocessor table attributes from shell.
> --------------------------------------------------------
>
> Key: HBASE-4554
> URL: https://issues.apache.org/jira/browse/HBASE-4554
> Project: HBase
> Issue Type: Improvement
> Components: coprocessors
> Reporter: Mingjie Lai
> Assignee: Mingjie Lai
> Fix For: 0.92.0
>
>
> 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:
> {code}
> 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', ...}
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira