Skip to content

Commit

Permalink
[Enhance](multi-catalog) Use MetaIdMappingsLog
Browse files Browse the repository at this point in the history
  to replace InitCatalogLog/InitDatabaseLog.
  • Loading branch information
wangxiangyu committed Feb 23, 2024
1 parent 0fdcf47 commit f1075dc
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.doris.datasource.hive.event;

import org.apache.doris.analysis.RedirectStatus;
import org.apache.doris.analysis.UserIdentity;
import org.apache.doris.catalog.Env;
import org.apache.doris.common.Config;
import org.apache.doris.common.util.MasterDaemon;
Expand All @@ -29,6 +30,7 @@
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.qe.MasterOpExecutor;
import org.apache.doris.qe.OriginStatement;
import org.apache.doris.system.SystemInfoService;

import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -308,7 +310,12 @@ private void refreshCatalogForSlave(HMSExternalCatalog hmsExternalCatalog) throw
// Transfer to master to refresh catalog
String sql = "REFRESH CATALOG " + hmsExternalCatalog.getName();
OriginStatement originStmt = new OriginStatement(sql, 0);
MasterOpExecutor masterOpExecutor = new MasterOpExecutor(originStmt, new ConnectContext(),
ConnectContext ctx = new ConnectContext();
ctx.setQualifiedUser(UserIdentity.ROOT.getQualifiedUser());
ctx.setCurrentUserIdentity(UserIdentity.ROOT);
ctx.setEnv(Env.getCurrentEnv());
ctx.setCluster(SystemInfoService.DEFAULT_CLUSTER);
MasterOpExecutor masterOpExecutor = new MasterOpExecutor(originStmt, ctx,
RedirectStatus.FORWARD_WITH_SYNC, false);
if (LOG.isDebugEnabled()) {
LOG.debug("Transfer to master to refresh catalog, stmt: {}", sql);
Expand Down

0 comments on commit f1075dc

Please sign in to comment.