Repository: hbase Updated Branches: refs/heads/master da0e807dd -> 4b1983c89
HBASE-12611 Create autoCommit() method and remove clearBufferOnFail (Solomon Duskis) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4b1983c8 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4b1983c8 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4b1983c8 Branch: refs/heads/master Commit: 4b1983c89dde74396cd1d41984df5f5b62a47193 Parents: da0e807 Author: stack <[email protected]> Authored: Mon Dec 8 11:01:28 2014 -0800 Committer: stack <[email protected]> Committed: Mon Dec 8 11:01:28 2014 -0800 ---------------------------------------------------------------------- .../main/java/org/apache/hadoop/hbase/client/HTable.java | 9 +++------ .../org/apache/hadoop/hbase/client/TestAsyncProcess.java | 8 +++++--- .../java/org/apache/hadoop/hbase/HBaseTestingUtility.java | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/4b1983c8/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java index a88a265..7a9ddf7 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java @@ -116,7 +116,6 @@ public class HTable implements HTableInterface, RegionLocator { private TableConfiguration tableConfiguration; protected List<Row> writeAsyncBuffer = new LinkedList<Row>(); private long writeBufferSize; - private boolean clearBufferOnFail = true; private boolean autoFlush = true; protected long currentWriteBufferSize = 0 ; private boolean closed = false; @@ -1092,8 +1091,7 @@ public class HTable implements HTableInterface, RegionLocator { while (!writeAsyncBuffer.isEmpty()) { ap.submit(tableName, writeAsyncBuffer, true, null, false); } - List<Row> failedRows = clearBufferOnFail ? null : writeAsyncBuffer; - RetriesExhaustedWithDetailsException error = ap.waitForAllPreviousOpsAndReset(failedRows); + RetriesExhaustedWithDetailsException error = ap.waitForAllPreviousOpsAndReset(null); if (error != null) { throw error; } @@ -1568,7 +1566,7 @@ public class HTable implements HTableInterface, RegionLocator { @Deprecated @Override public void setAutoFlush(boolean autoFlush) { - setAutoFlush(autoFlush, autoFlush); + this.autoFlush = autoFlush; } /** @@ -1576,7 +1574,7 @@ public class HTable implements HTableInterface, RegionLocator { */ @Override public void setAutoFlushTo(boolean autoFlush) { - setAutoFlush(autoFlush, clearBufferOnFail); + this.autoFlush = autoFlush; } /** @@ -1585,7 +1583,6 @@ public class HTable implements HTableInterface, RegionLocator { @Override public void setAutoFlush(boolean autoFlush, boolean clearBufferOnFail) { this.autoFlush = autoFlush; - this.clearBufferOnFail = autoFlush || clearBufferOnFail; } /** http://git-wip-us.apache.org/repos/asf/hbase/blob/4b1983c8/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java index 8a3aafc..d219638 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java @@ -735,11 +735,12 @@ public class TestAsyncProcess { } +/* @Test public void testWithNoClearOnFail() throws IOException { HTable ht = new HTable(); ht.ap = new MyAsyncProcess(createHConnection(), conf, true); - ht.setAutoFlush(false); + ht.setAutoFlushTo(false); Put p = createPut(1, false); ht.put(p); @@ -757,6 +758,7 @@ public class TestAsyncProcess { } Assert.assertEquals(1, ht.writeAsyncBuffer.size()); } + */ @Test public void testBatch() throws IOException, InterruptedException { @@ -806,7 +808,7 @@ public class TestAsyncProcess { ht.ap.serverTrackerTimeout = 1; Put p = createPut(1, false); - ht.setAutoFlush(false); + ht.setAutoFlushTo(false); ht.put(p); try { @@ -828,7 +830,7 @@ public class TestAsyncProcess { Assert.assertNotNull(ht.ap.createServerErrorTracker()); Put p = createPut(1, true); - ht.setAutoFlush(false); + ht.setAutoFlushTo(false); ht.put(p); try { http://git-wip-us.apache.org/repos/asf/hbase/blob/4b1983c8/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index 1c7c69a..4619ef2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -1837,7 +1837,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility { * @throws IOException */ public int loadTable(final HTable t, final byte[][] f, byte[] value, boolean writeToWAL) throws IOException { - t.setAutoFlush(false); + t.setAutoFlushTo(false); int rowCount = 0; for (byte[] row : HBaseTestingUtility.ROWS) { Put put = new Put(row);
