Skip to content

Commit

Permalink
[feat](cloud) S3 storage vault support property use_path_style
Browse files Browse the repository at this point in the history
  • Loading branch information
SWJTU-ZhangLei committed Nov 1, 2024
1 parent 601d801 commit 261f979
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
18 changes: 9 additions & 9 deletions be/src/util/s3_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,15 @@ S3Conf S3Conf::get_s3_conf(const cloud::ObjectStoreInfoPB& info) {
S3Conf ret {
.bucket = info.bucket(),
.prefix = info.prefix(),
.client_conf {
.endpoint = info.endpoint(),
.region = info.region(),
.ak = info.ak(),
.sk = info.sk(),
.token {},
.bucket = info.bucket(),
.provider = io::ObjStorageType::AWS,
},
.client_conf {.endpoint = info.endpoint(),
.region = info.region(),
.ak = info.ak(),
.sk = info.sk(),
.token {},
.bucket = info.bucket(),
.provider = io::ObjStorageType::AWS,
.use_virtual_addressing =
info.has_use_path_style() ? !info.use_path_style() : true},
.sse_enabled = info.sse_enabled(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ public static Cloud.ObjectStoreInfoPB.Builder getObjStoreInfoPB(Map<String, Stri
// S3 Provider properties should be case insensitive.
builder.setProvider(Provider.valueOf(properties.get(S3Properties.PROVIDER).toUpperCase()));
}

if (properties.containsKey(PropertyConverter.USE_PATH_STYLE)
&& properties.get(PropertyConverter.USE_PATH_STYLE).equalsIgnoreCase("true")) {
builder.setUsePathStyle(true);
}
return builder;
}
}
1 change: 1 addition & 0 deletions gensrc/proto/cloud.proto
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ message ObjectStoreInfoPB {
optional string user_id = 13;
optional EncryptionInfoPB encryption_info = 14;
optional bool sse_enabled = 15;
optional bool use_path_style = 16;
}

// The legacy ObjectStoreInfoPB is stored in InstanceInfoPB
Expand Down

0 comments on commit 261f979

Please sign in to comment.