Why does Mgr mode only support cluster mode ?I want use it in memory mode !
See original GitHub issue// when i use mgr in memory mode ,it,conn`t work initHeartBeatJobs ! private void initHeartBeatJobs(final String databaseName, final Map<String, DataSource> dataSourceMap) { //when I use Mgr modeScheduleContext.isPresent() is false Optional<ModeScheduleContext> modeScheduleContext = ModeScheduleContextFactory.getInstance().get(); if (modeScheduleContext.isPresent()) { for (Entry<String, DatabaseDiscoveryDataSourceRule> entry : dataSourceRules.entrySet()) { DatabaseDiscoveryDataSourceRule rule = entry.getValue(); Map<String, DataSource> dataSources = dataSourceMap.entrySet().stream().filter(each -> !rule.getDisabledDataSourceNames().contains(each.getKey())) .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); String jobName = rule.getDatabaseDiscoveryProviderAlgorithm().getType() + “-” + databaseName + “-” + rule.getGroupName(); CronJob job = new CronJob(jobName, each -> new HeartbeatJob(databaseName, rule.getGroupName(), rule.getPrimaryDataSourceName(), dataSources, rule.getDatabaseDiscoveryProviderAlgorithm(), rule.getDisabledDataSourceNames()).execute(null), rule.getHeartbeatProps().getProperty(“keep-alive-cron”)); modeScheduleContext.get().startCronJob(job); } } }
Fixes https://github.com/apache/shardingsphere/issues/13875 part 7.
Changes proposed in this pull request:
Add ModeScheduleContext and integrate with ContextManager. Design for MGR scheduling requirement for now. Currently, not all mode type is supported:
Supported : “Cluster” mode type, “ZooKeeper” repository type Unsupported : “Standalone” mode type, “Memory” mode type and other repository type in “Cluster” mode Sharing registry center API of ShardingSphere and ElasticJob is considerred, API:
ShardingSphere : PersistRepository, ClusterPersistRepository, StandalonePersistRepository ElasticJob : CoordinatorRegistryCenter They are so different to use adapter design pattern.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Hello , this issue has not received a reply for several days. This issue is supposed to be closed.
yes, i can fix it !
---- Replied Message ---- | From | Liang @.> | | Date | 06/23/2022 22:03 | | To | @.> | | Cc | @.@.> | | Subject | Re: [apache/shardingsphere] Why does Mgr mode only support cluster mode ?I want use it in memory mode ! (Issue #17791) |
@laynotes Do you wanna to fix it?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>