atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suma...@apache.org
Subject incubator-atlas git commit: ATLAS-1342 Titan Solrclient - Add timeouts for zookeeper connect and session (sumasai)
Date Wed, 07 Dec 2016 05:28:09 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master a1f9008b8 -> c91f582a7


ATLAS-1342 Titan Solrclient - Add timeouts for zookeeper connect and session (sumasai)


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

Branch: refs/heads/master
Commit: c91f582a787a6ea88c4b8d2e4828e85f708ce7f0
Parents: a1f9008
Author: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Authored: Tue Dec 6 21:27:35 2016 -0800
Committer: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Committed: Tue Dec 6 21:27:35 2016 -0800

----------------------------------------------------------------------
 distro/pom.xml                                       |  4 ++++
 distro/src/conf/atlas-log4j.xml                      |  2 +-
 docs/src/site/twiki/Configuration.twiki              |  2 ++
 docs/src/site/twiki/InstallationSteps.twiki          |  2 ++
 .../titan/diskstorage/solr/Solr5Index.java           | 15 +++++++++++++++
 .../atlas/repository/graphdb/titan0/Titan0Graph.java |  3 +++
 release-log.txt                                      |  1 +
 7 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c91f582a/distro/pom.xml
----------------------------------------------------------------------
diff --git a/distro/pom.xml b/distro/pom.xml
index 792cced..c0090ae 100644
--- a/distro/pom.xml
+++ b/distro/pom.xml
@@ -45,6 +45,8 @@ atlas.graph.storage.lock.wait-time=10000
 #Solr cloud mode properties
 atlas.graph.index.search.solr.mode=cloud
 atlas.graph.index.search.solr.zookeeper-url=
+atlas.graph.index.search.solr.zookeeper-connect-timeout=60000
+atlas.graph.index.search.solr.zookeeper-session-timeout=60000
 
 #Solr http mode properties
 #atlas.graph.index.search.solr.mode=http
@@ -162,6 +164,8 @@ atlas.graph.storage.lock.wait-time=10000
 #Solr cloud mode properties
 atlas.graph.index.search.solr.mode=cloud
 atlas.graph.index.search.solr.zookeeper-url=localhost:2181
+atlas.graph.index.search.solr.zookeeper-connect-timeout=60000
+atlas.graph.index.search.solr.zookeeper-session-timeout=60000
 
 #Solr http mode properties
 #atlas.graph.index.search.solr.mode=http

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c91f582a/distro/src/conf/atlas-log4j.xml
----------------------------------------------------------------------
diff --git a/distro/src/conf/atlas-log4j.xml b/distro/src/conf/atlas-log4j.xml
index 81120e2..a79b722 100755
--- a/distro/src/conf/atlas-log4j.xml
+++ b/distro/src/conf/atlas-log4j.xml
@@ -65,7 +65,7 @@
     </logger>
 
     <logger name="com.thinkaurelius.titan" additivity="false">
-        <level value="warn"/>
+        <level value="info"/>
         <appender-ref ref="FILE"/>
     </logger>
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c91f582a/docs/src/site/twiki/Configuration.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/Configuration.twiki b/docs/src/site/twiki/Configuration.twiki
index 3c1978c..a5069ab 100644
--- a/docs/src/site/twiki/Configuration.twiki
+++ b/docs/src/site/twiki/Configuration.twiki
@@ -78,6 +78,8 @@ Please note that Solr installation in Cloud mode is a prerequisite before
config
  atlas.graph.index.search.backend=solr5
  atlas.graph.index.search.solr.mode=cloud
  atlas.graph.index.search.solr.zookeeper-url=<the ZK quorum setup for solr as comma separated
value> eg: 10.1.6.4:2181,10.1.6.5:2181
+ atlas.graph.index.search.solr.zookeeper-connect-timeout=<SolrCloud Zookeeper Connection
Timeout>. Default value is 60000 ms
+ atlas.graph.index.search.solr.zookeeper-session-timeout=<SolrCloud Zookeeper Session
Timeout>. Default value is 60000 ms
 </verbatim>
 
 Also note that if the embedded-hbase-solr profile is used then Solr is included in the distribution
so that a standalone

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c91f582a/docs/src/site/twiki/InstallationSteps.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/InstallationSteps.twiki b/docs/src/site/twiki/InstallationSteps.twiki
index bd6921e..4869f9f 100644
--- a/docs/src/site/twiki/InstallationSteps.twiki
+++ b/docs/src/site/twiki/InstallationSteps.twiki
@@ -268,6 +268,8 @@ For configuring Titan to work with Solr, please follow the instructions
below
  atlas.graph.index.search.backend=solr5
  atlas.graph.index.search.solr.mode=cloud
  atlas.graph.index.search.solr.zookeeper-url=<the ZK quorum setup for solr as comma separated
