CobarInternalRouter is the default router that will be used in cobar client, but it will not be the only one.
if it can't meet the needs, we can provide other {@link ICobarRouter} like aone that use rule engines.
for now, CobarInternalRouter will hold 4 set of routing rules:
- sqlActionShardingRules
-
- sqlActionRules
-
- namespaceShardingRules
-
- namespaceRules
-
rules start with "sqlAction" are rules that will exactly match against the sql-map action id in the routing fact, while rules start with "namesapce" just match against the "namespace" part in the sql action id; we will match these rules in sequence against the routing fact, each later rule will be used as fall-back rule if former match fails.
To enhance the rule matching performance, we add a LRU cache, you can decide whether to use this cache by set the {@link #enableCache} property's value totrue or false.
@author fujohnwang
@since 1.0