Commit 2692f476 by Hemanth Yamijala

ATLAS-950 Atlas should support Solr that requires Kerberos authentication…

ATLAS-950 Atlas should support Solr that requires Kerberos authentication (madhan.neethiraj via yhemanth)
parent 202893a9
......@@ -368,7 +368,7 @@
<titan.version>0.5.4</titan.version>
<hadoop.version>2.7.0</hadoop.version>
<hbase.version>1.1.2</hbase.version>
<solr.version>5.1.0</solr.version>
<solr.version>5.5.1</solr.version>
<kafka.version>0.10.0.0</kafka.version>
<!-- scala versions -->
<scala.version>2.10.4</scala.version>
......
......@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
ALL CHANGES:
ATLAS-950 Atlas should support Solr that requires Kerberos authentication (madhan.neethiraj via yhemanth)
ATLAS-947 Return state information in inputs and outputs lineage API (shwethags)
ATLAS-806 Create default taxonomy at server startup (jspeidel via yhemanth)
ATLAS-942 Jenkins build failure - GraphRepoMapperScaleTest (shwethags)
......
......@@ -47,11 +47,13 @@
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<version>${solr.version}</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>${solr.version}</version>
</dependency>
<dependency>
......@@ -100,4 +102,4 @@
</build>
</project>
\ No newline at end of file
</project>
......@@ -60,6 +60,7 @@ import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.impl.HttpClientUtil;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
import org.apache.solr.client.solrj.impl.LBHttpSolrClient;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.client.solrj.request.UpdateRequest;
......@@ -206,11 +207,13 @@ public class Solr5Index implements IndexProvider {
waitSearcher = config.get(WAIT_SEARCHER);
if (mode==Mode.CLOUD) {
HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
String zookeeperUrl = config.get(Solr5Index.ZOOKEEPER_URL);
CloudSolrClient cloudServer = new CloudSolrClient(zookeeperUrl, true);
cloudServer.connect();
solrClient = cloudServer;
} else if (mode==Mode.HTTP) {
HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
HttpClient clientParams = HttpClientUtil.createClient(new ModifiableSolrParams() {{
add(HttpClientUtil.PROP_ALLOW_COMPRESSION, config.get(HTTP_ALLOW_COMPRESSION).toString());
add(HttpClientUtil.PROP_CONNECTION_TIMEOUT, config.get(HTTP_CONNECTION_TIMEOUT).toString());
......@@ -756,7 +759,7 @@ public class Solr5Index implements IndexProvider {
if (mode!=Mode.CLOUD) throw new UnsupportedOperationException("Operation only supported for SolrCloud");
logger.debug("Clearing storage from Solr: {}", solrClient);
ZkStateReader zkStateReader = ((CloudSolrClient) solrClient).getZkStateReader();
zkStateReader.updateClusterState(true);
zkStateReader.updateClusterState();
ClusterState clusterState = zkStateReader.getClusterState();
for (String collection : clusterState.getCollections()) {
logger.debug("Clearing collection [{}] in Solr",collection);
......@@ -911,7 +914,7 @@ public class Solr5Index implements IndexProvider {
*/
private static boolean checkIfCollectionExists(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {
ZkStateReader zkStateReader = server.getZkStateReader();
zkStateReader.updateClusterState(true);
zkStateReader.updateClusterState();
ClusterState clusterState = zkStateReader.getClusterState();
return clusterState.getCollectionOrNull(collection) != null;
}
......@@ -926,7 +929,7 @@ public class Solr5Index implements IndexProvider {
while (cont) {
boolean sawLiveRecovering = false;
zkStateReader.updateClusterState(true);
zkStateReader.updateClusterState();
ClusterState clusterState = zkStateReader.getClusterState();
Map<String, Slice> slices = clusterState.getSlicesMap(collection);
Preconditions.checkNotNull("Could not find collection:" + collection, slices);
......@@ -935,9 +938,8 @@ public class Solr5Index implements IndexProvider {
Map<String, Replica> shards = entry.getValue().getReplicasMap();
for (Map.Entry<String, Replica> shard : shards.entrySet()) {
String state = shard.getValue().getStr(ZkStateReader.STATE_PROP);
if ((state.equals(ZkStateReader.RECOVERING)
|| state.equals(ZkStateReader.SYNC) || state
.equals(ZkStateReader.DOWN))
if ((state.equals(Replica.State.RECOVERING)
|| state.equals(Replica.State.DOWN))
&& clusterState.liveNodesContain(shard.getValue().getStr(
ZkStateReader.NODE_NAME_PROP))) {
sawLiveRecovering = true;
......
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