public boolean add(TcpDiscoveryNode node){
  assert node != null;
  assert node.internalOrder() > 0;
  rwLock.writeLock().lock();
  try {
    if (nodesMap.containsKey(node.id()))     return false;
    long maxInternalOrder0=maxInternalOrder();
    assert node.internalOrder() > maxInternalOrder0 : "Adding node to the middle of the ring " + "[ring=" + this + ", node="+ node+ ']';
    nodesMap.put(node.id(),node);
    nodes=new TreeSet<>(nodes);
    node.lastUpdateTime(U.currentTimeMillis());
    nodes.add(node);
    nodeOrder=node.internalOrder();
    maxInternalOrder=node.internalOrder();
    initializeMinimumVersion();
  }
  finally {
    rwLock.writeLock().unlock();
  }
  return true;
}

public boolean add ( TcpDiscoveryNode node ) { assert node != null ; assert node . internalOrder ( ) > 0 ; rwLock . writeLock ( ) . lock ( ) ; try { if ( nodesMap . containsKey ( node . id ( ) ) ) return false ; long maxInternalOrder0 = maxInternalOrder ( ) ; assert node . internalOrder ( ) > maxInternalOrder0 : "Adding node to the middle of the ring " + "[ring=" + this + ", node=" + node + ']' ; nodesMap . put ( node . id ( ) , node ) ; nodes = new TreeSet < > ( nodes ) ; node . lastUpdateTime ( U . currentTimeMillis ( ) ) ; nodes . add ( node ) ; nodeOrder = node . internalOrder ( ) ; maxInternalOrder = node . internalOrder ( ) ; initializeMinimumVersion ( ) ; } finally { rwLock . writeLock ( ) . unlock ( ) ; } return true ; }
adds node to topology , also initializes node last update time with current system time .
