You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by sm...@apache.org on 2016/04/22 02:20:03 UTC

drill git commit: DRILL-3522: Fix for sporadic Mongo errors

Repository: drill
Updated Branches:
  refs/heads/master d93a36338 -> a07f4de7e


DRILL-3522: Fix for sporadic Mongo errors


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/a07f4de7
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/a07f4de7
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/a07f4de7

Branch: refs/heads/master
Commit: a07f4de7e8725f7971ace308e81a241b7b07b5b6
Parents: d93a363
Author: Adam <ad...@tipihq.com>
Authored: Tue Jul 21 12:44:21 2015 +1000
Committer: Steven Phillips <st...@dremio.com>
Committed: Thu Apr 21 17:19:19 2016 -0700

----------------------------------------------------------------------
 .../drill/exec/store/mongo/schema/MongoSchemaFactory.java      | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/a07f4de7/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java
----------------------------------------------------------------------
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java
index 9d08abd..be212de 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java
@@ -61,12 +61,10 @@ public class MongoSchemaFactory implements SchemaFactory {
   private LoadingCache<String, List<String>> tableNameLoader;
   private final String schemaName;
   private final MongoStoragePlugin plugin;
-  private final MongoClient client;
 
   public MongoSchemaFactory(MongoStoragePlugin plugin, String schemaName) throws ExecutionSetupException {
     this.plugin = plugin;
     this.schemaName = schemaName;
-    this.client = plugin.getClient();
 
     databases = CacheBuilder //
         .newBuilder() //
@@ -88,7 +86,7 @@ public class MongoSchemaFactory implements SchemaFactory {
       }
       try {
         List<String> dbNames = new ArrayList<>();
-        client.listDatabaseNames().into(dbNames);
+        plugin.getClient().listDatabaseNames().into(dbNames);
         return dbNames;
       } catch (MongoException me) {
         logger.warn("Failure while loading databases in Mongo. {}",
@@ -106,7 +104,7 @@ public class MongoSchemaFactory implements SchemaFactory {
     @Override
     public List<String> load(String dbName) throws Exception {
       try {
-        MongoDatabase db = client.getDatabase(dbName);
+        MongoDatabase db = plugin.getClient().getDatabase(dbName);
         List<String> collectionNames = new ArrayList<>();
         db.listCollectionNames().into(collectionNames);
         return collectionNames;