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

Appy commented on HBASE-20243:
------------------------------

QA still not happy. 

Would have been fine committing it if qa was green, but since there's gonna be 
another revision, here are couple minor suggestions on the table which'll lead 
to more maintainable code. It's upto you to take/leave them
 * In our design, shell tests are not run when we submit a patch to just 
hbase-server module. So if someone changes error message, your last two tests 
will start failing. Probably checking for just the exception type is enough.
 * *Prefer multiple small tests over one-for-all test*. It's easy to maintain 
since unittest code is more chunked -> easier to understand -> easier to fix 
when tests fail. For eg, if your current test fails in "test for existent 
destination table", someone will have to read through everything else before 
it....and that would be wasted effort since it's not needed and the test for 
'existent destination table' could have very well been a simple <10 lines 
separate test.
 * Prefer to use constant declared variables if it's value matters in multiple 
places. For eg. NUM_SPLITS=2, then init column families with it and use the 
same thing in asserts. Makes it easy to understand tests. Another examples is, 
consider random test with two figures - 10 and 50. 10 initializes something and 
we are asserting 50. It's not obvious if we are expecting test to assert 10+40 
or 10*5.
 * Avoid 
[coupling|https://en.wikipedia.org/wiki/Coupling_(computer_programming)] tests. 
If one breaks for weird reason, others might too. (ref: new_table = 
"test_clone_table_schema_table")

 

> [Shell] Add shell command to create a new table by cloning the existent table
> -----------------------------------------------------------------------------
>
>                 Key: HBASE-20243
>                 URL: https://issues.apache.org/jira/browse/HBASE-20243
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>            Reporter: Guangxu Cheng
>            Assignee: Guangxu Cheng
>            Priority: Minor
>             Fix For: 2.1.0
>
>         Attachments: HBASE-20243.master.001.patch, 
> HBASE-20243.master.002.patch, HBASE-20243.master.003.patch, 
> HBASE-20243.master.004.patch, HBASE-20243.master.005.patch, 
> HBASE-20243.master.006.patch, HBASE-20243.master.007.patch
>
>
> In the production environment, we need to create a new table every day. The 
> schema and the split keys of the table are the same as that of yesterday's 
> table, only the name of the table is different. For example, 
> xxxxx_20180321,xxxxx_20180322 etc.But now there is no convenient command to 
> do this. So we may need such a command(clone_table) to create a new table by 
> cloning the existent table.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to