[jira] [Updated] (HBASE-17034) avoid unnecessary Get copy in HTable#exist
[ https://issues.apache.org/jira/browse/HBASE-17034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chia-Ping Tsai updated HBASE-17034: --- Resolution: Not A Problem Status: Resolved (was: Patch Available) > avoid unnecessary Get copy in HTable#exist > -- > > Key: HBASE-17034 > URL: https://issues.apache.org/jira/browse/HBASE-17034 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0 >Reporter: Chia-Ping Tsai >Assignee: Chia-Ping Tsai >Priority: Minor > Fix For: 2.0.0 > > Attachments: HBASE-17034.v0.patch > > > {code:title=HTable.java|borderStyle=solid} > private Result get(Get get, final boolean checkExistenceOnly) throws > IOException { > if (get.isCheckExistenceOnly() != checkExistenceOnly || > get.getConsistency() == null) { > get = ReflectionUtils.newInstance(get.getClass(), get); > get.setCheckExistenceOnly(checkExistenceOnly); > if (get.getConsistency() == null){ > get.setConsistency(defaultConsistency); > } > } > ... > } > {code} > Can the passed Get be modified? If so, we can just change the passed Get. If > not, we can record the values returned by isCheckExistenceOnly() and > getConsistency() for avoiding the Get copy. > It seems to me that it is ok to modify the passed Get. > Any comment? Thanks. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17034) avoid unnecessary Get copy in HTable#exist
[ https://issues.apache.org/jira/browse/HBASE-17034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ChiaPing Tsai updated HBASE-17034: -- Attachment: HBASE-17034.v0.patch > avoid unnecessary Get copy in HTable#exist > -- > > Key: HBASE-17034 > URL: https://issues.apache.org/jira/browse/HBASE-17034 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0 >Reporter: ChiaPing Tsai >Priority: Minor > Fix For: 2.0.0 > > Attachments: HBASE-17034.v0.patch > > > {code:title=HTable.java|borderStyle=solid} > private Result get(Get get, final boolean checkExistenceOnly) throws > IOException { > if (get.isCheckExistenceOnly() != checkExistenceOnly || > get.getConsistency() == null) { > get = ReflectionUtils.newInstance(get.getClass(), get); > get.setCheckExistenceOnly(checkExistenceOnly); > if (get.getConsistency() == null){ > get.setConsistency(defaultConsistency); > } > } > ... > } > {code} > Can the passed Get be modified? If so, we can just change the passed Get. If > not, we can record the values returned by isCheckExistenceOnly() and > getConsistency() for avoiding the Get copy. > It seems to me that it is ok to modify the passed Get. > Any comment? Thanks. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HBASE-17034) avoid unnecessary Get copy in HTable#exist
[ https://issues.apache.org/jira/browse/HBASE-17034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ChiaPing Tsai updated HBASE-17034: -- Assignee: ChiaPing Tsai Fix Version/s: 2.0.0 Affects Version/s: 2.0.0 Status: Patch Available (was: Open) > avoid unnecessary Get copy in HTable#exist > -- > > Key: HBASE-17034 > URL: https://issues.apache.org/jira/browse/HBASE-17034 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0 >Reporter: ChiaPing Tsai >Assignee: ChiaPing Tsai >Priority: Minor > Fix For: 2.0.0 > > Attachments: HBASE-17034.v0.patch > > > {code:title=HTable.java|borderStyle=solid} > private Result get(Get get, final boolean checkExistenceOnly) throws > IOException { > if (get.isCheckExistenceOnly() != checkExistenceOnly || > get.getConsistency() == null) { > get = ReflectionUtils.newInstance(get.getClass(), get); > get.setCheckExistenceOnly(checkExistenceOnly); > if (get.getConsistency() == null){ > get.setConsistency(defaultConsistency); > } > } > ... > } > {code} > Can the passed Get be modified? If so, we can just change the passed Get. If > not, we can record the values returned by isCheckExistenceOnly() and > getConsistency() for avoiding the Get copy. > It seems to me that it is ok to modify the passed Get. > Any comment? Thanks. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HBASE-17034) avoid unnecessary Get copy in HTable#exist
[ https://issues.apache.org/jira/browse/HBASE-17034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ChiaPing Tsai updated HBASE-17034: -- Issue Type: Improvement (was: Bug) > avoid unnecessary Get copy in HTable#exist > -- > > Key: HBASE-17034 > URL: https://issues.apache.org/jira/browse/HBASE-17034 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0 >Reporter: ChiaPing Tsai >Priority: Minor > Fix For: 2.0.0 > > Attachments: HBASE-17034.v0.patch > > > {code:title=HTable.java|borderStyle=solid} > private Result get(Get get, final boolean checkExistenceOnly) throws > IOException { > if (get.isCheckExistenceOnly() != checkExistenceOnly || > get.getConsistency() == null) { > get = ReflectionUtils.newInstance(get.getClass(), get); > get.setCheckExistenceOnly(checkExistenceOnly); > if (get.getConsistency() == null){ > get.setConsistency(defaultConsistency); > } > } > ... > } > {code} > Can the passed Get be modified? If so, we can just change the passed Get. If > not, we can record the values returned by isCheckExistenceOnly() and > getConsistency() for avoiding the Get copy. > It seems to me that it is ok to modify the passed Get. > Any comment? Thanks. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HBASE-17034) avoid unnecessary Get copy in HTable#exist
[ https://issues.apache.org/jira/browse/HBASE-17034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ChiaPing Tsai updated HBASE-17034: -- Description: {code:title=HTable.java|borderStyle=solid} private Result get(Get get, final boolean checkExistenceOnly) throws IOException { if (get.isCheckExistenceOnly() != checkExistenceOnly || get.getConsistency() == null) { get = ReflectionUtils.newInstance(get.getClass(), get); get.setCheckExistenceOnly(checkExistenceOnly); if (get.getConsistency() == null){ get.setConsistency(defaultConsistency); } } ... } {code} Can the passed Get be modified? If so, we can just change the passed Get. If not, we can record the values returned by isCheckExistenceOnly() and getConsistency() for avoiding the Get copy. It seems to me that it is ok to modify the passed Get. Any comment? Thanks. was: # HTable#exist apply the default consistency, but HTable#existAll dosen’t # HTable#existAll may change the passed Gets , but HTable#exist dosen’t. (HTable#get(Get, boolean) clones the passed Get) So we have some issues outlined below. # Can the passed Get be modified? If so, we can save the clone of Get. If not, the HTable#getScanner() modify the passed Scan for some unset variables, so it is ok to modify the passed Get I guess. # Should we assign the default Consistency to the passed Get which has an null value of Consistency? This jira may be solved by [HBASE-16623|https://issues.apache.org/jira/browse/HBASE-16623]. Any comment? Thanks. > avoid unnecessary Get copy in HTable#exist > -- > > Key: HBASE-17034 > URL: https://issues.apache.org/jira/browse/HBASE-17034 > Project: HBase > Issue Type: Bug >Reporter: ChiaPing Tsai >Priority: Minor > > {code:title=HTable.java|borderStyle=solid} > private Result get(Get get, final boolean checkExistenceOnly) throws > IOException { > if (get.isCheckExistenceOnly() != checkExistenceOnly || > get.getConsistency() == null) { > get = ReflectionUtils.newInstance(get.getClass(), get); > get.setCheckExistenceOnly(checkExistenceOnly); > if (get.getConsistency() == null){ > get.setConsistency(defaultConsistency); > } > } > ... > } > {code} > Can the passed Get be modified? If so, we can just change the passed Get. If > not, we can record the values returned by isCheckExistenceOnly() and > getConsistency() for avoiding the Get copy. > It seems to me that it is ok to modify the passed Get. > Any comment? Thanks. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HBASE-17034) avoid unnecessary Get copy in HTable#exist
[ https://issues.apache.org/jira/browse/HBASE-17034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ChiaPing Tsai updated HBASE-17034: -- Summary: avoid unnecessary Get copy in HTable#exist (was: HTable#exist and HTable#existAll are flaky) > avoid unnecessary Get copy in HTable#exist > -- > > Key: HBASE-17034 > URL: https://issues.apache.org/jira/browse/HBASE-17034 > Project: HBase > Issue Type: Bug >Reporter: ChiaPing Tsai >Priority: Minor > > # HTable#exist apply the default consistency, but HTable#existAll dosen’t > # HTable#existAll may change the passed Gets , but HTable#exist dosen’t. > (HTable#get(Get, boolean) clones the passed Get) > So we have some issues outlined below. > # Can the passed Get be modified? If so, we can save the clone of Get. If > not, the HTable#getScanner() modify the passed Scan for some unset variables, > so it is ok to modify the passed Get I guess. > # Should we assign the default Consistency to the passed Get which has an > null value of Consistency? > This jira may be solved by > [HBASE-16623|https://issues.apache.org/jira/browse/HBASE-16623]. > Any comment? Thanks. -- This message was sent by Atlassian JIRA (v6.3.4#6332)