Mercurial > hg > Papers > 2013 > nobuyasu-jssst
annotate Paper/jssst.tex @ 23:335cbec61221
added figure
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 18 Jul 2013 19:20:48 +0900 |
parents | 4cc89b4cf3dd |
children | 4e7979f6b571 |
rev | line source |
---|---|
0 | 1 % Sample file for the use of compsoft style file. |
2 % | |
3 \documentclass[T]{compsoft} | |
4 | |
5 % Preamble | |
6 % | |
7 % 「コンピュータソフトウェア」誌に掲載される論文の場合,次で | |
8 % 巻数,号数,開始ページ,終了ページを指定する. | |
9 %\volNoPp{16}{5}{78}{83} | |
10 | |
11 % ワークショップによる推薦論文の場合,ワークショップ名を指定する. | |
12 % \suisen{ワークショップ名} | |
13 | |
14 % 特集の場合,特集のタイトルを与える. | |
15 % \tokushu{特集のタイトル} | |
16 | |
17 % 大会論文の場合,\taikai で開催年を指定する.ここで指定した年から | |
18 % 大会の回数は計算される. | |
19 \taikai{2013} | |
20 | |
21 % ここに,使用するパッケージを列挙する. | |
22 \usepackage[dvipdfmx]{graphicx} | |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
23 \usepackage{listings,jlisting} |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
24 \usepackage{url} |
0 | 25 |
26 % ユーザが定義したマクロなどはここに置く.ただし学会誌のスタイルの | |
27 % 再定義は原則として避けること. | |
28 | |
29 \begin{document} | |
30 | |
31 % 論文のタイトル | |
2
fddcd3a2c40a
writed intruduction
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
1
diff
changeset
|
32 \title{Data Segment の分散データベースへの応用} |
0 | 33 |
34 % 著者 | |
35 % 和文論文の場合,姓と名の間には半角スペースを入れ, | |
36 % 複数の著者の間は全角スペースで区切る | |
37 % | |
20
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
38 \author{大城 信康 \and 杉本 優 \and 河野 真治 |
0 | 39 % |
40 % ここにタイトル英訳 (英文の場合は和訳) を書く. | |
41 % | |
42 \ejtitle{} | |
43 % | |
44 % ここに著者英文表記 (英文の場合は和文表記) および | |
45 % 所属 (和文および英文) を書く. | |
46 % 複数著者の所属はまとめてよい. | |
47 % | |
20
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
48 \shozoku{Nobuyasu OSHIRO,Yu SUGIMOTO, Shinij KONO }{琉球大学大学院理工学研究科情報工学専攻並列信頼研}% |
0 | 49 {Dept.Concurrency Reliance Laboratory, Information Engineering Course, Faculty of Engineering Graduate School of Engineering and Science, University of the Ryukyus} |
50 % | |
51 % 出典情報は \shutten とすれば出力される. | |
52 %\shutten | |
53 % | |
54 % 受付年月日,記事カテゴリなどは自動的に生成される. | |
55 %\uketsuke{1999}{8}{3} | |
56 % | |
57 % その他,脚注に入れるものがあれば,\note に記述する. | |
58 %\note{脚注に入れる内容} | |
59 } | |
60 | |
61 % | |
62 % 和文アブストラクト | |
63 \Jabstract{% | |
1 | 64 |
2
fddcd3a2c40a
writed intruduction
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
1
diff
changeset
|
65 Data Segment のJava上の実装としてAliceを作成してきた。 |
0 | 66 非破壊的木構造データベースjungleの分散実装を行う際にノード間での通信が必要になる。 |
67 Aliceを用いてデータベースノード間の通信を行う利点と欠点について考察する。 | |
68 } | |
69 | |
70 % | |
71 % 英文アブストラクト(大会論文には必要なし) | |
72 % \Eabstract{} | |
73 % | |
74 \maketitle | |
75 | |
76 \section{はじめに} | |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
77 当研究室では並列・分散プログラムに向いたプログラミングを目指し, データを Data Segment, タスクを Code Segment という単位で扱うプログラミングスタイルの |
1 | 78 提案を行なっている. |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
79 Data Segment, Code Segment によるプログラミングを提供する実装として, Java による分散ネットワークフレームワーク |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
80 Alice を開発している. |
2
fddcd3a2c40a
writed intruduction
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
1
diff
changeset
|
81 Alice はノード間のトポロジー生成を提供しており, Data Segment としてデータの送受信をノード間で行うことができる. |
fddcd3a2c40a
writed intruduction
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
1
diff
changeset
|
82 |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
83 また, 当研究室では非破壊的木構造を用いたデータベースである Jungle の開発も行なっている. |
2
fddcd3a2c40a
writed intruduction
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
1
diff
changeset
|
84 Jungle はデータを非破壊で保持することでスケーラビリティのあるデータベースを目指している. |
fddcd3a2c40a
writed intruduction
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
1
diff
changeset
|
85 Jungle はデータの編集を TreeOperationLog という単位で行う. |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
86 Alice を使いこの TreeOperationLog を各ノード間で送受信することでデータの分散を行うことができる. |
2
fddcd3a2c40a
writed intruduction
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
1
diff
changeset
|
87 |
fddcd3a2c40a
writed intruduction
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
1
diff
changeset
|
88 本研究では, Alice と Jungle を用いて分散データベースの実装を行う. |
fddcd3a2c40a
writed intruduction
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
1
diff
changeset
|
89 さらに, 例題のアプリケーションとして掲示板を作成し, 評価を行う. |
0 | 90 |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
91 \section{分散ネットワークフレームワーク Alice} |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
92 Alice は当研究室で開発している分散管理フレームワークである. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
93 Data Segment とCode Segment による並列・分散プログラミングを提供する. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
94 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
95 まず, Data Segment と Code Segment についての説明を行う. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
96 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
97 \subsection{Data Segment} |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
98 Data Segment は計算に必要なデータになる. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
99 Alice は Data Segment を文字列の Key で管理する. |
9
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
100 Key 毎にリストが用意され, put された順番で Data Segment は取り出され計算が行われる. |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
101 Data Segment は Data Segment Manager(以下DSM) により管理される. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
102 DSM はノード毎にキーを持つ. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
103 他のノードの DSM にアクセスする場合は Remote DSM 経由で行う. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
104 Alice による分散プログラミングはこの Remote DSM の機能を使用する. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
105 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
106 Data Segment Manager は API を提供しており, この API を通じて Data Segment のやりとりが行われる |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
107 具体的には以下の API が用意されている. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
108 \begin{itemize} |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
109 \item \verb+void put(String key, Value val)+ |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
110 \item \verb+void update(String key, Value val)+ |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
111 \item \verb+void peek(Receiver receiver, String key)+ |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
112 \item \verb+void take(Receiver receiver, String key)+ |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
113 \end{itemize} |
9
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
114 put は Data Segment をリストへと追加する API である. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
115 update はリストに入っている Data Segment を更新する API である. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
116 peek はリストに入っている Data Segment を取り出す API である. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
117 peek により取り出された Data Segement はリストより削除されない. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
118 take はリストに入っている Data Segment を取り出す API である. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
119 取り出した Data Segment はリストより削除される. |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
120 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
121 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
122 \subsection{Code Segment} |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
123 Code Segment は Data Segment を受け取り計算を行うコードのことを示す. |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
124 並列プログラミングにおけるタスクにあたる. |
23 | 125 Code Segment と Data Segment は対になっている. |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
126 Code Segment は計算に使う Data Segment のキーを登録して, そのキー |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
127 にあたる Data Segment が用意され次第処理が実行される. |
7 | 128 Code Segment が処理を開始するのに必要な Data Segment を Input Data Segment という. |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
129 |
9
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
130 Code Segment では Data Segment の生成を行い, put や update により新たにリストに登録することができる. |
7 | 131 Code Segment 内で作成し登録される Data Segment は Output Data Segment と呼ばれる. |
132 | |
133 Code Segment は Input Data Segment と Output Data Segment の API を提供する. | |
23 | 134 \begin{figure}[htpb] |
135 \begin{center} | |
136 \includegraphics[scale=0.50]{figures/dsandcs.pdf} | |
137 \caption{Data Segment と Code Segment} | |
138 \label{fig:dsnadcs} | |
139 \end{center} | |
140 \end{figure} | |
141 | |
4
f3a5eb2c9081
added graffle directory
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
3
diff
changeset
|
142 |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
143 |
7 | 144 \subsection{MessagePack} |
9
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
145 Alice における Data Segment のデータ表現には MessagePack を利用している. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
146 MessagePack はバイナリをベースにしたシリアライズライブラリーである. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
147 また, MessagePack のバイナリにシリアライズできる型のみで構成された Value オブジェクト |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
148 が用意されている. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
149 Java の基本的な型はシリアライズすることができる. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
150 |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
151 Value オブジェクトは自己記述なデータ形式になっている. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
152 独自のクラスでも @Message アノテーションを付けることで Value 型 |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
153 へと変換することができる. |
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
154 その時は MessagePack がシリアライズできる型のみをフィールドに入れなければならない. |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
155 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
156 |
9
6212a32c4196
writed MessagePack
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
7
diff
changeset
|
157 \section{非破壊的木構造を用いたデータベース Jungle} |
12
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
158 Jungle はスケーラビリティのある CMS の開発を目指して当研究室で開発されている非破壊的木構造データベースである. |
10
e4c13f70c552
start write chapter 3
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
9
diff
changeset
|
159 一般的なコンテンツマネジメントシステムではブログツールや Wiki・SNS が多く, これらの |
12
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
160 ウェブサイトの構造は大体が木構造であるため, データ構造として木構造を採用している. |
1 | 161 |
14
906c76445554
remove test file
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
13
diff
changeset
|
162 ここではまず破壊的木構造と, 非破壊的木構造の説明をし, Jungle におけるデータ編集の実装について述べる. |
10
e4c13f70c552
start write chapter 3
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
9
diff
changeset
|
163 |
e4c13f70c552
start write chapter 3
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
9
diff
changeset
|
164 \subsection{破壊的木構造} |
11
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
165 破壊的木構造の編集は, 木構造で保持しているデータを直接書き換えることで行う. |
13
f7ace466a7f0
wrote description for non destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
12
diff
changeset
|
166 図\ref{fig:destractive}は破壊的木構造の編集を表している. |
11
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
167 |
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
168 \begin{figure}[htpb] |
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
169 \begin{center} |
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
170 \includegraphics[scale=0.50]{figures/destructive_tree.pdf} |
12
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
171 \caption{破壊的木構造の編集} |
11
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
172 \label{fig:destractive} |
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
173 \end{center} |
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
174 \end{figure} |
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
175 |
12
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
176 破壊的木構造は, 編集を行う際に木のロックを掛ける必要がある. |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
177 データを受け取ろうと木を走査するスレッドは書き換えの終了を待つ必要があり, 閲覧者が |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
178 いる場合は木の走査が終わるまで書き換えをまたなければならない. |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
179 これではスケールしないと考えられる. |
11
522931416348
added destructive_tree.graffle
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
10
diff
changeset
|
180 |
12
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
181 \subsection{非破壊的木構造木構造} |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
182 非破壊的木構造は破壊的木構造とは違い一度作成したデータを破壊することはない. |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
183 非破壊的木構造においてデータの編集を行う場合は, root から編集のあったノードまでコピー |
15
ac82fd7e1ea1
added makegraph.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
14
diff
changeset
|
184 を行い新しく木構造を作成することで行う. |
12
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
185 編集が行われない部分は参照をもたせる. |
13
f7ace466a7f0
wrote description for non destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
12
diff
changeset
|
186 図\ref{fig:nondestractive}は非破壊的木構造の編集を表している. |
12
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
187 |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
188 \begin{figure}[htpb] |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
189 \begin{center} |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
190 \includegraphics[scale=0.50]{figures/non_destructive_tree.pdf} |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
191 \caption{非破壊的木構造の編集} |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
192 \label{fig:nondestractive} |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
193 \end{center} |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
194 \end{figure} |
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
195 |
13
f7ace466a7f0
wrote description for non destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
12
diff
changeset
|
196 非破壊的木構造により, 木構造を編集しながら走査することが可能となる. |
f7ace466a7f0
wrote description for non destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
12
diff
changeset
|
197 |
16
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
198 |
15
ac82fd7e1ea1
added makegraph.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
14
diff
changeset
|
199 \subsection{Jungle におけるデータ編集} |
16
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
200 木の編集は, 通常 Node を書き換えるため Node の API として提供されることが多いが, Jungle で |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
201 は JungleTreeEditor を利用して行う. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
202 JungleTree Editor には編集するためのいくつかのメソッドが用意されており, NodePath と |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
203 呼ばれるルートノードからノードまでのマスを指定することでノードが編集される. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
204 NodePath は, ルートノードからスタートし, ノードの子供の場所を次々に指定していくことで編集対象 |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
205 のノードの場所を表す(図\ref{fig:nodepath}). |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
206 |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
207 \begin{figure}[htpb] |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
208 \begin{center} |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
209 \includegraphics[scale=0.50]{figures/nodepath.pdf} |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
210 \caption{NodePath} |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
211 \label{fig:nodepath} |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
212 \end{center} |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
213 \end{figure} |
12
fcfd5857d435
wrote description for destructive tree
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
214 |
16
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
215 Tree 編集の API として次の4つが用意されている. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
216 \begin{itemize} |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
217 \item \verb+addNewChildAt(NodePath _path,int _pos)+ |
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
218 \item \verb+deleteChildAt(NodePath _path,int _pos)+ |
16
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
219 \item \verb+putAttribute(NodePath _path,+\\ |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
220 \verb+String _key,ByteBuffer _value)+ |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
221 \item \verb+deleteAttribute(NodePath _path,+\\ |
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
222 \verb+String _key)+ |
16
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
223 \end{itemize} |
10
e4c13f70c552
start write chapter 3
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
9
diff
changeset
|
224 |
16
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
225 \subsubsection{addNewChildAt} |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
226 NodePath で指定された Node に子供となる Node を追加するAPIである. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
227 pos で指定された番号に子供として追加を行う. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
228 |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
229 \subsubsection{deleteChildAt} |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
230 NodePath と pos により指定される Node を削除する API である. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
231 |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
232 \subsubsection{putAttribute} |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
233 Node に attribute を追加する API である. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
234 文字列をキーにして ByteBuffer によりデータを保持する. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
235 |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
236 \subsubsection{deleteAttribute} |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
237 NodePath により指定される Node の attribute を削除する API である. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
238 削除する attribute は文字列のキーで指定する. |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
239 |
f5028ec67c38
wrote description for editor api
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
15
diff
changeset
|
240 \subsection{TreeOperationLog} |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
241 上記の API を使用すると Editor 内部では NodeOperation として順次つまれていき, 最終 |
17
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
242 的に commit されることで編集が行われる. |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
243 複数の NodeOperation の集まりを TreeOperationLog といい, これが編集の単位となる. |
17
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
244 例えば, 後述する掲示板の実装では1つの書き込みに対して1つの Node を作成し, attribute を |
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
245 もたせている. |
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
246 その時のログは次のようになる. |
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
247 \begin{verbatim} |
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
248 [APPEND_CHILD:<-1>:pos:1] |
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
249 [PUT_ATTRIBUTE:<-1,1>:key:author,value:oshiro] |
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
250 [PUT_ATTRIBUTE:<-1,1>:key:mes,value:hello] |
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
251 [PUT_ATTRIBUTE:<-1,1>:key:key,value:hoge] |
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
252 [PUT_ATTRIBUTE:<-1,1>:key:timestamp,value:0] |
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
253 \end{verbatim} |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
254 大文字の英字は実行した API を表す. |
17
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
255 <>により囲まれている数値は NodePath を示す. |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
256 NodePath の後ろは posision や attribute の情報を表している. |
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
257 NodeOperation と NodePath の組み合わせを TreeOperation として扱い, それらいくつか集まりが TreeOperationLog となる. |
17
2132391fcb65
wrote TreeOperationLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
258 |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
259 \section{Alice を用いた Jungle の分散実装} |
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
260 Alice を用いた Jungle のデータ分散は, 上記の TreeOperationLog を Data Segment として扱うことで行える. |
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
261 そのために必要なことは以下となる. |
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
262 \begin{itemize} |
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
263 \item TreeOperationLog を MessagePack によりシリアライズ |
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
264 \item TreeOperationLog を扱う Data Segment の作成 |
19
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
265 %\item Data Segment として受け取った TreeOperationLog の Jungle への適応 |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
266 \end{itemize} |
10
e4c13f70c552
start write chapter 3
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
9
diff
changeset
|
267 |
e4c13f70c552
start write chapter 3
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
9
diff
changeset
|
268 |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
269 \subsection{TreeOperationLog の MessagePack によるシリアライズ} |
20
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
270 TreeOperationLog はそのまま MessagePack でシリアライズすることはできない. |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
271 TreeOperationLog は TreeOperation をフィールドに List として保持していた. |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
272 フィールドとして保持しているものは全て MessagePack でシリアライズできるものに |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
273 しなけれならない. |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
274 そこで, フィールドで保持しているもの Value 型に変換するための Container クラス |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
275 作成をそれぞれ行った. |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
276 ログに関連するクラス全てをシリアライズするクラスを行った後に, それら全てをまとめる |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
277 DefaultTreeOperationLogContainer クラスの作成を行った. |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
278 このクラスは TreeOperationLog を Value 型へと変換しフィールド変数で保持する. |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
279 実際に TreeOperationLog のシリアライズを行うソースを次に示す. |
0 | 280 |
21
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
281 \begin{lstlisting}[label=unconvert, caption=TreeOperationLog のシリアライズ] |
20
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
282 public void unconvert(Iterable |
21
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
283 <TreeOperation> _log) throws IOExceptio{ |
20
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
284 MessagePack msgpack = new MessagePack(); |
21
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
285 List<Value> list |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
286 = new LinkedList<Value>(); |
20
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
287 for(TreeOperation op : _log) { |
21
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
288 NodeOperation nOp |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
289 = op.getNodeOperation(); |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
290 NodePath nPath |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
291 = op.getNodePath(); |
20
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
292 DefaultTreeOperation treeOp |
21
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
293 = new DefaultTreeOperation(nPath, nOp); |
20
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
294 DefaultTreeOperationContainer c |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
295 = new DefaultTreeOperationContainer(); |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
296 c.unconvert(treeOp); |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
297 Value v = msgpack.unconvert(c); |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
298 list.add(v); |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
299 } |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
300 Value listValue |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
301 = msgpack.unconvert(list); |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
302 logValue = listValue; // field variable |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
303 } |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
304 \end{lstlisting} |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
305 |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
306 List で保持していた TreeOperation を List<Value> へと変換させている. |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
307 また, TreeOperationLog の保持だけでなく, 編集した木の名前やリビジョン番号, 変更を行ったノードの情報を |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
308 ノードの名前といった情報も保持するようにした. |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
309 DefaultTreeOperationLogContainer により, TreeOperationLog を Data Segment へと put することができる. |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
310 |
21
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
311 \subsection{ログを扱う Data Segment} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
312 Alice の各ノードは "log", "childLog" というキーでログを扱う(図\ref{fig:topology}). |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
313 |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
314 \begin{figure}[htpb] |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
315 \begin{center} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
316 \includegraphics[scale=0.50]{figures/alice_topology.pdf} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
317 \caption{形成されるトポロジーと Data Segment} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
318 \label{fig:topology} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
319 \end{center} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
320 \end{figure} |
19
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
321 |
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
322 "log" にはそのノードが行った木の編集のログが入る. |
22
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
323 また, 子供となるノードは "parent" というキーを使うことで親ノードの Data Segment Manager にアクセスすることができる. |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
324 子供となるノードは親の "log" を待ち反映する Code Segment (LogUpdateCodeSegment) を走らせており, ログが put されるとそのデータを受け取り |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
325 Code Segment の処理が行われる(図\ref{fig:putlog}). |
21
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
326 \begin{figure}[htpb] |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
327 \begin{center} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
328 \includegraphics[scale=0.50]{figures/putLog.pdf} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
329 \caption{} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
330 \label{fig:putlog} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
331 \end{center} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
332 \end{figure} |
9dcb40e74ab9
added some figres
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
333 |
19
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
334 "childLog" には子供となるノードが行った編集のログが入れられる. |
22
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
335 ノードは "childLog" の Data Segment にデータが入るの待っている Code Segment が常に走らせており, 子供が行った木の編集が |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
336 "childLog" に put されることで親へとデータの伝搬が行われる(図\ref{fig:putchildlog}). |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
337 \begin{figure}[htpb] |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
338 \begin{center} |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
339 \includegraphics[scale=0.50]{figures/putChildLog.pdf} |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
340 \caption{} |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
341 \label{fig:putchildlog} |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
342 \end{center} |
4cc89b4cf3dd
wrote discription for childLog
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
21
diff
changeset
|
343 \end{figure} |
20
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
344 |
04e41820d930
modified description for DefaultTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
345 \subsection{} |
19
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
346 |
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
347 |
23 | 348 |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
349 \subsection{} |
19
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
350 |
18
b3bce5bacc04
wrote DefatltTreeOperationLogContainer
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
17
diff
changeset
|
351 |
0 | 352 |
353 \section{その4} | |
354 | |
19
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
355 |
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
356 \section{Jungle の利点} |
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
357 |
0 | 358 \section{まとめ} |
359 | |
19
4afecc3d3331
added some figures
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
360 |
0 | 361 \nocite{fix200609} |
362 \bibliographystyle{junsrt} | |
363 \bibliography{reference} | |
364 \end{document} | |
3
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
365 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
366 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
367 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
368 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
369 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
370 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
371 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
372 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
373 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
374 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
375 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
376 |
a16f4ef93295
added sty files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
2
diff
changeset
|
377 |