private void saveNewAssignment(LocalAssignment assignment) { synchronized (staticState.localState) { Map<Integer, LocalAssignment> assignments = staticState.localState.getLocalAssignmentsMap(); if (assignments == null) { assignments = new HashMap<>(); } if (assignment == null) { assignments.remove(staticState.port); } else { assignments.put(staticState.port, assignment); } staticState.localState.setLocalAssignmentsMap(assignments); } Map<Long, LocalAssignment> update = null; Map<Long, LocalAssignment> orig = null; do { Long lport = new Long(staticState.port); orig = cachedCurrentAssignments.get(); update = new HashMap<>(orig); if (assignment == null) { update.remove(lport); } else { update.put(lport, assignment); } } while (!cachedCurrentAssignments.compareAndSet(orig, update)); }
LocalAssignment newAssignment = null; Map<Integer, LocalAssignment> assignments = localState.getLocalAssignmentsMap(); if (assignments != null) { currentAssignment = assignments.get(port);
private void saveNewAssignment(LocalAssignment assignment) { synchronized(staticState.localState) { Map<Integer, LocalAssignment> assignments = staticState.localState.getLocalAssignmentsMap(); if (assignments == null) { assignments = new HashMap<>(); } if (assignment == null) { assignments.remove(staticState.port); } else { assignments.put(staticState.port, assignment); } staticState.localState.setLocalAssignmentsMap(assignments); } Map<Long, LocalAssignment> update = null; Map<Long, LocalAssignment> orig = null; do { Long lport = new Long(staticState.port); orig = cachedCurrentAssignments.get(); update = new HashMap<>(orig); if (assignment == null) { update.remove(lport); } else { update.put(lport, assignment); } } while (!cachedCurrentAssignments.compareAndSet(orig, update)); }
Map<Integer, LocalAssignment> assignments = localState.getLocalAssignmentsMap(); LocalAssignment currentAssignment = null; if (assignments != null) {
Map<Integer, LocalAssignment> portToAssignments = localState.getLocalAssignmentsMap(); if (portToAssignments != null) { Map<String, LocalAssignment> assignments = new HashMap<>(); for (LocalAssignment la : localState.getLocalAssignmentsMap().values()) { assignments.put(la.get_topology_id(), la);