From 51bb1242b7f6dfcc4b2b80c44381311c81b1d910 Mon Sep 17 00:00:00 2001 From: "zijia.cj" Date: Wed, 13 Nov 2024 14:35:32 +0800 Subject: [PATCH] Refactor external table file sync response handling --- .../odc/server/web/controller/v2/DBTableController.java | 3 ++- .../java/com/oceanbase/odc/service/db/DBTableService.java | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/server/odc-server/src/main/java/com/oceanbase/odc/server/web/controller/v2/DBTableController.java b/server/odc-server/src/main/java/com/oceanbase/odc/server/web/controller/v2/DBTableController.java index 1e839a8abc..f43ef9cffd 100644 --- a/server/odc-server/src/main/java/com/oceanbase/odc/server/web/controller/v2/DBTableController.java +++ b/server/odc-server/src/main/java/com/oceanbase/odc/server/web/controller/v2/DBTableController.java @@ -131,6 +131,7 @@ public SuccessResponse syncExternalTableFiles(@PathVariable String sessionId, Base64.Decoder decoder = Base64.getDecoder(); externalTableName = new String(decoder.decode(externalTableName)); ConnectionSession session = sessionService.nullSafeGet(sessionId, true); - return tableService.syncExternalTableFiles(session, databaseName, externalTableName); + tableService.syncExternalTableFiles(session, databaseName, externalTableName); + return Responses.empty(); } } diff --git a/server/odc-service/src/main/java/com/oceanbase/odc/service/db/DBTableService.java b/server/odc-service/src/main/java/com/oceanbase/odc/service/db/DBTableService.java index 23b6da4f37..aca03c466a 100644 --- a/server/odc-service/src/main/java/com/oceanbase/odc/service/db/DBTableService.java +++ b/server/odc-service/src/main/java/com/oceanbase/odc/service/db/DBTableService.java @@ -39,8 +39,6 @@ import com.oceanbase.odc.core.shared.exception.UnexpectedException; import com.oceanbase.odc.core.shared.model.TableIdentity; import com.oceanbase.odc.plugin.schema.api.TableExtensionPoint; -import com.oceanbase.odc.service.common.response.Responses; -import com.oceanbase.odc.service.common.response.SuccessResponse; import com.oceanbase.odc.service.common.util.SqlUtils; import com.oceanbase.odc.service.db.browser.DBSchemaAccessors; import com.oceanbase.odc.service.db.model.GenerateTableDDLResp; @@ -185,7 +183,7 @@ public GenerateTableDDLResp generateUpdateDDL(@NotNull ConnectionSession session .build(); } - public SuccessResponse syncExternalTableFiles(@NotNull ConnectionSession connectionSession, String schemaName, + public void syncExternalTableFiles(@NotNull ConnectionSession connectionSession, String schemaName, @NotBlank String externalTableName) { DBSchemaAccessor schemaAccessor = DBSchemaAccessors.create(connectionSession); PreConditions.validExists(ResourceType.OB_TABLE, "tableName", externalTableName, @@ -195,7 +193,6 @@ public SuccessResponse syncExternalTableFiles(@NotNull ConnectionSession connect connectionSession.getSyncJdbcExecutor(ConnectionSessionConstants.BACKEND_DS_KEY) .execute((ConnectionCallback) con -> getTableExtensionPoint(connectionSession) .syncExternalTableFiles(con, schemaName, externalTableName)); - return Responses.empty(); } private String checkUpdateDDL(DialectType dialectType, String ddl) {