You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2016/04/11 17:18:03 UTC
lucene-solr:apiv2: SOLR-8029 : More API spec
Repository: lucene-solr
Updated Branches:
refs/heads/apiv2 f1155e1c0 -> c72aeac59
SOLR-8029 : More API spec
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c72aeac5
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c72aeac5
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c72aeac5
Branch: refs/heads/apiv2
Commit: c72aeac59e4f736e250ec7f4a5faad5903866394
Parents: f1155e1
Author: Noble Paul <no...@apache.org>
Authored: Mon Apr 11 20:47:53 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Mon Apr 11 20:47:53 2016 +0530
----------------------------------------------------------------------
.../handler/admin/CollectionHandlerApi.java | 22 ++++++++++++++---
.../collections.collection.Commands.json | 15 ++++++++++-
.../collections.collection.Commands.modify.json | 3 ++-
.../collections.collection.shards.Commands.json | 18 +++++++++++---
...ctions.collection.shards.shard.Commands.json | 24 ++++++++++++++++++
...ollection.shards.shard.replica.Commands.json | 26 ++++++++++++++++++--
.../apispec/core.config.Params.Commands.json | 1 -
7 files changed, 98 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c72aeac5/solr/core/src/java/org/apache/solr/handler/admin/CollectionHandlerApi.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CollectionHandlerApi.java b/solr/core/src/java/org/apache/solr/handler/admin/CollectionHandlerApi.java
index fd313f9..3e3069e 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionHandlerApi.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionHandlerApi.java
@@ -98,6 +98,10 @@ public class CollectionHandlerApi extends BaseHandlerApiSupport {
"target.collection", "target",
"forward.timeout", "forwardTimeout"
)),
+ REBALANCELEADERS(EndPoint.PER_COLLECTION,
+ POST,
+ REBALANCELEADERS_OP,
+ "rebalance-leaders", null),
CREATE_ALIAS(EndPoint.COLLECTIONS_COMMANDS,
POST,
CREATEALIAS_OP,
@@ -113,7 +117,8 @@ public class CollectionHandlerApi extends BaseHandlerApiSupport {
POST,
CREATESHARD_OP,
"create",
- null),
+ null,
+ ImmutableMap.of("coreProperties.", "property.")),
SPLIT_SHARD(EndPoint.PER_COLLECTION_SHARDS_COMMANDS,
POST,
@@ -130,7 +135,8 @@ public class CollectionHandlerApi extends BaseHandlerApiSupport {
POST,
ADDREPLICA_OP,
"create-replica",
- null),
+ null,
+ ImmutableMap.of("coreProperties.", "property.")),
DELETE_REPLICA(EndPoint.PER_COLLECTION_PER_SHARD_PER_REPLICA_DELETE,
DELETE,
@@ -140,7 +146,17 @@ public class CollectionHandlerApi extends BaseHandlerApiSupport {
POST,
SYNCSHARD_OP,
"synch-shard",
- null),;
+ null),
+ ADDREPLICAPROP(EndPoint.PER_COLLECTION_PER_SHARD_PER_REPLICA_COMMANDS,
+ POST,
+ ADDREPLICAPROP_OP,
+ "set-property",
+ ImmutableMap.of("property", "name", "property.value", "value")),
+ DELETEREPLICAPROP(EndPoint.PER_COLLECTION_PER_SHARD_PER_REPLICA_COMMANDS,
+ POST,
+ DELETEREPLICAPROP_OP,
+ "delete-property",
+ ImmutableMap.of("property", ""));
public final String commandName;
public final EndPoint endPoint;
public final SolrRequest.METHOD method;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c72aeac5/solr/core/src/resources/apispec/collections.collection.Commands.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/collections.collection.Commands.json b/solr/core/src/resources/apispec/collections.collection.Commands.json
index a9b271d..98553ca 100644
--- a/solr/core/src/resources/apispec/collections.collection.Commands.json
+++ b/solr/core/src/resources/apispec/collections.collection.Commands.json
@@ -11,6 +11,19 @@
},
"commands": {
"modify": "collections.collection.Commands.modify",
- "reload": "collections.collection.Commands.reload"
+ "reload": "collections.collection.Commands.reload",
+ "rebalance-leaders" :{
+ "type":"object",
+ "properties":{
+ "maxAtOnce":{
+ "type":"number",
+ "description":"The maximum number of reassignments to have queue up at once. Values <=0 are use the default value Integer.MAX_VALUE. When this number is reached, the process waits for one or more leaders to be successfully assigned before adding more to the queue."
+ },
+ "maxWaitSeconds":{
+ "type":"number",
+ "description":"This is the timeout value when waiting for leaders to be reassigned"
+ }
+ }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c72aeac5/solr/core/src/resources/apispec/collections.collection.Commands.modify.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/collections.collection.Commands.modify.json b/solr/core/src/resources/apispec/collections.collection.Commands.modify.json
index 5cfe6ae..96e3727 100644
--- a/solr/core/src/resources/apispec/collections.collection.Commands.modify.json
+++ b/solr/core/src/resources/apispec/collections.collection.Commands.modify.json
@@ -1,6 +1,7 @@
{
+ "documentation":"https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-modifycoll",
+ "description":"",
"type": "object",
- "additionalProperties":true,
"properties":{
"rule": {
"type": "array",
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c72aeac5/solr/core/src/resources/apispec/collections.collection.shards.Commands.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/collections.collection.shards.Commands.json b/solr/core/src/resources/apispec/collections.collection.shards.Commands.json
index fe5892e..3421b38 100644
--- a/solr/core/src/resources/apispec/collections.collection.shards.Commands.json
+++ b/solr/core/src/resources/apispec/collections.collection.shards.Commands.json
@@ -30,12 +30,24 @@
"type":"object",
"additionalProperties":true
}
- },
- "additionalProperties": true
+ }
},
"create": {
"type":"object",
- "additionalProperties":true
+ "properties": {
+ "createNodeSet": {
+ "description": "Allows defining the nodes to spread the new collection across",
+ "type": "string"
+ },
+ "shard": {
+ "description": "The name of the shard to be created",
+ "type": "string"
+ },
+ "coreProperties": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c72aeac5/solr/core/src/resources/apispec/collections.collection.shards.shard.Commands.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/collections.collection.shards.shard.Commands.json b/solr/core/src/resources/apispec/collections.collection.shards.shard.Commands.json
index 1b9e8cb..bd55b17 100644
--- a/solr/core/src/resources/apispec/collections.collection.shards.shard.Commands.json
+++ b/solr/core/src/resources/apispec/collections.collection.shards.shard.Commands.json
@@ -13,9 +13,33 @@
"commands": {
"add-replica": {
"type" : "object",
+ "properties": {
+ "_route_": {
+ "type": "string",
+ "description": "If the exact shard name is not known, users may pass the _route_ value and the system would identify the name of the shard. Ignored if the shard param is also specified"
+ },
+ "node": {
+ "type": "string",
+ "description": "The name of the node where the replica should be created"
+ },
+ "instanceDir": {
+ "type": "string",
+ "description": "The instanceDir for the core that will be created"
+ },
+ "dataDir": {
+ "type": "string",
+ "description": "The directory in which the core should be created"
+ },
+ "coreProperties":{
+ "type":"object",
+ "additionalProperties":true
+ }
+ },
"additionalProperties": true
},
"force-leader": {
+ "description":"In the unlikely event of a shard losing its leader, this command can be invoked to force the election of a new leader",
+ "documentation" :"https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-ForceLeader",
"type" : "object",
"additionalProperties": true
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c72aeac5/solr/core/src/resources/apispec/collections.collection.shards.shard.replica.Commands.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/collections.collection.shards.shard.replica.Commands.json b/solr/core/src/resources/apispec/collections.collection.shards.shard.replica.Commands.json
index 2f7ca4b..afee35c 100644
--- a/solr/core/src/resources/apispec/collections.collection.shards.shard.replica.Commands.json
+++ b/solr/core/src/resources/apispec/collections.collection.shards.shard.replica.Commands.json
@@ -10,9 +10,31 @@
]
},
"commands": {
- "set": {
+ "set-property": {
+ "description": "Assign an arbitrary property to a particular replica and give it the value specified. If the property already exists, it will be overwritten with the new value",
"type":"object",
- "additionalProperties": true
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The property name"
+ },
+ "value": {
+ "type": "string",
+ "description": "The property name"
+ },
+ "shardUnique": {
+ "type": "boolean",
+ "description": "If true, then setting this property in one replica will remove the property from all other replicas in that shard"
+ }
+ }
+ },
+ "delete-property": {
+ "description": "Deletes an arbitrary property from a particular replica",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c72aeac5/solr/core/src/resources/apispec/core.config.Params.Commands.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/core.config.Params.Commands.json b/solr/core/src/resources/apispec/core.config.Params.Commands.json
index 597026d..0c1196e 100644
--- a/solr/core/src/resources/apispec/core.config.Params.Commands.json
+++ b/solr/core/src/resources/apispec/core.config.Params.Commands.json
@@ -24,7 +24,6 @@
"update": {
"type":"object",
"description": "update one or more configsets",
- "type": "object",
"additionalProperties": true
}
}