Mercurial > hg > Members > tatsuki > Alice
changeset 2:f71eabb1df2a
create outline of DataSegment model
author | one |
---|---|
date | Sun, 11 Dec 2011 06:37:05 +0900 |
parents | 1f2be1ffaab7 |
children | 91057e15065f |
files | src/alice/datasegment/DataSegmentKey.java src/alice/datasegment/DataSegmentManager.java src/alice/datasegment/LocalDataSegmentManager.java |
diffstat | 3 files changed, 60 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/datasegment/DataSegmentKey.java Sun Dec 11 06:37:05 2011 +0900 @@ -0,0 +1,5 @@ +package alice.datasegment; + +public class DataSegmentKey { + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/datasegment/DataSegmentManager.java Sun Dec 11 06:37:05 2011 +0900 @@ -0,0 +1,22 @@ +package alice.datasegment; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Future; + +import org.msgpack.type.Value; + +public abstract class DataSegmentManager { + ConcurrentHashMap<String, DataSegmentKey> dataSegments = new ConcurrentHashMap<String, DataSegmentKey>(); + + public abstract void put(String key, Value val); + public Future<Value> take(String key) { + return take(key, 0); + } + public abstract Future<Value> take(String key, int index); + public Future<Value> peek(String key) { + return peek(key, 0); + } + public abstract Future<Value> peek(String key, int index); + public abstract void delete(String key); + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/datasegment/LocalDataSegmentManager.java Sun Dec 11 06:37:05 2011 +0900 @@ -0,0 +1,33 @@ +package alice.datasegment; + +import java.util.concurrent.Future; + +import org.msgpack.type.Value; + +public class LocalDataSegmentManager extends DataSegmentManager { + + @Override + public void put(String key, Value val) { + // TODO Auto-generated method stub + + } + + @Override + public Future<Value> take(String key, int index) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Future<Value> peek(String key, int index) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void delete(String key) { + // TODO Auto-generated method stub + + } + +}