use of io.crate.metadata.Routing in project crate by crate.
the class RoutingBuilder method allocateRouting.
Routing allocateRouting(TableInfo tableInfo, WhereClause where, RoutingProvider.ShardSelection shardSelection, SessionContext sessionContext) {
Routing routing = tableInfo.getRouting(clusterState, routingProvider, where, shardSelection, sessionContext);
Map<RelationName, List<Routing>> routingListByTable = routingListByTableStack.peekLast();
if (routingListByTable == null) {
return routing;
}
List<Routing> existingRoutings = routingListByTable.get(tableInfo.ident());
if (existingRoutings == null) {
existingRoutings = new ArrayList<>();
routingListByTable.put(tableInfo.ident(), existingRoutings);
}
existingRoutings.add(routing);
return routing;
}
Aggregations