Mercurial > hg > Papers > 2014 > nobuyasu-master
annotate paper/chapter3.tex @ 18:fc14b1876141
Modified description of topology manager
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 22 Jan 2014 18:35:23 +0900 |
parents | dfa2fd4658b2 |
children | 90a916194e59 |
rev | line source |
---|---|
4
d42d2acf5d1d
Added some tex files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 \chapter{Jungleの分散実装} |
10
02c7fc1cda10
Writed description of TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
4
diff
changeset
|
2 \section{TreeOperationLogを用いての分散データベースの実装} |
12 | 3 Jungle でデータ扱うと TreeOperationLog として残ることは述べた. |
10
02c7fc1cda10
Writed description of TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
4
diff
changeset
|
4 この TreeOperationLog を他のサーバへと送り, Jungle の編集を行って |
02c7fc1cda10
Writed description of TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
4
diff
changeset
|
5 貰うことでデータの分散を行うことができる. |
12 | 6 ここで問題になることはネットワークトポロジーの形成方法であった. |
7 | |
8 Jungle で使用するネットワークトポロジーはツリー型を考えている. | |
9 しかし, リング型といった他のネットワークトポロジーによる実装に関しても試す余地はある. | |
10 自由にネットワークトポロジーの形成を行うことができる必要があった. | |
11 | |
12 そこで当研究室で開発を行っている並列分散フレームワークである Alice を使用することにした. | |
13 Alice により提供されるネットワークトポロジー形成を用いて TreeOperationLog を各サーバノードへ | |
14 配ることで並列分散フレームワークの実装を行う. | |
11 | 15 |
12 | 16 % トポロジー形成の説明をする. 重要さなども。 |
17 % トポロジーの形成は容易ではない. | |
18 % Alice が必要な機能を提供してくれることを述べる | |
19 % Alice はトポロジー形成の機能を提供している | |
20 % トポロジー間でのデータの受け渡す機能も提供している | |
21 \begin{figure}[htpb] | |
22 \begin{minipage}{0.5\hsize} | |
23 \begin{center} | |
24 \includegraphics[scale=0.7]{figures/network_topology_ring.pdf} | |
25 \caption{リング型のNetwork Topology} | |
26 \label{fig:topology_ring} | |
27 \end{center} | |
28 \end{minipage} | |
29 \begin{minipage}{0.5\hsize} | |
30 \begin{center} | |
31 \includegraphics[scale=0.7]{figures/network_topology_tree.pdf} | |
32 \caption{ツリー型のNetwork Topology} | |
33 \label{fig:topology_tree} | |
34 \end{center} | |
35 \end{minipage} | |
36 \end{figure} | |
11 | 37 |
38 \section{並列分散フレームワークAlice} | |
15
7df3a9a13b22
Writed research
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
12
diff
changeset
|
39 Alice は当研究室で開発している並列分散フレームワークである. |
16
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
40 Alice はデータを DataSegment, コードを CodeSegment という単位で扱うプログラミングを提供している. |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
41 DataSegment として扱われるデータは |
15
7df3a9a13b22
Writed research
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
12
diff
changeset
|
42 |
10
02c7fc1cda10
Writed description of TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
4
diff
changeset
|
43 |
16
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
44 |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
45 % DataSegment, CodeSegment はなしにしたほうがいいかもしれない. Alice が論文の主題じゃないから |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
46 % それとこの2つの説明をするとしたら結構な量になる |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
47 |
12 | 48 \section{Aliceによるトポロジーの形成} |
16
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
49 Alice はサーバノードによるネットワークトポロジー形成の機能を持つ. |
18
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
50 トポロジーの内容は dot ファイルに記述される. |
16
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
51 以下に, サーバノードの数が5で, 2分木ツリー構造を形成する dot ファイル |
18
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
52 の例を\ref{src:alice_dot}に示す. |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
53 \begin{lstlisting}[frame=lrbt,label=src:alice_dot,caption=ネットワークトポロジー設定用 dot ファイル,numbers=left] |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
54 % cat tree5.dot |
16
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
55 digraph test { |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
56 node0 -> node1 [label="child1"] |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
57 node0 -> node2 [label="child2"] |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
58 node1 -> node0 [label="parent"] |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
59 node1 -> node3 [label="child1"] |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
60 node1 -> node4 [label="child2"] |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
61 node2 -> node0 [label="parent"] |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
62 node3 -> node1 [label="parent"] |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
63 node4 -> node1 [label="parent"] |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
64 } |
18
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
65 \end{lstlisting} |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
66 |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
67 Alice のトポロジーマネージャーを起動する場合に\ref{src:alice_dot}のファイルを引数として渡すことでトポロジー形成の |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
68 準備は整う(\ref{alice_ntm_run}). |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
69 \begin{lstlisting}[frame=lrbt,label=src:alice_ntm_run,caption=Alice によるネットワークトポロジーマネージャーの起動,numbers=left] |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
70 % java -cp Alice.jar alice.topology.manager.TopologyManager -p 10000 -conf /home/one/hg/nobuyasu/workspace/scripts/topology/tree5.dot |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
71 \end{lstlisting}h |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
72 |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
73 |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
74 |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
75 \begin{lstlisting}[frame=lrbt,label=src:create_jungle,caption=Alice を使用してのトポロジー形成,numbers=left] |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
76 public static void main( String[] args ) throws Exception |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
77 { |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
78 RemoteConfig conf = new RemoteConfig(args); |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
79 new TopologyNode(conf, new StartBBSCodeSegment(args, conf.bbsPort)); |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
80 } |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
81 \end{lstlisting} |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
82 |
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
83 |
16
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
84 |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
85 トポロジーマネージャーは dot ファイルを読み込み, 接続要求をしてくるサーバノード |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
86 に, どのサーバノードにつなげればよいかを教える. |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
87 サーバノードには番号が割り振られ, 接続要求が先にきたもの程若い番号が割り当てられる. |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
88 これにより形成されるトポロジーを図\ref{fig:tree_topology}に示す. |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
89 |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
90 \begin{figure}[htpb] |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
91 \begin{center} |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
92 \includegraphics[scale=0.70]{figures/tree_topology.pdf} |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
93 \caption{Alice によるネットワークトポロジー形成} |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
94 \label{fig:tree_topology} |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
95 \end{center} |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
96 \end{figure} |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
97 |
17
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
98 矢印に書かれている文字列は, 相手のデータにアクセスするキーを示す. |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
99 "child1", "child2", "parent" というキーを使うことで別のサーバノードにあるデータを取得することができる. |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
100 %子共となるノードは "parent" キーにより親の DSM (Remote DSM) にアクセスすることができる. |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
101 %また, 親も子供となるノードの DSM に対して "child1" や "child2" キーによりアクセスすることが可能となる. |
16
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
102 |
17
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
103 \subsection{トポロジー用 dot ファイル形成スクリプト} |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
104 Alice ではトポロジー形成用スクリプトが用意されている. |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
105 ノードの数と子供の数を指定するだけで dot ファイルの作成が行える. |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
106 また, ツリーに限らずリングやメッシュといったトポロジーの形成も行うことができる. |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
107 |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
108 % MessagePackの説明もここに簡単に入れたほうがいいかも. |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
109 |
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
110 \section{Aliceを用いての分散実装} |
18
fc14b1876141
Modified description of topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
111 Alice によりトポロジーの形成を行うことができれば, 後はデータの送受信を行う部分の実装になる. |
10
02c7fc1cda10
Writed description of TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
4
diff
changeset
|
112 |
11 | 113 |
4
d42d2acf5d1d
Added some tex files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 \section{ログのシリアライズ} |
17
dfa2fd4658b2
Modified abstract
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
115 |
16
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
116 ログのシリアライズについて述べる. |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
117 シリアライズとは, データをネットワーク上に流しても良い形式に変換することである. |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
118 |
e16dad3b80fc
Writed topology manager
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
119 |
4
d42d2acf5d1d
Added some tex files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 \section{Jungleの永続性の実装} |
10
02c7fc1cda10
Writed description of TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
4
diff
changeset
|
121 \subsection{マージの実装} |
02c7fc1cda10
Writed description of TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
4
diff
changeset
|
122 |