Revert "PHOENIX-4141 Addendum to fix test failure" This reverts commit 7d8b8430212fae117ac09faf6b7c22bf673e9073.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/38915fee Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/38915fee Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/38915fee Branch: refs/heads/master Commit: 38915feef5f590a882cdc45c7e880943ab099603 Parents: 0ace91f Author: Samarth Jain <[email protected]> Authored: Sat Sep 2 10:32:24 2017 -0700 Committer: Samarth Jain <[email protected]> Committed: Sat Sep 2 10:32:24 2017 -0700 ---------------------------------------------------------------------- .../end2end/TableSnapshotReadsMapReduceIT.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/38915fee/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 39d97a1..591f028 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,7 +65,6 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT { private static List<List<Object>> result; private String tableName; - private MyClock clock; @Before @@ -91,7 +90,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().getRandomDir(); + Path tmpDir = getUtility().getDataTestDirOnTestFS(SNAPSHOT_NAME); PhoenixMapReduceUtil.setInput(job, PhoenixIndexDBWritable.class, SNAPSHOT_NAME, tableName, tmpDir, null, FIELD1, FIELD2, FIELD3); @@ -111,7 +110,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().getRandomDir(); + Path tmpDir = getUtility().getDataTestDirOnTestFS(SNAPSHOT_NAME); PhoenixMapReduceUtil.setInput(job, PhoenixIndexDBWritable.class, SNAPSHOT_NAME, tableName, tmpDir, FIELD3 + " > 0001", FIELD1, FIELD2, FIELD3); @@ -131,7 +130,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().getRandomDir(); + Path tmpDir = getUtility().getDataTestDirOnTestFS(SNAPSHOT_NAME); // 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, @@ -157,7 +156,6 @@ 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); @@ -180,7 +178,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); @@ -242,10 +240,6 @@ 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 @@ -263,4 +257,4 @@ public class TableSnapshotReadsMapReduceIT extends ParallelStatsDisabledIT { } } -} \ No newline at end of file +}
