private void initNodeToLabels() { if (this.nodeToLabels != null) { return; } GetNodesToLabelsResponseProtoOrBuilder p = viaProto ? proto : builder; List<NodeIdToLabelsInfoProto> list = p.getNodeToLabelsList(); this.nodeToLabels = new HashMap<NodeId, Set<NodeLabel>>(); for (NodeIdToLabelsInfoProto c : list) { Set<NodeLabel> labels = new HashSet<NodeLabel>(); for (NodeLabelProto l : c.getNodeLabelsList()) { labels.add(new NodeLabelPBImpl(l)); } this.nodeToLabels.put(new NodeIdPBImpl(c.getNodeId()), labels); } }
private void initNodeToLabels() { if (this.nodeToLabels != null) { return; } GetNodesToLabelsResponseProtoOrBuilder p = viaProto ? proto : builder; List<NodeIdToLabelsProto> list = p.getNodeToLabelsList(); this.nodeToLabels = new HashMap<NodeId, Set<String>>(); for (NodeIdToLabelsProto c : list) { this.nodeToLabels.put(new NodeIdPBImpl(c.getNodeId()), Sets.newHashSet(c.getNodeLabelsList())); } }