hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enis Soztutar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-13273) Make Result.EMPTY_RESULT read-only; currently it can be modified
Date Tue, 24 Mar 2015 21:43:53 GMT

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

Enis Soztutar commented on HBASE-13273:

bq. I suggested that above, other folks liked the field better and I didn't feel strongly.
(the v5 patch is in master, branch-1, and branch-1.0 right now. I'm just waiting on Andrew's
decision to close.)
Sorry I skimmed through the comments in the jira, went directly to the patch. It seems what
we want is the Result object being immutable, but also having a Result.Builder to build immutable
Results. Main argument was that we do not want to pay the price (in heap) for all the Result
object which are normally not read only. 

> Make Result.EMPTY_RESULT read-only; currently it can be modified
> ----------------------------------------------------------------
>                 Key: HBASE-13273
>                 URL: https://issues.apache.org/jira/browse/HBASE-13273
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.98.0, 1.0.0
>            Reporter: stack
>            Assignee: Mikhail Antonov
>              Labels: beginner
>             Fix For: 2.0.0, 1.0.1, 1.1.0, 0.98.13
>         Attachments: HBASE-13273-v5.patch, HBASE-13273-v5.patch, HBASE-13273.patch, HBASE-13273.patch,
HBASE-13273.patch, HBASE-13273.patch
> Again from [~larsgeorge]
>     Result result2 = Result.EMPTY_RESULT;
>     System.out.println(result2);
>     result2.copyFrom(result1);
>     System.out.println(result2);
> "What do you think happens when result1 has cells? Yep, you just modified the shared
public EMPTY_RESULT to be not empty anymore."
> Fix. Result should be non-modifiable post-construction.

This message was sent by Atlassian JIRA

View raw message