Search in sources :

Example 1 with PKAndVersion

use of io.crate.planner.operators.PKAndVersion in project crate by crate.

the class PKLookupPhase method writeTo.

@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    distInfo.writeTo(out);
    Symbols.toStream(toCollect, out);
    out.writeVInt(idsByShardByNode.size());
    for (Map.Entry<String, Map<ShardId, List<PKAndVersion>>> byNodeEntry : idsByShardByNode.entrySet()) {
        Map<ShardId, List<PKAndVersion>> idsByShard = byNodeEntry.getValue();
        out.writeString(byNodeEntry.getKey());
        out.writeVInt(idsByShard.size());
        for (Map.Entry<ShardId, List<PKAndVersion>> shardEntry : idsByShard.entrySet()) {
            List<PKAndVersion> ids = shardEntry.getValue();
            shardEntry.getKey().writeTo(out);
            out.writeVInt(ids.size());
            for (PKAndVersion id : ids) {
                id.writeTo(out);
            }
        }
    }
    out.writeVInt(partitionedByColumns.size());
    for (ColumnIdent partitionedByColumn : partitionedByColumns) {
        partitionedByColumn.writeTo(out);
    }
}
Also used : ShardId(org.elasticsearch.index.shard.ShardId) ColumnIdent(io.crate.metadata.ColumnIdent) PKAndVersion(io.crate.planner.operators.PKAndVersion) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

ColumnIdent (io.crate.metadata.ColumnIdent)1 PKAndVersion (io.crate.planner.operators.PKAndVersion)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 ShardId (org.elasticsearch.index.shard.ShardId)1