You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by el...@apache.org on 2015/04/22 19:45:58 UTC
[1/2] phoenix git commit: PHOENIX-900 Fix failing
PartialCommitIT.testDeleteFailure()
Repository: phoenix
Updated Branches:
refs/heads/master f54abb55c -> ac2e2368e
PHOENIX-900 Fix failing PartialCommitIT.testDeleteFailure()
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/f312a058
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/f312a058
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/f312a058
Branch: refs/heads/master
Commit: f312a058746382ca442ee86eed7b857f5d1a1767
Parents: 67c4c45
Author: Eli Levine <el...@apache.org>
Authored: Wed Apr 22 10:44:56 2015 -0700
Committer: Eli Levine <el...@apache.org>
Committed: Wed Apr 22 10:44:56 2015 -0700
----------------------------------------------------------------------
.../apache/phoenix/execute/PartialCommitIT.java | 27 ++++++++++++++++----
1 file changed, 22 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/f312a058/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
index 550d7de..812fdba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
@@ -33,6 +33,7 @@ import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
+import java.io.IOException;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.ResultSet;
@@ -47,6 +48,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.HBaseIOException;
import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Durability;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
@@ -268,7 +270,7 @@ public class PartialCommitIT {
@Override
public void prePut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit edit,
final Durability durability) throws HBaseIOException {
- if (shouldFailUpsert(c, put) || shouldFailDelete(c, put)) {
+ if (shouldFailUpsert(c, put)) {
// throwing anything other than instances of IOException result
// in this coprocessor being unloaded
// DoNotRetryIOException tells HBase not to retry this mutation
@@ -277,16 +279,31 @@ public class PartialCommitIT {
}
}
- private static boolean shouldFailUpsert(ObserverContext<RegionCoprocessorEnvironment> c, Put put) {
+ @Override
+ public void preDelete(ObserverContext<RegionCoprocessorEnvironment> c,
+ Delete delete, WALEdit edit, Durability durability)
+ throws IOException {
+ System.out.println( c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString() + ' ' + delete + ' ' + delete.getFamilyCellMap().firstEntry().getValue().get(0).getQualifierLength());
+ if (shouldFailDelete(c, delete)) {
+ // throwing anything other than instances of IOException result
+ // in this coprocessor being unloaded
+ // DoNotRetryIOException tells HBase not to retry this mutation
+ // multiple times
+ throw new DoNotRetryIOException();
+ }
+ }
+
+ private boolean shouldFailUpsert(ObserverContext<RegionCoprocessorEnvironment> c, Put put) {
String tableName = c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString();
return TABLE_NAME_TO_FAIL.equals(tableName) && Bytes.equals(ROW_TO_FAIL, put.getRow());
}
- private static boolean shouldFailDelete(ObserverContext<RegionCoprocessorEnvironment> c, Put put) {
+ private boolean shouldFailDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete delete) {
String tableName = c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString();
return TABLE_NAME_TO_FAIL.equals(tableName) &&
- // Phoenix deletes are sent as Puts with empty values
- put.getFamilyCellMap().firstEntry().getValue().get(0).getValueLength() == 0;
+ // Phoenix deletes are sent as Mutations with empty values
+ delete.getFamilyCellMap().firstEntry().getValue().get(0).getValueLength() == 0 &&
+ delete.getFamilyCellMap().firstEntry().getValue().get(0).getQualifierLength() == 0;
}
}
[2/2] phoenix git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/phoenix
Posted by el...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/phoenix
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/ac2e2368
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ac2e2368
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ac2e2368
Branch: refs/heads/master
Commit: ac2e2368e5f77178f73f6f6347e4fe8a7b782dce
Parents: f312a05 f54abb5
Author: Eli Levine <el...@apache.org>
Authored: Wed Apr 22 10:45:35 2015 -0700
Committer: Eli Levine <el...@apache.org>
Committed: Wed Apr 22 10:45:35 2015 -0700
----------------------------------------------------------------------
.../main/java/org/apache/phoenix/iterate/ParallelIterators.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------