You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by sa...@apache.org on 2017/08/31 00:07:21 UTC
phoenix git commit: PHOENIX-4141 Addendum to fix test failure
Repository: phoenix
Updated Branches:
refs/heads/master 7cf7b3abb -> 7d8b84302
PHOENIX-4141 Addendum to fix test failure
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/7d8b8430
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/7d8b8430
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/7d8b8430
Branch: refs/heads/master
Commit: 7d8b8430212fae117ac09faf6b7c22bf673e9073
Parents: 7cf7b3a
Author: Samarth Jain <sa...@apache.org>
Authored: Wed Aug 30 17:07:11 2017 -0700
Committer: Samarth Jain <sa...@apache.org>
Committed: Wed Aug 30 17:07:17 2017 -0700
----------------------------------------------------------------------
.../end2end/TableSnapshotReadsMapReduceIT.java | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/7d8b8430/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableSnapshotReadsMapReduceIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableSnapshotReadsMapReduceIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableSnapshotReadsMapReduceIT.java
index 591f028..39d97a1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableSnapshotReadsMapReduceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableSnapshotReadsMapReduceIT.java
@@ -65,6 +65,7 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT {
private static List<List<Object>> result;
private String tableName;
+
private MyClock clock;
@Before
@@ -90,7 +91,7 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT {
// configure Phoenix M/R job to read snapshot
final Configuration conf = getUtility().getConfiguration();
Job job = Job.getInstance(conf);
- Path tmpDir = getUtility().getDataTestDirOnTestFS(SNAPSHOT_NAME);
+ Path tmpDir = getUtility().getRandomDir();
PhoenixMapReduceUtil.setInput(job, PhoenixIndexDBWritable.class, SNAPSHOT_NAME, tableName,
tmpDir, null, FIELD1, FIELD2, FIELD3);
@@ -110,7 +111,7 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT {
// configure Phoenix M/R job to read snapshot
final Configuration conf = getUtility().getConfiguration();
Job job = Job.getInstance(conf);
- Path tmpDir = getUtility().getDataTestDirOnTestFS(SNAPSHOT_NAME);
+ Path tmpDir = getUtility().getRandomDir();
PhoenixMapReduceUtil.setInput(job, PhoenixIndexDBWritable.class, SNAPSHOT_NAME, tableName,
tmpDir, FIELD3 + " > 0001", FIELD1, FIELD2, FIELD3);
@@ -130,7 +131,7 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT {
// configure Phoenix M/R job to read snapshot
final Configuration conf = getUtility().getConfiguration();
Job job = Job.getInstance(conf);
- Path tmpDir = getUtility().getDataTestDirOnTestFS(SNAPSHOT_NAME);
+ Path tmpDir = getUtility().getRandomDir();
// Running limit with order by on non pk column
String inputQuery = "SELECT * FROM " + tableName + " ORDER BY FIELD2 LIMIT 1";
PhoenixMapReduceUtil.setInput(job, PhoenixIndexDBWritable.class, SNAPSHOT_NAME, tableName,
@@ -156,6 +157,7 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT {
// verify the result, should match the values at the corresponding timestamp
Properties props = new Properties();
props.setProperty("CurrentSCN", Long.toString(clock.time));
+
StringBuilder selectQuery = new StringBuilder("SELECT * FROM " + tableName);
if (condition != null) {
selectQuery.append(" WHERE " + condition);
@@ -178,7 +180,7 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT {
}
assertFalse(
- "Should only have stored " + result.size() + "rows in the table for the timestamp!",
+ "Should only have stored" + result.size() + "rows in the table for the timestamp!",
rs.next());
} finally {
deleteSnapshotAndTable(tableName);
@@ -240,6 +242,10 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT {
Connection conn = DriverManager.getConnection(getUrl());
HBaseAdmin admin = conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
admin.deleteSnapshot(SNAPSHOT_NAME);
+
+ conn.createStatement().execute("DROP TABLE " + tableName);
+ conn.close();
+
}
public static class TableSnapshotMapper extends
@@ -257,4 +263,4 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT {
}
}
-}
+}
\ No newline at end of file