路由表这里我做了简单处理
package vip.rory.dht.spider.entity;
import java.util.TreeSet;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author
* @date 2019年7月9日 上午11:05:02
*/
@Component
public class RoutingTable extends TreeSet<Node> {
private static final long serialVersionUID = -2136316213657671100L;
private static final Integer maxSize = 160;
//线程锁
private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
private final Lock rLock = rwl.readLock();
public final Lock wLock = rwl.writeLock();
@Autowired
private Node localNode;
public boolean add(Node nod