Mercurial > hg > Members > tatsuki > bench > jungle-core
changeset 33:9f8b91265c3e
added NullJournal
author | Shoshi TAMAKI |
---|---|
date | Wed, 23 Jan 2013 13:49:20 +0900 |
parents | dd7776c8b6d5 |
children | ab561ead04d2 |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultChangeListReader.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultJournal.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/NullJournal.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/operations/SetAttributeOperation.java |
diffstat | 4 files changed, 46 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultChangeListReader.java Thu Jan 17 00:44:05 2013 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultChangeListReader.java Wed Jan 23 13:49:20 2013 +0900 @@ -1,7 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent; import java.nio.ByteBuffer; -import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; // not thread safe @@ -27,6 +26,7 @@ @Override public ChangeList read() { + return null; } }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultJournal.java Thu Jan 17 00:44:05 2013 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/DefaultJournal.java Wed Jan 23 13:49:20 2013 +0900 @@ -81,10 +81,9 @@ public static final int READ_BUFFER_SIZE = 1000000; // 1MB public static final int WRITE_BUFFER_SIZE = 1000000; // 1MB - private DefaultJournal() { - + writer = null; } public static Either<Error,DefaultJournal> newInstance(String _fileName)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/persistent/NullJournal.java Wed Jan 23 13:49:20 2013 +0900 @@ -0,0 +1,43 @@ +package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent; + +public class NullJournal implements Journal +{ + private static final NullChangeListWriter NULL_WRITER = new NullChangeListWriter(); + private static final NullChangeListReader NULL_READER = new NullChangeListReader(); + + @Override + public ChangeListReader getReader() + { + return NULL_READER; + } + + @Override + public ChangeListWriter getWriter() + { + return NULL_WRITER; + } + + private static class NullChangeListWriter implements ChangeListWriter + { + @Override + public Result write() + { + return Result.SUCCESS; + } + } + + private static class NullChangeListReader implements ChangeListReader + { + @Override + public ChangeListReader newReader() + { + return this; + } + + @Override + public ChangeList read() + { + return null; + } + } +}
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/operations/SetAttributeOperation.java Thu Jan 17 00:44:05 2013 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/operations/SetAttributeOperation.java Wed Jan 23 13:49:20 2013 +0900 @@ -13,4 +13,4 @@ public abstract String getKey(); public abstract ByteBuffer getValue(); -} +} \ No newline at end of file