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 2020/05/09 07:16:09 UTC

[GitHub] [shardingsphere] xiaoxiong581 opened a new issue #5490: Custom algorithm implementation class init

xiaoxiong581 opened a new issue #5490:
URL: https://github.com/apache/shardingsphere/issues/5490


   ## Question
   
   **For English only**, other languages will not accept.
   
   Before asking a question, make sure you have:
   
   - Googled your question.
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.
   
   when i create a custom algorithm implementation class, I start sharding-proxy(4.1.0), but i found it init 2 times, why? and if it init 1 time by every process?
   
   ![image](https://user-images.githubusercontent.com/19368482/81466901-9fb3ab80-9207-11ea-983f-cccf7387f8ed.png)
   ![image](https://user-images.githubusercontent.com/19368482/81466909-ae01c780-9207-11ea-98e0-f953c56d6fb9.png)
   ![image](https://user-images.githubusercontent.com/19368482/81466922-ceca1d00-9207-11ea-9c04-757511471910.png)
   
   ### start log:
   Connected to the target VM, address: '127.0.0.1:51965', transport: 'socket'
   ComplexShardingStrategyAlgorithm init
   [INFO ] 15:06:18.487 [main] o.a.s.core.log.ConfigurationLogger - ShardingRuleConfiguration:
   bindingTables:
   - t_cluster,t_cluster_instance
   defaultDatabaseStrategy:
     none: ''
   defaultTableStrategy:
     none: ''
   tables:
     t_cluster:
       actualDataNodes: ds_${0..1}.t_cluster
       databaseStrategy:
         complex:
           algorithmClassName: org.apache.shardingsphere.shardingproxy.algorithm.complex.ComplexShardingStrategyAlgorithm
           shardingColumns: clusterId, clusterName
       logicTable: t_cluster
       tableStrategy:
         none: ''
     t_cluster_instance:
       actualDataNodes: ds_${0..1}.t_cluster_instance
       databaseStrategy:
         inline:
           algorithmExpression: ds_${clusterId.hashCode().abs() % 2}
           shardingColumn: clusterId
       logicTable: t_cluster_instance
       tableStrategy:
         none: ''
   
   [INFO ] 15:06:18.819 [main] o.a.s.core.log.ConfigurationLogger - Authentication:
   users:
     root:
       authorizedSchemas: ''
       password: migu@1234
     migu:
       authorizedSchemas: databasemanager
       password: migu@1234
   
   [INFO ] 15:06:18.820 [main] o.a.s.core.log.ConfigurationLogger - Properties:
   proxy.transaction.type: LOCAL
   sql.show: true
   
   ComplexShardingStrategyAlgorithm init
   [INFO ] 15:06:19.819 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
   [INFO ] 15:06:20.836 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
   [INFO ] 15:06:20.842 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Starting...
   [INFO ] 15:06:20.868 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Start completed.
   [INFO ] 15:06:21.340 [main] c.a.icatch.provider.imp.AssemblerImp - Loaded jar:file:/D:/Repository/com/atomikos/transactions/4.0.6/transactions-4.0.6.jar!/transactions-defaults.properties
   [INFO ] 15:06:21.344 [main] c.a.icatch.provider.imp.AssemblerImp - Loaded file:/D:/WorkSpace/Open/shardingsphere/sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-atomikos/sharding-transaction-xa-atomikos-manager/target/classes/transactions.properties
   [WARN ] 15:06:21.379 [main] c.a.icatch.provider.imp.AssemblerImp - Thanks for using Atomikos! Evaluate http://www.atomikos.com/Main/ExtremeTransactions for advanced features and professional support
   or register at http://www.atomikos.com/Main/RegisterYourDownload to disable this message and receive FREE tips & advice
   Thanks for using Atomikos! Evaluate http://www.atomikos.com/Main/ExtremeTransactions for advanced features and professional support
   or register at http://www.atomikos.com/Main/RegisterYourDownload to disable this message and receive FREE tips & advice
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.default_max_wait_time_on_shutdown = 9223372036854775807
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.allow_subtransactions = true
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.recovery_delay = 300000
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.automatic_resource_registration = false
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.oltp_max_retries = 5
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.client_demarcation = false
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.threaded_2pc = false
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.serial_jta_transactions = false
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.log_base_dir = ./logs
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.rmi_export_class = none
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.max_actives = 10000
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.checkpoint_interval = 50000
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.enable_logging = true
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.log_base_name = xa_tx
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.max_timeout = 300000
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.trust_client_tm = false
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: java.naming.factory.initial = com.sun.jndi.rmi.registry.RegistryContextFactory
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.tm_unique_name = 192.168.137.1.tm
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.forget_orphaned_log_entries_delay = 86400000
   [INFO ] 15:06:21.412 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.oltp_retry_interval = 10000
   [INFO ] 15:06:21.413 [main] c.a.icatch.provider.imp.AssemblerImp - USING: java.naming.provider.url = rmi://localhost:1099
   [INFO ] 15:06:21.413 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.force_shutdown_on_vm_exit = false
   [INFO ] 15:06:21.413 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.default_jta_timeout = 300000
   [INFO ] 15:06:21.419 [main] c.a.icatch.provider.imp.AssemblerImp - Using default (local) logging and recovery...
   [INFO ] 15:06:21.543 [main] c.a.d.xa.XATransactionalResource - resource-1-ds_0: refreshed XAResource
   [INFO ] 15:06:21.583 [main] c.a.d.xa.XATransactionalResource - resource-2-ds_1: refreshed XAResource
   [INFO ] 15:06:25.473 [main] ShardingSphere-metadata - Loading 2 logic tables' meta data.
   [INFO ] 15:06:29.461 [nioEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xf0b1bb31] REGISTERED
   [INFO ] 15:06:29.470 [nioEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xf0b1bb31] BIND: 0.0.0.0/0.0.0.0:3307
   [INFO ] 15:06:29.477 [nioEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xf0b1bb31, L:/0:0:0:0:0:0:0:0:3307] ACTIVE


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

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



[GitHub] [shardingsphere] xiaoxiong581 commented on issue #5490: Custom algorithm implementation class init

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


   > It's not a bug, it's a design.
   
   I want to confirm if every process will init custom algorithm implementation class one time or init two times total


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

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



[GitHub] [shardingsphere] kimmking commented on issue #5490: Custom algorithm implementation class init

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


   It's not a bug, it's a design.


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

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