You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2013/01/02 06:23:12 UTC
svn commit: r1427657 - in
/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update:
SolrCmdDistributor.java processor/DistributedUpdateProcessor.java
Author: markrmiller
Date: Wed Jan 2 05:23:11 2013
New Revision: 1427657
URL: http://svn.apache.org/viewvc?rev=1427657&view=rev
Log:
SOLR-3180: update node props for retry node, not just url
Modified:
lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java?rev=1427657&r1=1427656&r2=1427657&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java Wed Jan 2 05:23:11 2013
@@ -450,26 +450,20 @@ public class SolrCmdDistributor {
}
public static class StdNode extends Node {
- protected String url;
- protected String baseUrl;
- protected String coreName;
- private ZkCoreNodeProps nodeProps;
+ protected ZkCoreNodeProps nodeProps;
public StdNode(ZkCoreNodeProps nodeProps) {
- this.url = nodeProps.getCoreUrl();
- this.baseUrl = nodeProps.getBaseUrl();
- this.coreName = nodeProps.getCoreName();
this.nodeProps = nodeProps;
}
@Override
public String getUrl() {
- return url;
+ return nodeProps.getCoreUrl();
}
@Override
public String toString() {
- return this.getClass().getSimpleName() + ": " + url;
+ return this.getClass().getSimpleName() + ": " + nodeProps.getCoreUrl();
}
@Override
@@ -479,18 +473,21 @@ public class SolrCmdDistributor {
@Override
public String getBaseUrl() {
- return baseUrl;
+ return nodeProps.getBaseUrl();
}
@Override
public String getCoreName() {
- return coreName;
+ return nodeProps.getCoreName();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
+ String baseUrl = nodeProps.getBaseUrl();
+ String coreName = nodeProps.getCoreName();
+ String url = nodeProps.getCoreUrl();
result = prime * result + ((baseUrl == null) ? 0 : baseUrl.hashCode());
result = prime * result + ((coreName == null) ? 0 : coreName.hashCode());
result = prime * result + ((url == null) ? 0 : url.hashCode());
@@ -503,15 +500,18 @@ public class SolrCmdDistributor {
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
StdNode other = (StdNode) obj;
+ String baseUrl = nodeProps.getBaseUrl();
+ String coreName = nodeProps.getCoreName();
+ String url = nodeProps.getCoreUrl();
if (baseUrl == null) {
- if (other.baseUrl != null) return false;
- } else if (!baseUrl.equals(other.baseUrl)) return false;
+ if (other.nodeProps.getBaseUrl() != null) return false;
+ } else if (!baseUrl.equals(other.nodeProps.getBaseUrl())) return false;
if (coreName == null) {
- if (other.coreName != null) return false;
- } else if (!coreName.equals(other.coreName)) return false;
+ if (other.nodeProps.getCoreName() != null) return false;
+ } else if (!coreName.equals(other.nodeProps.getCoreName())) return false;
if (url == null) {
- if (other.url != null) return false;
- } else if (!url.equals(other.url)) return false;
+ if (other.nodeProps.getCoreUrl() != null) return false;
+ } else if (!url.equals(other.nodeProps.getCoreUrl())) return false;
return true;
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1427657&r1=1427656&r2=1427657&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java Wed Jan 2 05:23:11 2013
@@ -1117,11 +1117,6 @@ public class DistributedUpdateProcessor
this.collection = collection;
this.shardId = shardId;
}
-
- @Override
- public String toString() {
- return url;
- }
@Override
public boolean checkRetry() {
@@ -1134,7 +1129,7 @@ public class DistributedUpdateProcessor
return false;
}
- this.url = leaderProps.getCoreUrl();
+ this.nodeProps = leaderProps;
return true;
}
@@ -1155,9 +1150,9 @@ public class DistributedUpdateProcessor
if (!super.equals(obj)) return false;
if (getClass() != obj.getClass()) return false;
RetryNode other = (RetryNode) obj;
- if (url == null) {
- if (other.url != null) return false;
- } else if (!url.equals(other.url)) return false;
+ if (nodeProps.getCoreUrl() == null) {
+ if (other.nodeProps.getCoreUrl() != null) return false;
+ } else if (!nodeProps.getCoreUrl().equals(other.nodeProps.getCoreUrl())) return false;
return true;
}