Search in sources :

Example 6 with ShardRouteParam

use of com.xiaomi.linden.thrift.common.ShardRouteParam in project linden by XiaoMi.

the class BQLCompilerAnalyzer method exitRoute_shard_clause.

@Override
public void exitRoute_shard_clause(BQLParser.Route_shard_clauseContext ctx) {
    List<ShardRouteParam> shardRouteParams = new ArrayList<>();
    for (BQLParser.Route_shard_valueContext route : ctx.route_shard_value()) {
        if (route.route_single_shard_value() != null) {
            ShardRouteParam shardRouteParam = (ShardRouteParam) valProperty.get(route.route_single_shard_value());
            if (shardRouteParam != null) {
                shardRouteParams.add(shardRouteParam);
            }
        } else if (route.route_multi_shard_values() != null) {
            List<ShardRouteParam> multiShardRouteParams = (List<ShardRouteParam>) valProperty.get(route.route_multi_shard_values());
            if (multiShardRouteParams != null) {
                shardRouteParams.addAll(multiShardRouteParams);
            }
        }
    }
    valProperty.put(ctx, shardRouteParams);
}
Also used : ShardRouteParam(com.xiaomi.linden.thrift.common.ShardRouteParam) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

ShardRouteParam (com.xiaomi.linden.thrift.common.ShardRouteParam)6 ArrayList (java.util.ArrayList)4 EarlyParam (com.xiaomi.linden.thrift.common.EarlyParam)3 List (java.util.List)3 Future (com.twitter.util.Future)2 FutureTransformer (com.twitter.util.FutureTransformer)2 LindenSearchRequest (com.xiaomi.linden.thrift.common.LindenSearchRequest)2 IOException (java.io.IOException)2 Map (java.util.Map)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 ExecutionException (java.util.concurrent.ExecutionException)2 LindenResult (com.xiaomi.linden.thrift.common.LindenResult)1 Response (com.xiaomi.linden.thrift.common.Response)1 SearchRouteParam (com.xiaomi.linden.thrift.common.SearchRouteParam)1 Test (org.junit.Test)1