[ 
https://issues.apache.org/jira/browse/HBASE-6894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487146#comment-13487146
 ] 

stack commented on HBASE-6894:
------------------------------

The doc on the alter and create help is nice and clean.  Thanks.

What does this do in the alter help screen?

  hbase> alter 't1', 'f1', {NAME => 'f2', IN_MEMORY => true}, 'f3'


Did you add the new delete method?  Thats nicer.  I'd say don't mention the old 
method at all in the help:


  hbase> alter 't1', NAME => 'f1', METHOD => 'delete'
  hbase> alter 't1', 'delete' => 'f1'


Is this right?

You can also change table-scope attributes like MAX_FILESIZE, READONLY, 
MEMSTORE_FLUSHSIZE, DEFERRED_LOG_FLUSH, etc. These can be put at the end;
for example, to change the max size of a family to 128MB, do:

  hbase> alter 't1', MAX_FILESIZE => '134217728'

Says change max filesize of family but its for the table?


We have to keep table_att for the below?

  hbase> alter 't1', METHOD => 'table_att',
    
'coprocessor'=>'hdfs:///foo.jar|com.foo.FooRegionObserver|1001|arg1=1,arg2=2'


Do you think CONFIG a good name for the 'dictionary' that can be in 
HTableDescriptor and HColumnDescriptor?  Would DICT or DICTIONARY or MAP be 
better names than CONFIG?  For example, in the below:

  hbase> alter 't1', { NAME => 'f1', VERSIONS => 3 }, 
   { MAX_FILESIZE => '134217728' }, { METHOD => 'delete', NAME => 'f2' },
   OWNER => 'johndoe', CONFIG => { 'mykey' => 'myvalue' }

Should the CONFIG on the end be DICT?  or MAP?

I created a table with some table attributes.  When I describe it, the METHOD 
=> 'table_att' is a little confusing I'd say?  Do we have to have that METHOD 
=> 'table_att' in there?  Could be a dictionary named 'table_att'?  or 'table 
_attributes'?

I was thinking I could add a new table attribute 'METADATA' doing the following 
but fails.  Should I be able too?

hbase(main):007:0> create 'y', {NAME => 'x', CONFIG => {'xx' => 'yy'}}, OWNER 
=> 'jim', 'METADATA' => 'xyz', CONFIG => {'aa' => 'bb'}
An argument ignored (unknown or overridden): METADATA
0 row(s) in 1.0470 seconds

This is nice:

hbase(main):009:0> create 'z', {NAME => 'x', CONFIG => {'xx' => 'yy'}}, OWNER 
=> 'jim', CONFIG => {'METADATA' => 'xyz', 'USAGE' => 'usage', 'aa' => 'bb'}
0 row(s) in 1.0440 seconds

=> Hbase::Table - z
hbase(main):010:0> describe 'z'
DESCRIPTION                                                                     
                                                    ENABLED                     
                                            
 'z', {METHOD => 'table_att', CONFIG => {'METADATA' => 'xyz', 'OWNER' => 'jim', 
'USAGE' => 'usage', 'aa' => 'bb'}}, {NAME => 'x', D true                        
                                            
 ATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE', TTL => '2147483647', 
IN_MEMORY => 'false', REPLICATION_SCOPE => '0', VERSIONS                        
                                                 
  => '3', COMPRESSION => 'NONE', MIN_VERSIONS => '0', KEEP_DELETED_CELLS => 
'false', BLOCKSIZE => '65536', ENCODE_ON_DISK => 'true'                         
                                                
 , BLOCKCACHE => 'true', CONFIG => {'xx' => 'yy'}}                              
                                                                                
                                            
1 row(s) in 0.0310 seconds

You have fixed the original issue.  Thanks.

I think it'd be good if could fix how the above is displayed when I do 
describe.  The original CONFIG way of naming the dictionary I think confusing 
and worth replacing and the tostring which shows table dictionary stuff as a 
METHOD =>'table_att' is a little odd.

This is great:


hbase(main):011:0> disable 'z'
0 row(s) in 7.0600 seconds

hbase(main):012:0> alter 'z', OWNER => 'sergey'
Updating all regions with the new schema...
1/1 regions updated.
Done.
0 row(s) in 6.0810 seconds

