pkumarsinha commented on a change in pull request #949: HIVE-22990 Add file
based ack for replication
URL: https://github.com/apache/hive/pull/949#discussion_r393782909
##########
File path:
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
##########
@@ -312,7 +312,22 @@ public void testBasic() throws IOException {
verifySetup("SELECT * from " + dbName + ".unptned_empty", empty, driver);
String replicatedDbName = dbName + "_dupe";
- bootstrapLoadAndVerify(dbName, replicatedDbName);
+ Tuple bootstrapDump = bootstrapLoadAndVerify(dbName, replicatedDbName);
+
+ FileSystem fs = new Path(bootstrapDump.dumpLocation).getFileSystem(hconf);
+ Path dumpPath = new Path(bootstrapDump.dumpLocation,
ReplUtils.REPL_HIVE_BASE_DIR);
+ boolean dumpAckFound = false;
+ boolean loadAckFound = false;
+ for (FileStatus status : fs.listStatus(dumpPath)) {
+ if
(status.getPath().getName().equalsIgnoreCase(ReplUtils.DUMP_ACKNOWLEDGEMENT)) {
+ dumpAckFound = true;
+ }
+ if
(status.getPath().getName().equalsIgnoreCase(ReplUtils.LOAD_ACKNOWLEDGEMENT)) {
+ loadAckFound = true;
+ }
+ }
+ assertTrue(dumpAckFound);
+ assertTrue(loadAckFound);
Review comment:
Why not just use:
assertTrue(fs.exists(new Path(dumpPath, ReplUtils.DUMP_ACKNOWLEDGEMENT)));
assertTrue(fs.exists(new Path(dumpPath, ReplUtils.LOAD_ACKNOWLEDGEMENT)));
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]