You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by gu...@apache.org on 2019/02/19 14:53:44 UTC
[lucene-solr] 07/09: SOLR-13150 couple minor tweaks
This is an automated email from the ASF dual-hosted git repository.
gus pushed a commit to branch solr-13131
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit cc1e108b2041d1e7b18ffbc069b7d9aef82b1c70
Author: Gus Heck <gu...@apache.org>
AuthorDate: Mon Feb 18 23:31:23 2019 -0500
SOLR-13150 couple minor tweaks
---
.../solr/cloud/api/collections/CategoryRoutedAlias.java | 2 +-
.../apache/solr/handler/admin/CollectionsHandler.java | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/CategoryRoutedAlias.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CategoryRoutedAlias.java
index 0c98562..a5a5bce 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CategoryRoutedAlias.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CategoryRoutedAlias.java
@@ -128,7 +128,7 @@ public class CategoryRoutedAlias implements RoutedAlias {
if (cols.stream()
.filter(x -> !x.contains(UNINITIALIZED)).count() >= Integer.valueOf(maxCardinality)) {
- throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Max cardinality " + maxCardinality
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Max cardinality " + maxCardinality
+ " reached for Category Routed Alias: " + getAliasName());
}
}
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
index f1f9a27..c448c71 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
@@ -564,7 +564,7 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
}
if (collections != null) {
if (routedAlias != null) {
- throw new SolrException(BAD_REQUEST, "Collections cannot be specified when creating a time routed alias.");
+ throw new SolrException(BAD_REQUEST, "Collections cannot be specified when creating a routed alias.");
} else {
//////////////////////////////////////
// Regular alias creation indicated //
@@ -1277,14 +1277,14 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
log.info("Not waiting for active collection due to exception: " + createCollResponse.getResponse().get("exception"));
return;
}
-
+
int replicaFailCount;
if (createCollResponse.getResponse().get("failure") != null) {
replicaFailCount = ((NamedList) createCollResponse.getResponse().get("failure")).size();
} else {
replicaFailCount = 0;
}
-
+
CloudConfig ccfg = cc.getConfig().getCloudConfig();
Integer seconds = ccfg.getCreateCollectionWaitTimeTillActive();
Boolean checkLeaderOnly = ccfg.isCreateCollectionCheckLeaderActive();
@@ -1298,7 +1298,7 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
// the collection was not created, don't wait
return true;
}
-
+
if (c.getSlices() != null) {
Collection<Slice> shards = c.getSlices();
int replicaNotAliveCnt = 0;
@@ -1326,13 +1326,13 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
return false;
});
} catch (TimeoutException | InterruptedException e) {
-
+
String error = "Timeout waiting for active collection " + collectionName + " with timeout=" + seconds;
throw new NotInClusterStateException(ErrorCode.SERVER_ERROR, error);
}
-
+
}
-
+
public static void verifyRuleParams(CoreContainer cc, Map<String, Object> m) {
List l = (List) m.get(RULE);
if (l != null) {
@@ -1368,7 +1368,7 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
}
return props;
}
-
+
private static void verifyShardsParam(String shardsParam) {
for (String shard : shardsParam.split(",")) {
SolrIdentifierValidator.validateShardName(shard);