public boolean equals(java.lang.Object other) { if (other instanceof Grouping) { return equals((Grouping)other); } else { return false; } }
private static Collection<PartitionNode> uniquedSubscriptions(Set<PartitionNode> subscriptions) { Map<String, PartitionNode> ret = new HashMap<>(); for (PartitionNode n : subscriptions) { PartitionNode curr = ret.get(n.streamId); if (curr != null && !curr.thriftGrouping.equals(n.thriftGrouping)) { throw new RuntimeException( "Multiple subscriptions to the same stream with different groupings. Should be impossible since that is explicitly " + "guarded against."); } ret.put(n.streamId, n); } return ret.values(); }
private static List<PartitionNode> extraPartitionInputs(Group g) { List<PartitionNode> ret = new ArrayList<>(); Set<PartitionNode> inputs = externalGroupInputs(g); Map<String, List<PartitionNode>> grouped = new HashMap<>(); for (PartitionNode n : inputs) { if (!grouped.containsKey(n.streamId)) { grouped.put(n.streamId, new ArrayList()); } grouped.get(n.streamId).add(n); } for (List<PartitionNode> group : grouped.values()) { PartitionNode anchor = group.get(0); for (int i = 1; i < group.size(); i++) { PartitionNode n = group.get(i); if (!n.thriftGrouping.equals(anchor.thriftGrouping)) { ret.add(n); } } } return ret; }
public boolean equals(Object other) { if (other instanceof Grouping) { return equals((Grouping)other); } else { return false; } }
private static Collection<PartitionNode> uniquedSubscriptions(Set<PartitionNode> subscriptions) { Map<String, PartitionNode> ret = new HashMap<>(); for(PartitionNode n: subscriptions) { PartitionNode curr = ret.get(n.streamId); if(curr!=null && !curr.thriftGrouping.equals(n.thriftGrouping)) { throw new RuntimeException("Multiple subscriptions to the same stream with different groupings. Should be impossible since that is explicitly guarded against."); } ret.put(n.streamId, n); } return ret.values(); }
private static List<PartitionNode> extraPartitionInputs(Group g) { List<PartitionNode> ret = new ArrayList<>(); Set<PartitionNode> inputs = externalGroupInputs(g); Map<String, List<PartitionNode>> grouped = new HashMap<>(); for(PartitionNode n: inputs) { if(!grouped.containsKey(n.streamId)) { grouped.put(n.streamId, new ArrayList()); } grouped.get(n.streamId).add(n); } for(List<PartitionNode> group: grouped.values()) { PartitionNode anchor = group.get(0); for(int i=1; i<group.size(); i++) { PartitionNode n = group.get(i); if(!n.thriftGrouping.equals(anchor.thriftGrouping)) { ret.add(n); } } } return ret; }