core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLAlterCluster.java
public Object execute(final Map<Object, Object> iArgs) {
    if (attribute == null)
      throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");

    final List<OCluster> clusters = getClusters();

    if (clusters.isEmpty())
      throw new OCommandExecutionException("Cluster '" + clusterName + "' not found");

    Object result = null;

    for (OCluster cluster : getClusters()) {
      if (clusterId > -1 && clusterName.equals(String.valueOf(clusterId))) {
        clusterName = cluster.getName();
      } else {
        clusterId = cluster.getId();
      }

      try {
        if (attribute == ATTRIBUTES.STATUS && OStorageClusterConfiguration.STATUS.OFFLINE.toString().equalsIgnoreCase(value))
          // REMOVE CACHE OF COMMAND RESULTS IF ACTIVE
          getDatabase().getMetadata().getCommandCache().invalidateResultsOfCluster(clusterName);

        if (attribute == ATTRIBUTES.NAME)
          // REMOVE CACHE OF COMMAND RESULTS IF ACTIVE
          getDatabase().getMetadata().getCommandCache().invalidateResultsOfCluster(clusterName);

        result = cluster.set(attribute, value);
      } catch (IOException ioe) {
        throw OException.wrapException(new OCommandExecutionException("Error altering cluster '" + clusterName + "'"), ioe);
      }
    }

    return result;
  }
public Object execute(final Map<Object, Object> iArgs) {
    if (attribute == null)
      throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");

    final List<OCluster> clusters = getClusters();

    if (clusters.isEmpty())
      throw new OCommandExecutionException("Cluster '" + clusterName + "' not found");

    Object result = null;

    for (OCluster cluster : getClusters()) {
      if (clusterId > -1 && clusterName.equals(String.valueOf(clusterId))) {
        clusterName = cluster.getName();
      } else {
        clusterId = cluster.getId();
      }

      try {
        if (attribute == ATTRIBUTES.STATUS && OStorageClusterConfiguration.STATUS.OFFLINE.toString().equalsIgnoreCase(value))
          // REMOVE CACHE OF COMMAND RESULTS IF ACTIVE
          getDatabase().getMetadata().getCommandCache().invalidateResultsOfCluster(clusterName);

        if (attribute == ATTRIBUTES.NAME)
          // REMOVE CACHE OF COMMAND RESULTS IF ACTIVE
          getDatabase().getMetadata().getCommandCache().invalidateResultsOfCluster(clusterName);

        result = cluster.set(attribute, value);
      } catch (IOException ioe) {
        throw OException.wrapException(new OCommandExecutionException("Error altering cluster '" + clusterName + "'"), ioe);
      }
    }

    return result;
  }
public Object execute ( final Map < Object , Object > iArgs ) { if ( attribute == null ) throw new OCommandExecutionException ( "Cannot execute the command because it has not been parsed yet" ) ; final List < OCluster > clusters = getClusters ( ) ; if ( clusters . isEmpty ( ) ) throw new OCommandExecutionException ( "Cluster '" + clusterName + "' not found" ) ; Object result = null ; for ( OCluster cluster : getClusters ( ) ) { if ( clusterId > - 1 && clusterName . equals ( String . valueOf ( clusterId ) ) ) { clusterName = cluster . getName ( ) ; } else { clusterId = cluster . getId ( ) ; } try { if ( attribute == ATTRIBUTES . STATUS && OStorageClusterConfiguration . STATUS . OFFLINE . toString ( ) . equalsIgnoreCase ( value ) ) // REMOVE CACHE OF COMMAND RESULTS IF ACTIVE
 getDatabase ( ) . getMetadata ( ) . getCommandCache ( ) . invalidateResultsOfCluster ( clusterName ) ; if ( attribute == ATTRIBUTES . NAME ) // REMOVE CACHE OF COMMAND RESULTS IF ACTIVE
 getDatabase ( ) . getMetadata ( ) . getCommandCache ( ) . invalidateResultsOfCluster ( clusterName ) ; result = cluster . set ( attribute , value ) ; } catch ( IOException ioe ) { throw OException . wrapException ( new OCommandExecutionException ( "Error altering cluster '" + clusterName + "'" ) , ioe ) ; } } return result ; }
Execute the ALTER CLASS.
Execute the ALTER CLASS .