You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/10 06:41:05 UTC

[GitHub] [shardingsphere] laynotes opened a new issue, #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

laynotes opened a new issue, #17791:
URL: https://github.com/apache/shardingsphere/issues/17791

   // 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zjcnb commented on issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by GitBox <gi...@apache.org>.
zjcnb commented on issue #17791:
URL: https://github.com/apache/shardingsphere/issues/17791#issuecomment-1131019286

   > > @laynotes Hi, Because `db-discovery` need to heartbeat detection with `Elastic-Job`.
   > 
   > I know , but Will you consider supporting single machine Mgr in the later stage ?
   
   This not sure yet.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #17791:
URL: https://github.com/apache/shardingsphere/issues/17791#issuecomment-1164448914

   @laynotes Do you wanna to fix it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zjcnb commented on issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by GitBox <gi...@apache.org>.
zjcnb commented on issue #17791:
URL: https://github.com/apache/shardingsphere/issues/17791#issuecomment-1131007607

   @laynotes Hi, Because `db-discovery` need to heartbeat detection with `Elastic-Job`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] laynotes commented on issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by GitBox <gi...@apache.org>.
laynotes commented on issue #17791:
URL: https://github.com/apache/shardingsphere/issues/17791#issuecomment-1164457680

   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: ***@***.***>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #17791:
URL: https://github.com/apache/shardingsphere/issues/17791#issuecomment-1407559250

   This issue has been inactive for a long time, so I'm closing it now.
   If this problem persists, please reopen it or submit a new one.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] commented on issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #17791:
URL: https://github.com/apache/shardingsphere/issues/17791#issuecomment-1272349773

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] laynotes commented on issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by GitBox <gi...@apache.org>.
laynotes commented on issue #17791:
URL: https://github.com/apache/shardingsphere/issues/17791#issuecomment-1131015391

   > @laynotes Hi, Because `db-discovery` need to heartbeat detection with `Elastic-Job`.
   
   I know , but Will you consider supporting single machine Mgr in the later stage ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] laynotes commented on issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by GitBox <gi...@apache.org>.
laynotes commented on issue #17791:
URL: https://github.com/apache/shardingsphere/issues/17791#issuecomment-1131024444

   > > > @laynotes Hi, Because `db-discovery` need to heartbeat detection with `Elastic-Job`.
   > > 
   > > 
   > > I know , but Will you consider supporting single machine Mgr in the later stage ?
   > 
   > This not sure yet.
   
   I looked at the difference between the heartbeat and the stand-alone one. It should be fast. I hope I can support it. Although I have realized the function of Mgr myself, it is not as complete as our scene


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] closed issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #17791: Why does Mgr mode only support cluster mode ?I want  use it in memory mode !
URL: https://github.com/apache/shardingsphere/issues/17791


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang closed issue #17791: Why does Mgr mode only support cluster mode ?I want use it in memory mode !

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #17791: Why does Mgr mode only support cluster mode ?I want  use it in memory mode !
URL: https://github.com/apache/shardingsphere/issues/17791


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org