def METHOD_NAME(self):
    data = {}
    for peer in self.new_peer_l:
        key = "NEIGH_STATE_TABLE|%s" % peer
        if peer in self.peer_l:
            # only update the entry if state changed
            if self.peer_state[peer] != self.new_peer_state[peer][0]:
                # state changed. Update state DB for this entry
                state = self.new_peer_state[peer][0]
                peerType = "i-BGP" if self.new_peer_state[peer][1] == self.new_peer_state[peer][2] else "e-BGP"
                data[key] = {'state':state, 'peerType':peerType}
                self.peer_state[peer] = state
            # remove this neighbor from old set since it is accounted for
            self.peer_l.remove(peer)
        else:
            # New neighbor found case. Add to dictionary and state DB
            state = self.new_peer_state[peer][0]
            peerType = "i-BGP" if self.new_peer_state[peer][1] == self.new_peer_state[peer][2] else "e-BGP"
            data[key] = {'state':state, 'peerType':peerType}
            self.peer_state[peer] = state
        if len(data) > PIPE_BATCH_MAX_COUNT:
            self.flush_pipe(data)
    # Check for stale state entries to be cleaned up
    for peer in self.peer_l:
        # remove this from the stateDB and the current neighbor state entry
        del_key = "NEIGH_STATE_TABLE|%s" % peer
        data[del_key] = None
        if peer in self.peer_state:
            del self.peer_state[peer]
        if len(data) > PIPE_BATCH_MAX_COUNT:
            self.flush_pipe(data)
    # If anything in the pipeline not yet flushed, flush them now
    if len(data) > 0:
        self.flush_pipe(data)
    # Save the new set
    self.peer_l = self.new_peer_l.copy()