# HG changeset patch # User Nobuyasu Oshiro # Date 1391134772 -32400 # Node ID 7b595f4b341e24a101387beb6df851e42071dfcc # Parent 6553b7a3717c7681f485de29887e924d9c79a3f5 modified chapter3.txt diff -r 6553b7a3717c -r 7b595f4b341e paper/chapter3.tex --- a/paper/chapter3.tex Fri Jan 31 09:31:57 2014 +0900 +++ b/paper/chapter3.tex Fri Jan 31 11:19:32 2014 +0900 @@ -252,65 +252,16 @@ MessagePackはListを扱うこともできるため, TreeOperationLogで継承されていたIterableの挙動もListを使うことで 実装を行うことができた. - -このInterfaceをimplementsしつつシリアライズを行えるクラスとしてNetworkTreeOperationLogを実装した. -NetworkTreeOperationLogでは次のフィールドを保持する(\ref{src:nettreeoplog}). -\begin{lstlisting}[frame=lrbt,label=src:nettreeoplog,caption=NetworkTreeOperationLogの実装,numbers=left] -@Message -public class NetworkTreeOperationLog implements TreeOperationLog -{ - public LinkedList list; - public int size; - String uuid; - String treeName; - long timestamp; - : // 実装が続いていく -\end{lstlisting} - - - +\subsection{ログに対する情報の追加} +TreeOperationLogをシリアライズ可能な形にした後, 問題が発生した. +それは, TreeOperationLog事態は木の名前を保持していないというものである. +そのため, TreeOperationLogだけを受け取っても, そのログがどの木に対して行われるのか +わからなかった. +そこで, TreeOperationLogの情報だけでなく, 木の名前とUUID, それとtimestampの情報も付与 +してシリアライズが可能なNetworkTreeOperationLogの実装を行った. -TreeOperationLogの仕様はInterfaceにより定義される. -\begin{lstlisting}[frame=lrbt,label=src:treeoperationlog,caption=TreeOperationLogの仕様,numbers=left] -public interface TreeOperationLog extends Iterable -{ - public TreeOperationLog add(NodePath _p,NodeOperation _op); - public TreeOperationLog append(TreeOperationLog _log); - public int length(); -} -\end{lstlisting} -\verb|Iterable|を継承しているクラスがTreeOperationLogとなる. -次にTreeOperationの仕様と, NodeOperation, NodePath の仕様について以下に示す -\begin{lstlisting}[frame=lrbt,label=src:treeop,caption=TreeOperationの仕様,numbers=left] -public interface TreeOperation -{ - public NodePath getNodePath(); - public NodeOperation getNodeOperation(); -} -\end{lstlisting} - -\begin{lstlisting}[frame=lrbt,label=src:nodeop,caption=NodeOperationの仕様,numbers=left] -public interface NodeOperation -{ - public Command getCommand(); - public > Either invoke(T _target); - - public int getPosition(); - public String getKey(); - public ByteBuffer getValue(); -} -\end{lstlisting} - -\begin{lstlisting}[frame=lrbt,label=src:nodepath,caption=Nodepathの仕様,numbers=left] -public interface NodePath extends Iterable -{ - public NodePath add(int _pos); - public Pair pop(); - public int size(); -} -\end{lstlisting} - - +\subsection{NetworkTreeOperationLogの実装} +NetworkTreeOperationLogの実装の一部を以下に示す. diff -r 6553b7a3717c -r 7b595f4b341e paper/figures/distributed_read_bench.pdf Binary file paper/figures/distributed_read_bench.pdf has changed diff -r 6553b7a3717c -r 7b595f4b341e paper/figures/distributed_write_bench.pdf Binary file paper/figures/distributed_write_bench.pdf has changed diff -r 6553b7a3717c -r 7b595f4b341e paper/gnuplot/makegraph_distributed_read.sh --- a/paper/gnuplot/makegraph_distributed_read.sh Fri Jan 31 09:31:57 2014 +0900 +++ b/paper/gnuplot/makegraph_distributed_read.sh Fri Jan 31 11:19:32 2014 +0900 @@ -6,5 +6,5 @@ set xrange[8:32] set xlabel 'number of nodes and clients' set ylabel 'time(sec)' -plot 'read_jungle_errorbar.dat' using 1:2:3 title 'Jungle' lt rgb "blue" with errorbars, 'distributed_read_cassandra_quorum.dat' title "Cassandra Consistency Level Quorum" lt rgb "red" with linespoints, 'distributed_read_cassandra_one.dat' title "Cassandra Consistency Level ONE" lt rgb "dark-red" with linespoints +plot 'read_jungle_errorbar.dat' using 1:2:3 title 'Jungle' lt rgb "blue" with errorbars, 'read_cassandra_quorum_errorbar.dat' using 1:2:3 title "Cassandra Consistency Level Quorum" lt rgb "red" with errorbars EOF diff -r 6553b7a3717c -r 7b595f4b341e paper/gnuplot/makegraph_distributed_write.sh --- a/paper/gnuplot/makegraph_distributed_write.sh Fri Jan 31 09:31:57 2014 +0900 +++ b/paper/gnuplot/makegraph_distributed_write.sh Fri Jan 31 11:19:32 2014 +0900 @@ -6,5 +6,5 @@ set xrange[8:32] set xlabel 'number of nodes' set ylabel 'time(sec)' -plot 'write_jungle_errorbar.dat' using 1:2:3 title 'Jungle' lt rgb "blue" with errorbars, 'distributed_write_cassandra_quorum.dat' title "Cassandra Consistency Level Quorum" lt rgb "red" with linespoints,'distributed_write_cassandra_one.dat' title "Cassandra Consistency Level ONE" lt rgb "dark-red" with linespoints +plot 'write_jungle_errorbar.dat' using 1:2:3 title 'Jungle' lt rgb "blue" with errorbars, 'write_cassandra_quorum_errorbar.dat' using 1:2:3 title "Cassandra Consistency Level Quorum" lt rgb "red" with errorbars EOF diff -r 6553b7a3717c -r 7b595f4b341e paper/master_paper.pdf Binary file paper/master_paper.pdf has changed