private void initLabelsToNodes() { if (this.labelsToNodes != null) { return; } GetLabelsToNodesResponseProtoOrBuilder p = viaProto ? proto : builder; List<LabelsToNodeIdsProto> list = p.getLabelsToNodesList(); this.labelsToNodes = new HashMap<String, Set<NodeId>>(); for (LabelsToNodeIdsProto c : list) { Set<NodeId> setNodes = new HashSet<NodeId>(); for(NodeIdProto n : c.getNodeIdList()) { NodeId node = new NodeIdPBImpl(n); setNodes.add(node); } if(!setNodes.isEmpty()) { this.labelsToNodes.put(c.getNodeLabels(), setNodes); } } }
private void initLabelsToNodes() { if (this.labelsToNodes != null) { return; } GetLabelsToNodesResponseProtoOrBuilder p = viaProto ? proto : builder; List<LabelsToNodeIdsProto> list = p.getLabelsToNodesList(); this.labelsToNodes = new HashMap<NodeLabel, Set<NodeId>>(); for (LabelsToNodeIdsProto c : list) { Set<NodeId> setNodes = new HashSet<NodeId>(); for(NodeIdProto n : c.getNodeIdList()) { NodeId node = new NodeIdPBImpl(n); setNodes.add(node); } if (!setNodes.isEmpty()) { this.labelsToNodes .put(new NodeLabelPBImpl(c.getNodeLabels()), setNodes); } } }
private void initLabelsToNodes() { if (this.labelsToNodes != null) { return; } GetLabelsToNodesResponseProtoOrBuilder p = viaProto ? proto : builder; List<LabelsToNodeIdsProto> list = p.getLabelsToNodesList(); this.labelsToNodes = new HashMap<String, Set<NodeId>>(); for (LabelsToNodeIdsProto c : list) { Set<NodeId> setNodes = new HashSet<NodeId>(); for(NodeIdProto n : c.getNodeIdList()) { NodeId node = new NodeIdPBImpl(n); setNodes.add(node); } if (!setNodes.isEmpty()) { this.labelsToNodes .put(c.getNodeLabels(), setNodes); } } }