001package gudusoft.gsqlparser.nodes; 002 003import gudusoft.gsqlparser.TSourceToken; 004import gudusoft.gsqlparser.nodes.flink.TFlinkTableProperty; 005 006/** 007 * AST node for StarRocks CREATE STORAGE VOLUME statement. 008 * 009 * Syntax: 010 * CREATE STORAGE VOLUME [IF NOT EXISTS] <storage_volume_name> 011 * TYPE = { S3 | HDFS | AZBLOB | ADLS2 | GS } 012 * LOCATIONS = ('<remote_storage_path>') 013 * [ COMMENT '<comment_string>' ] 014 * PROPERTIES ("key" = "value",...) 015 * 016 * Example: 017 * CREATE STORAGE VOLUME my_s3_volume 018 * TYPE = S3 019 * LOCATIONS = ("s3://mybucket/data/") 020 * COMMENT 'My S3 storage volume' 021 * PROPERTIES ( 022 * "enabled" = "true", 023 * "aws.s3.region" = "us-west-2", 024 * "aws.s3.access_key" = "XXXXX", 025 * "aws.s3.secret_key" = "YYYYY" 026 * ); 027 */ 028public class TCreateStorageVolumeSqlNode extends TParseTreeNode { 029 // Storage volume name 030 private TObjectName volumeName; 031 032 // IF NOT EXISTS flag 033 private boolean ifNotExists; 034 035 // Storage type (S3, HDFS, AZBLOB, ADLS2, GS) 036 private TSourceToken storageType; 037 038 // Locations list (can have multiple paths) 039 private TParseTreeNode locationsList; 040 041 // Optional comment 042 private TSourceToken comment; 043 044 // Properties 045 private TParseTreeNode properties; 046 047 // Getters and setters 048 public TObjectName getVolumeName() { 049 return volumeName; 050 } 051 052 public void setVolumeName(TObjectName volumeName) { 053 this.volumeName = volumeName; 054 } 055 056 public boolean isIfNotExists() { 057 return ifNotExists; 058 } 059 060 public void setIfNotExists(boolean ifNotExists) { 061 this.ifNotExists = ifNotExists; 062 } 063 064 public TSourceToken getStorageType() { 065 return storageType; 066 } 067 068 public void setStorageType(TSourceToken storageType) { 069 this.storageType = storageType; 070 } 071 072 @SuppressWarnings("unchecked") 073 public TPTNodeList<TSourceToken> getLocationsList() { 074 return (TPTNodeList<TSourceToken>) locationsList; 075 } 076 077 public void setLocationsList(TParseTreeNode locationsList) { 078 this.locationsList = locationsList; 079 } 080 081 public TSourceToken getComment() { 082 return comment; 083 } 084 085 public void setComment(TSourceToken comment) { 086 this.comment = comment; 087 } 088 089 @SuppressWarnings("unchecked") 090 public TPTNodeList<TFlinkTableProperty> getProperties() { 091 return (TPTNodeList<TFlinkTableProperty>) properties; 092 } 093 094 public void setProperties(TParseTreeNode properties) { 095 this.properties = properties; 096 } 097 098 public void init(Object arg1) { 099 this.volumeName = (TObjectName) arg1; 100 } 101}