mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-06-18 03:40:25 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -23,7 +23,7 @@ public class LogicFace {
|
||||
// 成员变量区
|
||||
public int logicFaceType;
|
||||
public ITransport transport; // 与logicFace绑定的transport
|
||||
public LinkService linkService; // 与logicFace绑定的linkService
|
||||
public LinkService linkService=new LinkService(); // 与logicFace绑定的linkService
|
||||
public LogicFaceCounters logicFaceCounters=new LogicFaceCounters(); // logicFace 流量统计对象
|
||||
public long expireTime; // 超时时间 ms
|
||||
public boolean state; // true 为 up , false 为down
|
||||
|
||||
@@ -12,8 +12,10 @@ import util.ConcurrentHelper;
|
||||
import util.TimeHelper;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.PriorityBlockingQueue;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/*
|
||||
* @Author: Wang Feng
|
||||
@@ -25,8 +27,8 @@ import java.util.concurrent.locks.Lock;
|
||||
public class LogicFaceICN extends LogicFace {
|
||||
public Timer timer; // 定时器,在processEvent函数中就被设置成很大的值
|
||||
public long recentExpireTime; // 最近将要超时的时间戳
|
||||
public Map<String, PITEntry> mPit; // PIT表
|
||||
public Lock timeoutEventHeapLock; // 锁, mpit 、timeoutEventHeap、recentExpireTime
|
||||
public Map<String, PITEntry> mPit=new ConcurrentHashMap<>(); // PIT表
|
||||
public Lock timeoutEventHeapLock=new ReentrantLock(); // 锁, mpit 、timeoutEventHeap、recentExpireTime
|
||||
// 超时事件堆, 以超时时间排序的最小堆,初始化大小为1000
|
||||
public PriorityBlockingQueue<TimeoutEvent> timeoutEventHeap
|
||||
=new PriorityBlockingQueue<TimeoutEvent>(1000,new Comparator<TimeoutEvent>(){
|
||||
@@ -36,7 +38,7 @@ public class LogicFaceICN extends LogicFace {
|
||||
}
|
||||
});
|
||||
|
||||
public Map<String, OnInterestInterface> mFib;
|
||||
public Map<String, OnInterestInterface> mFib=new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* 通过最长匹配原则查找FIB表,找到合适的兴趣包处理函数
|
||||
|
||||
@@ -17,7 +17,7 @@ public class Transport {
|
||||
public String localUri;
|
||||
public String remoteUri;
|
||||
|
||||
public LinkService linkService;
|
||||
public LinkService linkService=new LinkService();
|
||||
// TODO 虽然第一个版本可能用不到linkService分包与合包功能,
|
||||
// 但以后可能需要客户端也能直接发出用以太网封装的MIN网络包,所以还是留着linkService
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ package util;
|
||||
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
|
||||
*/
|
||||
public class TimeHelper {
|
||||
// TODO: 后面需要实现这个函数。
|
||||
public static long getTimestampMS(){
|
||||
return 10000;
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user