Class ColumnMatchDataRouter
- All Implemented Interfaces:
IBuiltInExtensionPoint
,IExtensionPoint
,IDataRouter
The value can be a constant. In the data router the value of the new data is always represented by a string so all comparisons are done in the format that SymmetricDS transmits.
The column name used for the match is the upper case column name if the current value is being compared. The upper case column name prefixed by OLD_ can be used if the comparison is being done of the old data.
For example, if the column on a table is named STATUS you can specify that you want to router when STATUS=OK by specifying such for the router_expression. If you wanted to route when only the old value for STATUS=OK you would specify OLD_STATUS=OK.
The value can also be one of the following expressions:
- :NODE_ID
- :EXTERNAL_ID
- :NODE_GROUP_ID
- :REDIRECT_NODE
- :{column name}
REDIRECT_NODE is an instruction to match the specified column to a registrant_external_id on registration_redirect and return the associated registration_node_id in the list of node id to route to. For example, if the 'price' table was being routed to to a region 1 node based on the store_id, the store_id would be the external_id of a node in the registration_redirect table and the router_expression for trigger entry for the 'price' table would be 'store_id=:REDIRECT_NODE' and the router_type would be 'column'.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.jumpmind.symmetric.route.AbstractDataRouter
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ColumnMatchDataRouter.Expression>
getExpressions
(Router router, SimpleRouterContext context) Cache parsed expressions in the context to minimize the amount of parsing we have to do when we have lots of throughput.routeToNodes
(SimpleRouterContext routingContext, DataMetaData dataMetaData, Set<Node> nodes, boolean initialLoad, boolean initialLoadSelectUsed, TriggerRouter triggerRouter) runExpression
(ColumnMatchDataRouter.Expression e, String columnValue, String compareValue, Set<Node> nodes, Set<String> nodeIds, Node node) Methods inherited from class org.jumpmind.symmetric.route.AbstractDataRouter
addNodeId, completeBatch, contextCommitted, getDataAsObject, getDataAsString, getDataMap, getDataObjectMap, getNewDataAsObject, getNewDataAsString, getNullData, getOldDataAsObject, getOldDataAsString, getPkDataAsObject, getPkDataAsString, isConfigurable, isDmlOnly, testColumnNamesMatchValues, toExternalIds, toNodeIds
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jumpmind.symmetric.route.IDataRouter
completeBatch, contextCommitted, isConfigurable, isDmlOnly
-
Constructor Details
-
ColumnMatchDataRouter
public ColumnMatchDataRouter() -
ColumnMatchDataRouter
-
-
Method Details
-
routeToNodes
public Set<String> routeToNodes(SimpleRouterContext routingContext, DataMetaData dataMetaData, Set<Node> nodes, boolean initialLoad, boolean initialLoadSelectUsed, TriggerRouter triggerRouter) - Specified by:
routeToNodes
in interfaceIDataRouter
-
runExpression
-
getExpressions
protected List<ColumnMatchDataRouter.Expression> getExpressions(Router router, SimpleRouterContext context) Cache parsed expressions in the context to minimize the amount of parsing we have to do when we have lots of throughput. -
parse
public List<ColumnMatchDataRouter.Expression> parse(String routerExpression) throws SyntaxParsingException - Throws:
SyntaxParsingException
-
getRedirectMap
-