You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@zeppelin.apache.org by "mithun12000 (via GitHub)" <gi...@apache.org> on 2024/02/06 11:16:07 UTC

[PR] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

mithun12000 opened a new pull request, #4706:
URL: https://github.com/apache/zeppelin/pull/4706

   ### What is this PR for?
   Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter. 
   DocumentDB in AWS required SSL/ TSL connection which was not supported.
   MongoDB Atlas required special protocal to connect ```mongodb+srv```
   
   
   ### What type of PR is it?
   Improvement
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   Zira Issue creation is pending as no account as of now.
   
   ### How should this be tested?
   * Unit test already present. 
   * Can add those conf in mongoDB interpreter to test manually.
   
   ### Questions:
   * Does the license files need to update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? Yes
   


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on code in PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#discussion_r1494583079


##########
mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java:
##########
@@ -73,7 +73,15 @@ public void open() {
     }
     commandTimeout = Long.parseLong(getProperty("mongo.shell.command.timeout"));
     maxConcurrency = Integer.parseInt(getProperty("mongo.interpreter.concurrency.max"));
-    dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+
+		/* adding support for protocal like mongodb+srv for atlas cluster*/
+    String mongoProtocol = getProperty("mongo.server.protocol", "mongodb");
+		if ("mongodb".equalsIgnoreCase(mongoProtocol)){

Review Comment:
   Could you please check your indentation settings?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#issuecomment-1952509666

   I left some comments. Could you please check it? Moreover, I think it would be good to have some tests for your contribution.


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on code in PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#discussion_r1494586004


##########
mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java:
##########
@@ -117,6 +125,67 @@ public InterpreterResult interpret(String script, InterpreterContext context) {
     executor.setWatchdog(new ExecuteWatchdog(commandTimeout));
 
     final CommandLine cmdLine = CommandLine.parse(getProperty("mongo.shell.path"));
+		/* added support for API versions */
+    String apiVersion = getProperty("mongo.server.api.version", "");
+    if (!"".equalsIgnoreCase(apiVersion)){

Review Comment:
   nit: `StringUtils.isBlank(...)`?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "mithun12000 (via GitHub)" <gi...@apache.org>.
mithun12000 commented on code in PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#discussion_r1499384499


##########
mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java:
##########
@@ -73,7 +73,15 @@ public void open() {
     }
     commandTimeout = Long.parseLong(getProperty("mongo.shell.command.timeout"));
     maxConcurrency = Integer.parseInt(getProperty("mongo.interpreter.concurrency.max"));
-    dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+
+		/* adding support for protocal like mongodb+srv for atlas cluster*/
+    String mongoProtocol = getProperty("mongo.server.protocol", "mongodb");
+		if ("mongodb".equalsIgnoreCase(mongoProtocol)){
+      dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+		}else{
+	    dbAddress = mongoProtocol +"://"+ getProperty("mongo.server.host");

Review Comment:
   if protocol is ```mongodb``` then it will use ```mongo.server.port``` as many provider use different port for mongo / documentDb or similar service.
   
   but i never seen ```mongodb+srv``` protocol is been used with different port. 



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "mithun12000 (via GitHub)" <gi...@apache.org>.
mithun12000 commented on code in PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#discussion_r1499379323


##########
mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java:
##########
@@ -73,7 +73,15 @@ public void open() {
     }
     commandTimeout = Long.parseLong(getProperty("mongo.shell.command.timeout"));
     maxConcurrency = Integer.parseInt(getProperty("mongo.interpreter.concurrency.max"));
-    dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+
+		/* adding support for protocal like mongodb+srv for atlas cluster*/
+    String mongoProtocol = getProperty("mongo.server.protocol", "mongodb");
+		if ("mongodb".equalsIgnoreCase(mongoProtocol)){

Review Comment:
   Sure will update indentation.



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on code in PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#discussion_r1494587876


##########
mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java:
##########
@@ -117,6 +125,67 @@ public InterpreterResult interpret(String script, InterpreterContext context) {
     executor.setWatchdog(new ExecuteWatchdog(commandTimeout));
 
     final CommandLine cmdLine = CommandLine.parse(getProperty("mongo.shell.path"));
+		/* added support for API versions */
+    String apiVersion = getProperty("mongo.server.api.version", "");
+    if (!"".equalsIgnoreCase(apiVersion)){
+      cmdLine.addArgument("--apiVersion", false);
+	    cmdLine.addArgument(apiVersion, false);
+	  }
+
+		/* adding support for SSL for and TLS for documentDB */
+    String runWithSSL = getProperty("mongo.server.ssl.enabled", "false");
+    if ("true".equalsIgnoreCase(runWithSSL))

Review Comment:
   nit: `Boolean.valueOf(...)` or `Boolean.parseBoolean(...)`?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#issuecomment-3222357162

   This pull request has been inactive for over a year.   If no further activity occurs within the next 30 days, it will be automatically closed.   If you believe this PR is still relevant, please feel free to leave a comment or make an update. Thank you!


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#issuecomment-1952491404

   Thank you for your first contribution :-) I'll review this PR soon


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #4706: [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter
URL: https://github.com/apache/zeppelin/pull/4706


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#issuecomment-3336561174

   This pull request has been automatically closed due to prolonged inactivity (over one year without updates).   If you feel this was done in error or would like to continue the discussion, feel free to reopen it. Thank you for your contributions!


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#issuecomment-2308742330

   @mithun12000 ping


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on code in PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#discussion_r1494585092


##########
mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java:
##########
@@ -73,7 +73,15 @@ public void open() {
     }
     commandTimeout = Long.parseLong(getProperty("mongo.shell.command.timeout"));
     maxConcurrency = Integer.parseInt(getProperty("mongo.interpreter.concurrency.max"));
-    dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+
+		/* adding support for protocal like mongodb+srv for atlas cluster*/
+    String mongoProtocol = getProperty("mongo.server.protocol", "mongodb");
+		if ("mongodb".equalsIgnoreCase(mongoProtocol)){
+      dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+		}else{
+	    dbAddress = mongoProtocol +"://"+ getProperty("mongo.server.host");

Review Comment:
   If we have a protocol value, does it mean `mongo.server.port`? Otherwise, don't some protocols need port value? Could you please verify it?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on code in PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#discussion_r1499418005


##########
mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java:
##########
@@ -73,7 +73,15 @@ public void open() {
     }
     commandTimeout = Long.parseLong(getProperty("mongo.shell.command.timeout"));
     maxConcurrency = Integer.parseInt(getProperty("mongo.interpreter.concurrency.max"));
-    dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+
+		/* adding support for protocal like mongodb+srv for atlas cluster*/
+    String mongoProtocol = getProperty("mongo.server.protocol", "mongodb");
+		if ("mongodb".equalsIgnoreCase(mongoProtocol)){
+      dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+		}else{
+	    dbAddress = mongoProtocol +"://"+ getProperty("mongo.server.host");

Review Comment:
   Thank you for the response. BTW, for the conservative way, could you please add the code for port availability? I also don't know if it's really needed but I think it would be better to add it anyway. WDYT?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-5991] Adding Support of DocumentDb and Mongo Atlas for MongoDB interpreter [zeppelin]

Posted by "mithun12000 (via GitHub)" <gi...@apache.org>.
mithun12000 commented on code in PR #4706:
URL: https://github.com/apache/zeppelin/pull/4706#discussion_r1499421170


##########
mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java:
##########
@@ -73,7 +73,15 @@ public void open() {
     }
     commandTimeout = Long.parseLong(getProperty("mongo.shell.command.timeout"));
     maxConcurrency = Integer.parseInt(getProperty("mongo.interpreter.concurrency.max"));
-    dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+
+		/* adding support for protocal like mongodb+srv for atlas cluster*/
+    String mongoProtocol = getProperty("mongo.server.protocol", "mongodb");
+		if ("mongodb".equalsIgnoreCase(mongoProtocol)){
+      dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port");
+		}else{
+	    dbAddress = mongoProtocol +"://"+ getProperty("mongo.server.host");

Review Comment:
   Ok will update the code as requested.



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org