[
https://issues.apache.org/jira/browse/HBASE-12267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14177144#comment-14177144
]
Solomon Duskis commented on HBASE-12267:
----------------------------------------
[~stack]
Re setClearBufferOnFail:
It's there to possibly replace HTable.setAutoFlush(boolean autoFlush, boolean
clearBufferOnFail) which does not exist on Table. The clearBufferOnFail is set
in a whole bunch of places where autoFlush is set to false... i.e.
setAutoFlush(false, true). I'm not sure if Table.setClearBufferOnFail(true) is
the way to go, but it might work. Is that something worth exposing?
Re: try(...)
There are a lot of Closables to close in the brave new world of Connection ->
Table / RegionLocator / Admin world. Any Closables created in the try(...)
section are automatically closed in Java 7. So...
try (Connection conn = ConnectionFactory.createConnection(conf); Table t =
conn.getTable(TABLE_NAME) {
...
}
is a shortcut for
Connection conn = null;
Table t = null;
try {
ConnectionFactory.createConnection(conf);
Table t = conn.getTable(TABLE_NAME) {
...
} finally {
if (conn != null) conn.close();
if (t != null) t.close();
}
There is no explicit finally needed with Closables... Does that sound
reasonable?
I still have quite a bit to do with this patch, apparently. Tests are failing.
I might reduce the scope of the commit so that the tests don't fail.
> Replace HTable constructor in mapreduce.* classes with ConnectionFactory
> -------------------------------------------------------------------------
>
> Key: HBASE-12267
> URL: https://issues.apache.org/jira/browse/HBASE-12267
> Project: HBase
> Issue Type: Bug
> Reporter: Solomon Duskis
> Assignee: Solomon Duskis
> Fix For: 2.0.0, 0.99.2
>
> Attachments: HBASE-12267.patch, HBASE-12267_v2.patch,
> HBASE-12267_v3.patch, HBASE-12267_v4.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)