Skip to content

Commit

Permalink
fix some test error
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyuxia committed Dec 2, 2024
1 parent 10f08ae commit 7475904
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected void startServices() throws Exception {

this.zkClient = ZooKeeperUtils.startZookeeperClient(conf, this);

this.metadataCache = new ServerMetadataCacheImpl();
this.metadataCache = new ServerMetadataCacheImpl(-1);

this.coordinatorService =
new CoordinatorService(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ public class ServerMetadataCacheImpl extends AbstractServerMetadataCache {
private static final Logger LOG = LoggerFactory.getLogger(ServerMetadataCacheImpl.class);

private final Lock bucketMetadataLock = new ReentrantLock();
private final int serverId;

public ServerMetadataCacheImpl() {
this(Integer.MIN_VALUE);
}

public ServerMetadataCacheImpl(int severId) {
super();
this.serverId = severId;
}

@Override
Expand All @@ -55,7 +61,10 @@ public void updateMetadata(ClusterMetadataInfo clusterMetadataInfo) {
HashMap<Integer, ServerNode> newAliveTableServers = new HashMap<>();
Set<ServerNode> aliveTabletServers =
clusterMetadataInfo.getAliveTabletServers();
LOG.info("Update alive table servers: {}", aliveTabletServers);
LOG.info(
"Update alive table servers: {} for server {}",
aliveTabletServers,
serverId);
for (ServerNode tabletServer : aliveTabletServers) {
newAliveTableServers.put(tabletServer.id(), tabletServer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected void startServices() throws Exception {

this.zkClient = ZooKeeperUtils.startZookeeperClient(conf, this);

this.metadataCache = new ServerMetadataCacheImpl();
this.metadataCache = new ServerMetadataCacheImpl(serverId);

// TODO set scheduler thread number.
this.scheduler = new FlussScheduler(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public static class Builder {
public Builder() {
// reduce testing resources
clusterConf.set(ConfigOptions.NETTY_SERVER_NUM_NETWORK_THREADS, 1);
clusterConf.set(ConfigOptions.NETTY_SERVER_NUM_WORKER_THREADS, 3);
clusterConf.set(ConfigOptions.NETTY_SERVER_NUM_WORKER_THREADS, 1);
}

/** Sets the number of tablet servers. */
Expand Down

0 comments on commit 7475904

Please sign in to comment.