Skip to content

Commit

Permalink
modify oss configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
guowl3 committed Jan 8, 2025
1 parent 27707b9 commit 2d3b5aa
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public boolean isODPSharding() {
}

public boolean isDefaultSchemaRequired() {
return isODPSharding() || this.dialectType == DialectType.FILE_SYSTEM;
return isODPSharding();
}

public static ConnectType from(DialectType dialectType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ private ConnectionConfig reqToConnectionConfig(TestConnectionReq req) {
config.setServiceName(req.getServiceName());
config.setUserRole(req.getUserRole());
config.setCatalogName(req.getCatalogName());
config.setRegion(req.getRegion());

OBTenantEndpoint endpoint = req.getEndpoint();
if (Objects.nonNull(endpoint) && OceanBaseAccessMode.IC_PROXY == endpoint.getAccessMode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class FileSystemConnectionTesting {

public ConnectionTestResult test(@NonNull ConnectionConfig config) {
PreConditions.notBlank(config.getPassword(), "AccessKeySecret");
PreConditions.notBlank(config.getRegion(), "Region");
URI uri = URI.create(config.getHost());
ObjectStorageConfiguration storageConfig = new ObjectStorageConfiguration();
storageConfig.setAccessKeyId(config.getUsername());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.oceanbase.odc.service.connection.model;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

Expand Down Expand Up @@ -46,6 +47,9 @@
@Data
@ToString(exclude = {"password"})
public class TestConnectionReq implements CloudConnectionConfig, SSLConnectionConfig {

private static final String REGION = "region";

/**
* Connection ID,用于编辑连接页面未传密码参数时从已保存的连接信息中获取对应密码字段
*/
Expand Down Expand Up @@ -157,6 +161,21 @@ public DialectType getDialectType() {
return this.dialectType;
}

public void setRegion(String region) {
if (this.attributes == null) {
attributes = new HashMap<>();
}
attributes.put(REGION, region);
}

public String getRegion() {
if (this.attributes == null) {
return null;
}
Object o = attributes.get(REGION);
return o == null ? null : o.toString();
}

public static TestConnectionReq fromConnection(ConnectionConfig connection,
ConnectionAccountType accountType) {
PreConditions.notNull(accountType, "AccountType");
Expand Down

0 comments on commit 2d3b5aa

Please sign in to comment.