14
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 title: GearsOSの分散ファイルシステムの設計
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 author: Takahiro Ikki, Shinji Kono
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 profile: 琉球大学
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 lang: Japanese
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 code-engine: coderay
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 ## GearsOSとその現状
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 - 信頼性の保証と拡張性の高さを目指したOSプロジェクト
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 - 軽量継続を用いた言語、CbC(Continuation based C)により記述される。
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 - ノーマルレベルとメタレベルを分離して記述する
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 - 現状では言語フレームワークとしてのみ機能する
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 - OSとして動作するには多くの機能の開発が必要
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 - その中の一つにファイルシステムが挙げられる
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 ## 従来の物より発展した分散ファイルシステムの設計
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 - データベース的なレコード操作によるアクセス
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 - ファイルに対する全ての操作がTransactionとなる
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 - 既存ではアプリケーションが担当する機能を取り込む
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 - バックアップの管理
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 - ファイルの型の認識
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 - 自律分散を目指した分散ファイルシステム
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 - 特定のサーバーを中枢にしなくても良い
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 - 分散フレームワークChristieの仕組みにより実現する
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 ## CbC (Continuation based C)
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 - C言語の拡張言語である
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 - 関数に代わる軽量継続をメインに記述する
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 - Gearというプログラム概念
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 - CodeGear
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 - 従来のThreadにあたる
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 - DataGear
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 - 従来の変数データにあたる
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 - DataGearを受け取り処理を行う(InputDataGear)
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 - 処理の結果をDataGearに書き出す(OutputDataGear)
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 <div style="text-align: center;">
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 <img src="images/cgdg.pdf" alt="CodeGearとDataGearの関係" width="800">
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 </div>
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 ## CbCのサンプルプログラム
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 ```
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 __code CG2(int num3){
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 printf("num = %d\n", num3);
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 exit(0);
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 }
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 __code CG1(int num, int num1){
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 int num2 = num + num1;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 goto CG2(num2);
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 }
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 int main(){
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 int a = 2;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 int b = 3;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 goto CG1(a, b);
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 }
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 ```
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 ## メタレベルのGear
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 - CodeGearとDataGearにはメタレベルのものが存在する
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 - それぞれstubCodeGearとstubDataGearと呼ぶ
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 - ユーザーが記述する上では普段は意識しない
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 ## テスト用テキストエディタ
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 ```
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 public class MyDocumentListener implements DocumentListener {
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 @Override
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 public void insertUpdate(DocumentEvent e) {
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 Document doc = e.getDocument();
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 loc = e.getOffset();
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 System.out.println(loc);
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 }
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 @Override
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 public void removeUpdate(DocumentEvent e) {
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 Document doc = e.getDocument();
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 sendLoc = e.getOffset();
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 System.out.println("delete " + sendLoc);
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 }
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 @Override
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 public void changedUpdate(DocumentEvent e) {
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 }
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 }
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 ```
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 ## 編集位置の相違
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 - 同期編集のセッションでは命令コマンドの送信のすれ違いにより、ノードごとのファイル状態が異なってしまうことがある。
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 - EditorAとEditorBはそれぞれの命令を自身のエディタバッファに施してから命令を送信するため、お互いバッファ状態が異なる状態で受け取った命令を実行してしまう。
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 <div style="text-align: center;">
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 <img src="images/difference_offset.pdf" alt="MetaGear" width="800">
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 </div>
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 <!--
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 - RocalDGMを立ち上げるにはDataSegmentクラスが提供する、connectメソッドを用い、接続したいポートのipアドレスとport番号、そして任意のManager名を指定することで立ち上げる。
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 -->
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 ```Code
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 digraph test {
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 node0 -> node1 [label="right"]
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 node1 -> node2 [label="right"]
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 node2 -> node0 [label="right"]
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 }
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 ```
|