Skip to content

Commit

Permalink
Refactor external table file sync response handling
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiacj committed Nov 13, 2024
1 parent 8dbb311 commit 51bb124
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -195,7 +193,6 @@ public SuccessResponse syncExternalTableFiles(@NotNull ConnectionSession connect
connectionSession.getSyncJdbcExecutor(ConnectionSessionConstants.BACKEND_DS_KEY)
.execute((ConnectionCallback<Boolean>) con -> getTableExtensionPoint(connectionSession)
.syncExternalTableFiles(con, schemaName, externalTableName));
return Responses.empty();
}

private String checkUpdateDDL(DialectType dialectType, String ddl) {
Expand Down

0 comments on commit 51bb124

Please sign in to comment.