helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HELIX-592) addCluster should respect overwriteExisitng when adding stateModelDefinations
Date Tue, 12 May 2015 20:47:00 GMT

    [ https://issues.apache.org/jira/browse/HELIX-592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14540675#comment-14540675
] 

ASF GitHub Bot commented on HELIX-592:
--------------------------------------

Github user lei-xia commented on a diff in the pull request:

    https://github.com/apache/helix/pull/27#discussion_r30178394
  
    --- Diff: helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java ---
    @@ -715,14 +715,26 @@ public ExternalView getResourceExternalView(String clusterName,
String resourceN
       @Override
       public void addStateModelDef(String clusterName, String stateModelDef,
           StateModelDefinition stateModel) {
    +    addStateModelDef(clusterName, stateModelDef, stateModel, false);
    +  }
    +
    +  @Override
    +  public void addStateModelDef(String clusterName, String stateModelDef,
    +      StateModelDefinition stateModel, boolean recreateIfExists) {
         if (!ZKUtil.isClusterSetup(clusterName, _zkClient)) {
           throw new HelixException("cluster " + clusterName + " is not setup yet");
         }
         String stateModelDefPath = HelixUtil.getStateModelDefinitionPath(clusterName);
         String stateModelPath = stateModelDefPath + "/" + stateModelDef;
         if (_zkClient.exists(stateModelPath)) {
    -      logger.warn("Skip the operation.State Model directory exists:" + stateModelPath);
    -      throw new HelixException("State model path " + stateModelPath + " already exists.");
    +      if (recreateIfExists) {
    +        logger.warn("Operation.State Model directory exists:" + stateModelPath +
    --- End diff --
    
    Fixed in new diff.  Thanks!


> addCluster should respect overwriteExisitng when adding stateModelDefinations
> -----------------------------------------------------------------------------
>
>                 Key: HELIX-592
>                 URL: https://issues.apache.org/jira/browse/HELIX-592
>             Project: Apache Helix
>          Issue Type: Bug
>            Reporter: Congrui Ji
>
> Currently addCluster in clusterSetup.java ignores the overwriteExisitng parameter while
adding stateModelDefinations. This causes exception -StateModelDef already exist. please help
fix this



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message