-
Notifications
You must be signed in to change notification settings - Fork 0
oven-yang/cache
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
/*
*@ovenyang
*
*/
1.程序通过读取输入文件来确定各个节点的属性,拥有的数据,要做的动作等等.
不同节点有不同的定义文件,他们均保存在./source/node-define目录下.
该目录下有一nodes文件,记录所有节点名,文件格式如下:
node1_name
node2_name
每行除行尾换行外,不得出现任何空白符,字符串作为节点名字。这些节点名字
对应该目录下的一个文件名与名字相同的文件,这些文件表示节点的属性。
注意:该目录下不应该出现其他文件。
输入文件格式:三个定义块的顺序不允许修改,operation下的数字表示发出请求的时间,必须保证从上到下是升序的
[property]
interface_quantity 7 //property_name property_value
fib_capacity 10000
pit_capacity 10000
cs_capacity 10000
pref_capacity 10000
popu_capacity 10000
capacity 10000000
[data]
file/a 123 //content_name content_size
file/b 4534
media/a 800
media/b 98
audio/a 38
audio/b 442
dand/dfsfkjds 809
ghjgfsdjkf/fdsafhks 1937
[operation]
1 file/a //time content_name
3 media/a
2.程序通过文件来定义各个节点间的连接,文件为./source/link
文件格式如下:
node1 node2
上面的连接视为双向连接,不允许定义单向连接
节点必须存在
一条连接不能定义两次
node1 node2
node1 node3
3.每个节点有一个日志文件,在log目录下,文件名与节点名相同。日志每行即为一个动作,格式有三种,
依据每行开始的关键字区分,分别为store replace get.
store content_name size time
表示在time时间节点缓存了content_name,其大小为size.且没有产生替换
replace replaced_data_size content_name size time
表示在time时间节点缓存了content_name,其大小为size.并删除了大小的replaced_data_size的内容.
get content_name size from_cache hop time
表示在time时间节点对名为content_name的内容的请求得到应答,其大小为size.
from_cache有两个值,为cache时表示该应答是由缓存产生的,为disk时表示该应答是由某个节点本身内容产生的.
hop表示由产生应答的节点到当前节点经过的跳数.(相邻节点间跳数为1)About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published