Commit c91f582a by Suma Shivaprasad

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

parent a1f9008b
......@@ -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
......
......@@ -65,7 +65,7 @@
</logger>
<logger name="com.thinkaurelius.titan" additivity="false">
<level value="warn"/>
<level value="info"/>
<appender-ref ref="FILE"/>
</logger>
......
......@@ -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
......
......@@ -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
......
......@@ -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) {
......
......@@ -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;
}
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment