You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by lp...@apache.org on 2017/08/29 13:25:10 UTC
[07/50] [abbrv] ambari git commit: AMBARI-21737 - Ambari should
expose whether a service is able to rolling-restart instead of hard coding
service name (mradhakrishnan)
AMBARI-21737 - Ambari should expose whether a service is able to rolling-restart instead of hard coding service name (mradhakrishnan)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/54513bf0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/54513bf0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/54513bf0
Branch: refs/heads/feature-branch-AMBARI-21307
Commit: 54513bf0fc4a08552b326f9d4482c1bcd350ee7b
Parents: 2e5139a
Author: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Authored: Wed Aug 23 13:19:22 2017 -0700
Committer: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Committed: Wed Aug 23 13:19:22 2017 -0700
----------------------------------------------------------------------
.../controller/StackServiceComponentResponse.java | 16 ++++++++++++++++
.../StackServiceComponentResourceProvider.java | 7 ++++++-
.../apache/ambari/server/state/ComponentInfo.java | 15 +++++++++++++++
.../common-services/KAFKA/0.10.0.3.0/metainfo.xml | 1 +
.../common-services/KAFKA/0.8.1/metainfo.xml | 1 +
ambari-server/src/main/resources/properties.json | 1 +
ambari-web/app/mappers/stack_service_mapper.js | 1 +
ambari-web/app/models/stack_service_component.js | 3 ++-
8 files changed, 43 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/54513bf0/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java
index 0b0a5da..75fac6e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java
@@ -89,6 +89,11 @@ public class StackServiceComponentResponse {
private String decommissionAllowed;
/**
+ * Whether the component supports rolling restart.
+ * */
+ private boolean rollingRestartSupported;
+
+ /**
* auto deploy information
*/
private AutoDeployInfo autoDeploy;
@@ -133,6 +138,7 @@ public class StackServiceComponentResponse {
bulkCommandsDisplayName = getBulkCommandsDisplayName(component);
bulkCommandMasterComponentName = getBulkCommandsMasterComponentName(component);
reassignAllowed = component.getReassignAllowed();
+ rollingRestartSupported = component.getRollingRestartSupported();
// the custom command names defined for this component
List<CustomCommandDefinition> definitions = component.getCustomCommands();
@@ -410,6 +416,16 @@ public class StackServiceComponentResponse {
}
/**
+ * Get whether the component supports rolling restart
+ *
+ * @return whether the component supports rolling restart
+ */
+ @ApiModelProperty(name = "rollingRestartSupported")
+ public boolean isRollingRestartSupported(){
+ return rollingRestartSupported;
+ }
+
+ /**
* Get whether the components can be reassigned.
*
* @return Whether the components can be reassigned
http://git-wip-us.apache.org/repos/asf/ambari/blob/54513bf0/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceComponentResourceProvider.java
index 96993da..b9661bb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceComponentResourceProvider.java
@@ -41,7 +41,7 @@ import org.apache.ambari.server.state.AutoDeployInfo;
public class StackServiceComponentResourceProvider extends
ReadOnlyResourceProvider {
-
+
private static final String STACK_NAME_PROPERTY_ID = PropertyHelper.getPropertyId(
"StackServiceComponents", "stack_name");
@@ -93,6 +93,9 @@ public class StackServiceComponentResourceProvider extends
private static final String RECOVERY_ENABLED = PropertyHelper.getPropertyId(
"StackServiceComponents", "recovery_enabled");
+ private static final String ROLLING_RESTART_SUPPORTED = PropertyHelper.getPropertyId(
+ "StackServiceComponents", "rolling_restart_supported");
+
private static final String AUTO_DEPLOY_ENABLED_ID = PropertyHelper.getPropertyId(
"auto_deploy", "enabled");
@@ -190,6 +193,8 @@ public class StackServiceComponentResourceProvider extends
setResourceProperty(resource, HAS_BULK_COMMANDS_PROPERTY_ID,
response.hasBulkCommands(), requestedIds);
+ setResourceProperty(resource, ROLLING_RESTART_SUPPORTED, response.isRollingRestartSupported(), requestedIds);
+
AutoDeployInfo autoDeployInfo = response.getAutoDeploy();
if (autoDeployInfo != null) {
setResourceProperty(resource, AUTO_DEPLOY_ENABLED_ID,
http://git-wip-us.apache.org/repos/asf/ambari/blob/54513bf0/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
index a8a9a0f..d361a29 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
@@ -65,6 +65,12 @@ public class ComponentInfo {
private UnlimitedKeyJCERequirement unlimitedKeyJCERequired;
/**
+ * Used to determine if rolling restart is supported
+ * */
+ @XmlElements(@XmlElement(name = "rollingRestartSupported"))
+ private boolean rollingRestartSupported;
+
+ /**
* Added at schema ver 2
*/
private CommandScriptDefinition commandScript;
@@ -166,6 +172,7 @@ public class ComponentInfo {
timelineAppid = prototype.timelineAppid;
reassignAllowed = prototype.reassignAllowed;
customFolder = prototype.customFolder;
+ rollingRestartSupported = prototype.rollingRestartSupported;
}
public String getName() {
@@ -372,6 +379,14 @@ public class ComponentInfo {
this.decommissionAllowed = decommissionAllowed;
}
+ public boolean getRollingRestartSupported() {
+ return rollingRestartSupported;
+ }
+
+ public void setRollingRestartSupported(boolean rollingRestartSupported) {
+ this.rollingRestartSupported = rollingRestartSupported;
+ }
+
public UnlimitedKeyJCERequirement getUnlimitedKeyJCERequired() {
return unlimitedKeyJCERequired;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/54513bf0/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/metainfo.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/metainfo.xml
index f408ba3..164e15f 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/metainfo.xml
@@ -30,6 +30,7 @@
<category>MASTER</category>
<cardinality>1+</cardinality>
<versionAdvertised>true</versionAdvertised>
+ <rollingRestartSupported>true</rollingRestartSupported>
<dependencies>
<dependency>
<name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
http://git-wip-us.apache.org/repos/asf/ambari/blob/54513bf0/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metainfo.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metainfo.xml
index d322adc..6d44d4a 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metainfo.xml
@@ -30,6 +30,7 @@
<category>MASTER</category>
<cardinality>1+</cardinality>
<versionAdvertised>true</versionAdvertised>
+ <rollingRestartSupported>true</rollingRestartSupported>
<dependencies>
<dependency>
<name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
http://git-wip-us.apache.org/repos/asf/ambari/blob/54513bf0/ambari-server/src/main/resources/properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/properties.json b/ambari-server/src/main/resources/properties.json
index 11ca7f6..5f3acdd 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -232,6 +232,7 @@
"StackServiceComponents/has_bulk_commands_definition",
"StackServiceComponents/bulk_commands_display_name",
"StackServiceComponents/bulk_commands_master_component_name",
+ "StackServiceComponents/rolling_restart_supported",
"auto_deploy/enabled",
"auto_deploy/location",
"_"
http://git-wip-us.apache.org/repos/asf/ambari/blob/54513bf0/ambari-web/app/mappers/stack_service_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/stack_service_mapper.js b/ambari-web/app/mappers/stack_service_mapper.js
index 8931066..f49b4d0 100644
--- a/ambari-web/app/mappers/stack_service_mapper.js
+++ b/ambari-web/app/mappers/stack_service_mapper.js
@@ -61,6 +61,7 @@ App.stackServiceMapper = App.QuickDataMapper.create({
bulk_commands_master_component_name: 'bulk_commands_master_component_name',
service_name: 'service_name',
component_category: 'component_category',
+ rolling_restart_supported: 'rolling_restart_supported',
is_master: 'is_master',
is_client: 'is_client',
stack_name: 'stack_name',
http://git-wip-us.apache.org/repos/asf/ambari/blob/54513bf0/ambari-web/app/models/stack_service_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service_component.js b/ambari-web/app/models/stack_service_component.js
index eb6f2db..27aa8aa 100644
--- a/ambari-web/app/models/stack_service_component.js
+++ b/ambari-web/app/models/stack_service_component.js
@@ -35,6 +35,7 @@ App.StackServiceComponent = DS.Model.extend({
dependencies: DS.attr('array'),
serviceName: DS.attr('string'),
componentCategory: DS.attr('string'),
+ rollingRestartSupported: DS.attr('boolean'),
isMaster: DS.attr('boolean'),
isClient: DS.attr('boolean'),
stackName: DS.attr('string'),
@@ -84,7 +85,7 @@ App.StackServiceComponent = DS.Model.extend({
/** @property {Boolean} isRollinRestartAllowed - component supports rolling restart action **/
isRollinRestartAllowed: function() {
- return this.get('isSlave') || this.get('componentName') === 'KAFKA_BROKER';
+ return this.get('isSlave') || this.get('rollingRestartSupported');
}.property('componentName'),
/** @property {Boolean} isDecommissionAllowed - component supports decommission action **/