001package gudusoft.gsqlparser.nodes;
002
003import gudusoft.gsqlparser.TSourceToken;
004import gudusoft.gsqlparser.nodes.flink.TFlinkTableProperty;
005
006/**
007 * AST node for StarRocks ALTER STORAGE VOLUME statement.
008 *
009 * Syntax:
010 * ALTER STORAGE VOLUME [ IF EXISTS ] <storage_volume_name>
011 * { COMMENT = '<comment_string>' | SET ("key" = "value"[,...]) }
012 *
013 * Examples:
014 * ALTER STORAGE VOLUME my_s3_volume SET ("enabled" = "false");
015 * ALTER STORAGE VOLUME my_s3_volume COMMENT = 'Updated description';
016 */
017public class TAlterStorageVolumeSqlNode extends TParseTreeNode {
018    // Alter action type
019    public enum EAlterStorageVolumeAction {
020        SET,     // SET (properties)
021        COMMENT  // COMMENT = 'string'
022    }
023
024    // Storage volume name
025    private TObjectName volumeName;
026
027    // IF EXISTS flag
028    private boolean ifExists;
029
030    // Action type
031    private EAlterStorageVolumeAction actionType;
032
033    // New comment (for COMMENT action)
034    private TSourceToken comment;
035
036    // Properties to set (for SET action)
037    private TParseTreeNode properties;
038
039    // Getters and setters
040    public TObjectName getVolumeName() {
041        return volumeName;
042    }
043
044    public void setVolumeName(TObjectName volumeName) {
045        this.volumeName = volumeName;
046    }
047
048    public boolean isIfExists() {
049        return ifExists;
050    }
051
052    public void setIfExists(boolean ifExists) {
053        this.ifExists = ifExists;
054    }
055
056    public EAlterStorageVolumeAction getActionType() {
057        return actionType;
058    }
059
060    public void setActionType(EAlterStorageVolumeAction actionType) {
061        this.actionType = actionType;
062    }
063
064    public TSourceToken getComment() {
065        return comment;
066    }
067
068    public void setComment(TSourceToken comment) {
069        this.comment = comment;
070    }
071
072    @SuppressWarnings("unchecked")
073    public TPTNodeList<TFlinkTableProperty> getProperties() {
074        return (TPTNodeList<TFlinkTableProperty>) properties;
075    }
076
077    public void setProperties(TParseTreeNode properties) {
078        this.properties = properties;
079    }
080
081    public void init(Object arg1) {
082        this.volumeName = (TObjectName) arg1;
083    }
084}