You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2018/07/09 22:57:17 UTC
[2/4] helix git commit: Fix reset partition REST command.
Fix reset partition REST command.
Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/d18e779e
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/d18e779e
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/d18e779e
Branch: refs/heads/master
Commit: d18e779eb529be04b0a5c5d3fd0cf26ff40f6182
Parents: aaa632f
Author: Lei Xia <lx...@linkedin.com>
Authored: Sat May 12 21:31:23 2018 -0700
Committer: Junkai Xue <jx...@jxue-mn2.linkedin.biz>
Committed: Mon Jul 9 15:56:40 2018 -0700
----------------------------------------------------------------------
.../org/apache/helix/rest/server/resources/AbstractResource.java | 1 +
.../helix/rest/server/resources/helix/InstanceAccessor.java | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/helix/blob/d18e779e/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java
----------------------------------------------------------------------
diff --git a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java
index e3c565d..dca0852 100644
--- a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java
+++ b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java
@@ -73,6 +73,7 @@ public class AbstractResource {
delete,
rebalance,
reset,
+ resetPartitions,
removeInstanceTag
}
http://git-wip-us.apache.org/repos/asf/helix/blob/d18e779e/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java
----------------------------------------------------------------------
diff --git a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java
index 31be5cf..98af0ee 100644
--- a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java
+++ b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java
@@ -230,12 +230,14 @@ public class InstanceAccessor extends AbstractHelixResource {
case disable:
admin.enableInstance(clusterId, instanceName, false);
break;
+
case reset:
+ case resetPartitions:
if (!validInstance(node, instanceName)) {
return badRequest("Instance names are not match!");
}
admin.resetPartition(clusterId, instanceName,
- node.get(InstanceProperties.resource.name()).toString(), (List<String>) OBJECT_MAPPER
+ node.get(InstanceProperties.resource.name()).getTextValue(), (List<String>) OBJECT_MAPPER
.readValue(node.get(InstanceProperties.partitions.name()).toString(),
OBJECT_MAPPER.getTypeFactory()
.constructCollectionType(List.class, String.class)));