Repository: hbase
Updated Branches:
refs/heads/branch-1 cc1a0d7c3 -> 823656bf8
HBASE-12611 Create autoCommit() method and remove clearBufferOnFail (Solomon
Duskis)
Conflicts:
hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/823656bf
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/823656bf
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/823656bf
Branch: refs/heads/branch-1
Commit: 823656bf8372e55b5b4a81e72921cb78b0be96d7
Parents: cc1a0d7
Author: stack <[email protected]>
Authored: Mon Dec 8 11:01:28 2014 -0800
Committer: stack <[email protected]>
Committed: Mon Dec 8 11:17:59 2014 -0800
----------------------------------------------------------------------
.../java/org/apache/hadoop/hbase/client/HTable.java | 16 ++++++----------
.../hadoop/hbase/client/TestAsyncProcess.java | 8 +++++---
.../apache/hadoop/hbase/HBaseTestingUtility.java | 2 +-
3 files changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/823656bf/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 7dcf3e9..f765c2d 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
@@ -118,12 +118,11 @@ public class HTable implements HTableInterface,
RegionLocator {
private TableConfiguration tableConfiguration;
protected List<Row> writeAsyncBuffer = new LinkedList<Row>();
private long writeBufferSize;
- private boolean clearBufferOnFail;
- private boolean autoFlush;
- protected long currentWriteBufferSize;
+ private boolean autoFlush = true;
+ protected long currentWriteBufferSize = 0 ;
+ private boolean closed = false;
protected int scannerCaching;
private ExecutorService pool; // For Multi & Scan
- private boolean closed;
private int operationTimeout;
private final boolean cleanupPoolOnClose; // shutdown the pool in close()
private final boolean cleanupConnectionOnClose; // close the connection in
close()
@@ -354,7 +353,6 @@ public class HTable implements HTableInterface,
RegionLocator {
this.operationTimeout = tableName.isSystemTable() ?
tableConfiguration.getMetaOperationTimeout() :
tableConfiguration.getOperationTimeout();
this.writeBufferSize = tableConfiguration.getWriteBufferSize();
- this.clearBufferOnFail = true;
this.autoFlush = true;
this.currentWriteBufferSize = 0;
this.scannerCaching = tableConfiguration.getScannerCaching();
@@ -1098,8 +1096,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;
}
@@ -1574,7 +1571,7 @@ public class HTable implements HTableInterface,
RegionLocator {
@Deprecated
@Override
public void setAutoFlush(boolean autoFlush) {
- setAutoFlush(autoFlush, autoFlush);
+ this.autoFlush = autoFlush;
}
/**
@@ -1582,7 +1579,7 @@ public class HTable implements HTableInterface,
RegionLocator {
*/
@Override
public void setAutoFlushTo(boolean autoFlush) {
- setAutoFlush(autoFlush, clearBufferOnFail);
+ this.autoFlush = autoFlush;
}
/**
@@ -1591,7 +1588,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/823656bf/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 6bb8dbb..97c3c37 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
@@ -736,11 +736,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);
@@ -758,6 +759,7 @@ public class TestAsyncProcess {
}
Assert.assertEquals(1, ht.writeAsyncBuffer.size());
}
+ */
@Test
public void testBatch() throws IOException, InterruptedException {
@@ -807,7 +809,7 @@ public class TestAsyncProcess {
ht.ap.serverTrackerTimeout = 1;
Put p = createPut(1, false);
- ht.setAutoFlush(false);
+ ht.setAutoFlushTo(false);
ht.put(p);
try {
@@ -829,7 +831,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/823656bf/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 579caab..bf61208 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
@@ -1775,7 +1775,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);