You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Lars Hofhansl (JIRA)" <ji...@apache.org> on 2011/09/07 22:01:11 UTC
[jira] [Created] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Remove duplicated code from Put, Delete, Get, Scan, MultiPut
------------------------------------------------------------
Key: HBASE-4347
URL: https://issues.apache.org/jira/browse/HBASE-4347
Project: HBase
Issue Type: Improvement
Components: util
Affects Versions: 0.92.0
Reporter: Lars Hofhansl
Priority: Minor
Fix For: 0.92.0
This came from discussion with Stack w.r.t. HBASE-2195.
There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lars Hofhansl updated HBASE-4347:
---------------------------------
Attachment: 4347-v3.txt
New patch. Passes all test.
(That is, the few tests that fail locally, fail with or without the patch).
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347-v3.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lars Hofhansl updated HBASE-4347:
---------------------------------
Attachment: 4347-addendum.txt
Thanks Ted. Here it is.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-addendum.txt, 4347-v2.txt, 4347-v3.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13102131#comment-13102131 ]
Hudson commented on HBASE-4347:
-------------------------------
Integrated in HBase-TRUNK #2198 (See [https://builds.apache.org/job/HBase-TRUNK/2198/])
HBASE-4347 Remove duplicated code from Put, Delete, Get, Scan, MultiPut
stack :
Files :
* /hbase/trunk/CHANGES.txt
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Attributes.java
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Delete.java
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Get.java
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/OperationWithAttributes.java
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Put.java
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Scan.java
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347-v3.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103314#comment-13103314 ]
Ted Yu commented on HBASE-4347:
-------------------------------
Addendum integrated to TRUNK.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-addendum.txt, 4347-v2.txt, 4347-v3.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100609#comment-13100609 ]
Lars Hofhansl commented on HBASE-4347:
--------------------------------------
HBASE-2195 that is.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103411#comment-13103411 ]
Hudson commented on HBASE-4347:
-------------------------------
Integrated in HBase-TRUNK #2203 (See [https://builds.apache.org/job/HBase-TRUNK/2203/])
HBASE-4347 addendum that moves CLUSTER_ID_ATTR to Mutation
tedyu :
Files :
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/HConstants.java
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-addendum.txt, 4347-v2.txt, 4347-v3.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13102422#comment-13102422 ]
Lars Hofhansl commented on HBASE-4347:
--------------------------------------
I forgot one thing:
move
public static final String CLUSTER_ID_ATTR = "_c.id_";
from HConstants to Mutation.
Should I have a simple additional patch here, or a new issue, or just leave it?
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347-v3.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lars Hofhansl reassigned HBASE-4347:
------------------------------------
Assignee: Lars Hofhansl
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347-v3.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100957#comment-13100957 ]
Lars Hofhansl commented on HBASE-4347:
--------------------------------------
I can add the licenses. I haven't run all tests, yet. (Functionally nothing should have changed, but I might have missed a detail).
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack updated HBASE-4347:
-------------------------
Resolution: Fixed
Hadoop Flags: [Reviewed]
Status: Resolved (was: Patch Available)
Committed to TRUNK. Thanks for the cleanup Lars.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347-v3.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101538#comment-13101538 ]
Lars Hofhansl commented on HBASE-4347:
--------------------------------------
This change is causing a *significant* slowdown in some of the tests. I must have missed something...
Will report back when I found the problem.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lars Hofhansl updated HBASE-4347:
---------------------------------
Attachment: 4347.txt
This are the two things I have roughly in mind:
1. A simple OperationWithAttributes class (and Attributes interface) that all Operations that attributes extend (Get/Scan/Put/Delete).
2. A Mutation class. Extended by Put and Delete. All shared attributes are moved up into Mutation (as protected), and shared methods are move up.
While doing this I noticed a bunch differences between Put and Delete:
o Put.toMap does not include the timestamp.
o Put also has no setter for timestamp
o Delete has no numFamilies method
o Delete has no heapSize method.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack updated HBASE-4347:
-------------------------
Status: Patch Available (was: Open)
Marking as patch available.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100608#comment-13100608 ]
Lars Hofhansl commented on HBASE-4347:
--------------------------------------
HBASE-2105 be checked in first, because it add new shared members between Put and Delete, that should be into Mutation.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100940#comment-13100940 ]
stack commented on HBASE-4347:
------------------------------
Nice clean up Lars
Mutation needs a license as does OperationWithAttributes and Attributes.
I'm +1 on commit. I can add the licenses on commit.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103093#comment-13103093 ]
Ted Yu commented on HBASE-4347:
-------------------------------
@Lars:
If you can attach addendum, I can commit it.
Thanks
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347-v3.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101523#comment-13101523 ]
stack commented on HBASE-4347:
------------------------------
Mind running tests Lars? I can fix license on commit.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lars Hofhansl updated HBASE-4347:
---------------------------------
Attachment: 4347-v2.txt
Patch rebased for HBASE-2195.
There is a *lot* duplicate code removed now.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HBASE-4347) Remove duplicated code from Put,
Delete, Get, Scan, MultiPut
Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101557#comment-13101557 ]
Lars Hofhansl commented on HBASE-4347:
--------------------------------------
Found the problem. I had accidentally written readFields(in) instead of readAttributes(in) in Scan.readFields(in). So that would just wait forever for the stream... Running tests now.
> Remove duplicated code from Put, Delete, Get, Scan, MultiPut
> ------------------------------------------------------------
>
> Key: HBASE-4347
> URL: https://issues.apache.org/jira/browse/HBASE-4347
> Project: HBase
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.92.0
> Reporter: Lars Hofhansl
> Priority: Minor
> Fix For: 0.92.0
>
> Attachments: 4347-v2.txt, 4347.txt
>
>
> This came from discussion with Stack w.r.t. HBASE-2195.
> There is currently a lot of duplicated code especially between Put and Delete, and also between all Operations.
> For example all of Put/Delete/Get/Scan have attributes with exactly the same code in all classes.
> Put and Delete also have the familyMap, Row, Rowlock, Timestamp, etc.
> One way to do this is to introduce "OperationWithAttributes" which extends Operation, and have Put/Delete/Get/Scan extend that rather than Operation.
> In addition Put and Delete could extends from Mutation (which itself would extend OperationWithAttributes).
> If a static inheritance hierarchy is not desired here, we can use delegation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira