You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by cg...@apache.org on 2021/09/19 13:56:59 UTC

[drill] branch master updated: DRILL-7997: Fix the type mismatch of mongo module in eclipse (#2313)

This is an automated email from the ASF dual-hosted git repository.

cgivre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b74325  DRILL-7997: Fix the type mismatch of mongo module in eclipse (#2313)
5b74325 is described below

commit 5b74325892943d0cca1bc96491fa2236ae88b9ad
Author: luoc <lu...@apache.org>
AuthorDate: Sun Sep 19 21:56:52 2021 +0800

    DRILL-7997: Fix the type mismatch of mongo module in eclipse (#2313)
---
 .../apache/drill/exec/store/mongo/MongoTestSuite.java   | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuite.java b/contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuite.java
index 2af1c3f..fe7af6e 100644
--- a/contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuite.java
+++ b/contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuite.java
@@ -95,18 +95,23 @@ public class MongoTestSuite extends BaseTest implements MongoTestConstants {
     }
   }
 
+  private static GenericContainer<?> newContainer(Network network, String host) {
+    GenericContainer<?> container = new GenericContainer<>("mongo:4.4.5")
+        .withNetwork(network)
+        .withNetworkAliases(host)
+        .withExposedPorts(MONGOS_PORT)
+        .withCommand(String.format("mongod --port %d --shardsvr --replSet rs0 --bind_ip localhost,%s", MONGOS_PORT, host));
+    return container;
+  }
+
   private static class DistributedMode extends ContainerManager {
 
     @Override
     public String setup() throws Exception {
       Network network = Network.newNetwork();
 
-      mongoContainers = Stream.of("m1", "m2", "m3")
-          .map(host -> new GenericContainer<>("mongo:4.4.5")
-              .withNetwork(network)
-              .withNetworkAliases(host)
-              .withExposedPorts(MONGOS_PORT)
-              .withCommand(String.format("mongod --port %d --shardsvr --replSet rs0 --bind_ip localhost,%s", MONGOS_PORT, host)))
+      Stream.of("m1", "m2", "m3")
+          .map(host -> newContainer(network, host))
           .collect(Collectors.toList());
 
       String configServerHost = "m4";