gavinchou commented on code in PR #34195:
URL: https://github.com/apache/doris/pull/34195#discussion_r1581281218
##########
gensrc/proto/cloud.proto:
##########
@@ -782,6 +782,7 @@ message AlterObjStoreInfoRequest {
optional ObjectStoreInfoPB obj = 2;
optional Operation op = 3;
optional StorageVaultPB vault = 4;
+ optional bool set_as_default_storage_vault = 5;
Review Comment:
consider carrying the message back to caller of this PRC to tell if there is
an existing vault has been replaced.
##########
cloud/src/meta-service/meta_service_resource.cpp:
##########
@@ -765,6 +770,11 @@ void
MetaServiceImpl::alter_obj_store_info(google::protobuf::RpcController* cont
ret != 0) {
return;
}
+ if (request->has_set_as_default_storage_vault() &&
Review Comment:
Ditto
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/CreateStorageVaultStmt.java:
##########
@@ -102,6 +108,7 @@ public void analyze(Analyzer analyzer) throws UserException
{
if (type == null) {
throw new AnalysisException("Storage Vault type can't be null");
}
+ setAsDefault =
Boolean.parseBoolean(properties.getOrDefault(SET_AS_DEFAULT, "false"));
Review Comment:
what if an arbitrary string passed in? e.g
properties (
"set_as_default" = "10086"
)
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/StorageVault.java:
##########
@@ -120,17 +126,18 @@ public void setId(String id) {
StorageVaultType type = stmt.getStorageVaultType();
String name = stmt.getStorageVaultName();
boolean ifNotExists = stmt.isIfNotExists();
+ boolean setAsDefault = stmt.setAsDefault();
StorageVault vault;
switch (type) {
case HDFS:
- vault = new HdfsStorageVault(name, ifNotExists);
+ vault = new HdfsStorageVault(name, ifNotExists, setAsDefault);
Review Comment:
log if something here, it seems nothing has been logged?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]