Mercurial > hg > Members > tatsuki > bench > jungle-core
changeset 56:18c5cb49beca
mark
author | Shoshi TAMAKI |
---|---|
date | Fri, 08 Feb 2013 20:14:31 +0900 |
parents | 4ff16d970ffc |
children | b136a24f82aa |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultChangeListWriter.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultJournalWriter.java |
diffstat | 2 files changed, 45 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultChangeListWriter.java Fri Feb 08 19:36:16 2013 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultChangeListWriter.java Fri Feb 08 20:14:31 2013 +0900 @@ -2,6 +2,10 @@ import java.nio.ByteBuffer; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; + public class DefaultChangeListWriter implements ChangeListWriter { public DefaultChangeListWriter(ByteBuffer _buf) @@ -10,8 +14,17 @@ } @Override - public Result write(ChangeList _operations) + public synchronized Result write(ChangeList _operations) { + for(TreeOperation op : _operations){ + ByteBuffer treeOpBuf = serializeTreeOperation(op); + } + return null; + } + + private ByteBuffer serializeTreeOperation(TreeOperation op) + { + return null; } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultJournalWriter.java Fri Feb 08 20:14:31 2013 +0900 @@ -0,0 +1,31 @@ +package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; + +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; + +public class DefaultJournalWriter +{ + public DefaultJournalWriter(String _fileName) + { + + } + + public static Either<Error,DefaultJournalWriter> newInstance(String _fileName) + { + RandomAccessFile journal = null; + try{ + journal = new RandomAccessFile(_fileName,"rw"); + //FileChannel ch = journal.getChannel(); + long length = journal.length(); + }catch(FileNotFoundException _e){ + + }catch(IOException _e){ + + } + + return null; + } +}