-
Notifications
You must be signed in to change notification settings - Fork 49
feat: simpler routing info #2514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
size-limit report 📦
|
1f5a456 to
01cd002
Compare
| } | ||
|
|
||
| /** | ||
| * @deprecated will be removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weboko mentioned it might be good to move this to core. I have no strong opinion on the matter.
| public pubsubTopic: PubsubTopic; | ||
| public shardId: ShardId; | ||
|
|
||
| protected constructor( | ||
| public networkConfig: NetworkConfig, | ||
| public pubsubTopic: PubsubTopic, | ||
| public shardId: ShardId | ||
| ) {} | ||
| pubsubTopic: PubsubTopic, | ||
| shardId: ShardId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change? When you don't do it for networkConfig?
| } | ||
| } | ||
|
|
||
| export function isAutoShardingRoutingInfo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if those are actually used? I wonder if they are actually needed.
| export * from "./local_storage.js"; | ||
| export * from "./sharding.js"; | ||
| export * from "./health_status.js"; | ||
| export type { ShardInfo } from "./sharding.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is covered by the line above: export * from "./sharding.js";
| export type { ShardInfo } from "./sharding.js"; |
| numShardsInCluster | ||
| }; | ||
| const Shard = [ | ||
| AutoShardingRoutingInfo.fromContentTopic(ContentTopic, networkConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why won't you simply use createRoutingInfo in these types of places?
| clusterId: TestClusterId, | ||
| numShardsInCluster: TestNumShardsInCluster | ||
| }; | ||
| export const TestShardIndex = AutoShardingRoutingInfo.fromContentTopic( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you get it from TestRoutingInfo?
|
@adklempner confirmed this PR can be closed |
Problem / Description
There was some unnecessary code leftover after RouterInfo refactor
Solution
Consolidate core sharding functions into unified routing info classes:
isAutoShardingRoutingInfo)formatPubsubTopic,ensureValidContentTopic,contentTopicToShardIndexintorouting_info.tscreateRoutingInfo()patternNotes
contentTopicToPubsubTopiccreateRoutingInfo(networkConfig, { contentTopic }).pubsubTopicChecklist