hbase(main):013:0> describe 'z'
DESCRIPTION                                                                     
                                                    ENABLED                     
                                            
 'z', {METHOD => 'table_att', CONFIG => {'METADATA' => 'xyz', 'OWNER' => 
'sergey', 'USAGE' => 'usage', 'aa' => 'bb'}}, {NAME => 'x' false                
                                                   
 , DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE', TTL => '2147483647', 
IN_MEMORY => 'false', REPLICATION_SCOPE => '0', VERSI                           
                                              
 ONS => '3', COMPRESSION => 'NONE', MIN_VERSIONS => '0', KEEP_DELETED_CELLS => 
'false', BLOCKSIZE => '65536', ENCODE_ON_DISK => 'tr                            
                                             
 ue', BLOCKCACHE => 'true', CONFIG => {'xx' => 'yy'}}                           
                                                                                
                                            
1 row(s) in 0.0280 seconds

hbase(main):016:0> alter 'z', CONFIG => {'USAGE' => 'more'}

Updating all regions with the new schema...
1/1 regions updated.
Done.
0 row(s) in 6.0690 seconds

hbase(main):017:0> 
hbase(main):018:0* describe 'z'
DESCRIPTION                                                                     
                                                    ENABLED                     
                                            
 'z', {METHOD => 'table_att', CONFIG => {'METADATA' => 'xyz', 'OWNER' => 
'sergey', 'USAGE' => 'more', 'aa' => 'bb'}}, {NAME => 'x', false                
                                                   
  DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE', TTL => '2147483647', 
IN_MEMORY => 'false', REPLICATION_SCOPE => '0', VERSIO                          
                                               
 NS => '3', COMPRESSION => 'NONE', MIN_VERSIONS => '0', KEEP_DELETED_CELLS => 
'false', BLOCKSIZE => '65536', ENCODE_ON_DISK => 'tru                           
                                              
 e', BLOCKCACHE => 'true', CONFIG => {'xx' => 'yy'}}                            
                                                                                
                                            
1 row(s) in 0.0270 seconds

Big improvement.

                
> Adding metadata to a table in the shell is both arcane and painful
> ------------------------------------------------------------------
>
>                 Key: HBASE-6894
>                 URL: https://issues.apache.org/jira/browse/HBASE-6894
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 0.96.0
>            Reporter: stack
>            Assignee: Sergey Shelukhin
>              Labels: noob
>         Attachments: HBASE-6894.patch, HBASE-6894.patch, HBASE-6894.patch, 
> HBASE-6894-v2.patch, HBASE-6894-v3.1-squashed.patch, 
> HBASE-6894-v3-squashed.patch
>
>
> In production we have hundreds of tables w/ whack names like 'aliaserv', 
> 'ashish_bulk', 'age_gender_topics', etc.  It be grand if you could look in 
> master UI and see stuff like owner, eng group responsible, miscellaneous 
> description, etc.
> Now, HTD has support for this; each carries a dictionary.  Whats a PITA 
> though is adding attributes to the dictionary.  Here is what seems to work on 
> trunk (though I do not trust it is doing the right thing):
> {code}
> hbase> create 'SOME_TABLENAME', {NAME => 'd', VERSION => 1, COMPRESSION => 
> 'LZO'}
> hbase> # Here is how I added metadata
> hbase> disable 'SOME_TABLENAME'
> hbase> alter 'SOME_TABLENAME', METHOD => 'table_att', OWNER => 'SOMEON', 
> CONFIG => {'ENVIRONMENT' => 'BLAH BLAH', 'SIZING' => 'The size should be 
> between 0-10K most of the time with new URLs coming in and getting removed as 
> they are processed unless the pipeline has fallen behind', 'MISCELLANEOUS' => 
> 'Holds the list of URLs waiting to be processed in the parked page detection 
> analyzer in ingestion pipeline.'}
> ...
> describe...
> enable...
> {code}
> The above doesn't work in 0.94.  Complains about the CONFIG, the keyword we 
> are using for the HTD dictionary.
> It works in 0.96 though I'd have to poke around some more to ensure it is 
> doing the right thing.
> But this METHOD => 'table_att' stuff is really ugly.... can we fix it?
> And I can't add table attributes on table create seemingly.
> A little bit of thought and a bit of ruby could clean this all up.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to