value> eg: 10.1.6.4:2181,10.1.6.5:2181
+ atlas.graph.index.search.solr.zookeeper-connect-timeout=<SolrCloud Zookeeper Connection
Timeout>. Default value is 60000 ms
+ atlas.graph.index.search.solr.zookeeper-session-timeout=<SolrCloud Zookeeper Session
Timeout>. Default value is 60000 ms
 </verbatim>
 
    * Restart Atlas

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c91f582a/graphdb/titan0/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java
----------------------------------------------------------------------
diff --git a/graphdb/titan0/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java
b/graphdb/titan0/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java
index 3b5620c..f3b9fd9 100644
--- a/graphdb/titan0/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java
+++ b/graphdb/titan0/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java
@@ -142,6 +142,14 @@ public class Solr5Index implements IndexProvider {
             "URL of the Zookeeper instance coordinating the SolrCloud cluster",
             ConfigOption.Type.MASKABLE, "localhost:2181");
 
+    public static final ConfigOption<Integer> ZOOKEEPER_CONNECT_TIMEOUT = new ConfigOption<Integer>(SOLR_NS,"zookeeper-connect-timeout",
+        "SolrCloud Zookeeper connect timeout",
+        ConfigOption.Type.MASKABLE, 60000);
+
+    public static final ConfigOption<Integer> ZOOKEEPER_SESSION_TIMEOUT = new ConfigOption<Integer>(SOLR_NS,"zookeeper-session-timeout",
+        "SolrCloud Zookeeper session timeout",
+        ConfigOption.Type.MASKABLE, 60000);
+
     public static final ConfigOption<Integer> NUM_SHARDS = new ConfigOption<Integer>(SOLR_NS,"num-shards",
             "Number of shards for a collection. This applies when creating a new collection
which is only supported under the SolrCloud operation mode.",
             ConfigOption.Type.GLOBAL_OFFLINE, 1);
@@ -210,6 +218,13 @@ public class Solr5Index implements IndexProvider {
             HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
             String zookeeperUrl = config.get(Solr5Index.ZOOKEEPER_URL);
             CloudSolrClient cloudServer = new CloudSolrClient(zookeeperUrl, true);
+
+            logger.info("Zookeeper connect timeout : " + config.get(ZOOKEEPER_CONNECT_TIMEOUT));
+            cloudServer.setZkConnectTimeout(config.get(ZOOKEEPER_CONNECT_TIMEOUT));
+
+            logger.info("Zookeeper session timeout : " + config.get(ZOOKEEPER_SESSION_TIMEOUT));
+            cloudServer.setZkClientTimeout(config.get(ZOOKEEPER_SESSION_TIMEOUT));
+
             cloudServer.connect();
             solrClient = cloudServer;
         } else if (mode==Mode.HTTP) {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c91f582a/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
----------------------------------------------------------------------
diff --git a/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
index 2dbe742..7c8cfe8 100644
--- a/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
+++ b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
@@ -30,6 +30,7 @@ import java.util.Map;
 import java.util.Set;
 
 import javax.script.Bindings;
+import javax.script.ScriptContext;
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 import javax.script.ScriptException;
@@ -282,6 +283,8 @@ public class Titan0Graph implements AtlasGraph<Titan0Vertex, Titan0Edge>
{
         ScriptEngine engine = manager.getEngineByName("gremlin-groovy");
         Bindings bindings = engine.createBindings();
         bindings.put("g", getGraph());
+        //Do not cache script compilations due to memory implications
+        engine.getContext().setAttribute("#jsr223.groovy.engine.keep.globals", "phantom",
ScriptContext.ENGINE_SCOPE);
         Object result = engine.eval(gremlinQuery, bindings);
         return result;
     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c91f582a/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 3511c1d..ef3963b 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -9,6 +9,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements
for al
 ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
 
 ALL CHANGES:
+ATLAS-1342 Titan Solrclient - Add timeouts for zookeeper connect and session (sumasai)
 ATLAS-1353 Invalid error message(500 internal server error) for lineage query on non-existing
table. (sumasai)
 ATLAS-1347 Creating a class with unknown supertype results in "409 Conflict", where as expected
is "400 Bad Message" (apoorvnairk via sumasai)
 ATLAS-737 Add DSL support for Sum, Max, Min and count operations with and without group by
(guptaneeru via dkantor)


Mime
View raw message