annotate src/alice/datasegment/DataSegmentManager.java @ 12:c4d6ff56b9bf

unite Command and Reply and add Network outline
author one
date Fri, 13 Jan 2012 07:04:38 +0900
parents 352eb19d837d
children 30f97d776a3e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
1 package alice.datasegment;
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
2
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
3 import java.util.concurrent.ConcurrentHashMap;
6
c78a1cc2cd8f implements Reply
one
parents: 5
diff changeset
4 import java.util.concurrent.LinkedBlockingQueue;
c78a1cc2cd8f implements Reply
one
parents: 5
diff changeset
5
3
91057e15065f add DataSegment API and CodeSegment
one
parents: 2
diff changeset
6 import org.msgpack.type.Value;
2
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
7
3
91057e15065f add DataSegment API and CodeSegment
one
parents: 2
diff changeset
8 import alice.codesegment.CodeSegment;
2
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
9
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
10 public abstract class DataSegmentManager {
6
c78a1cc2cd8f implements Reply
one
parents: 5
diff changeset
11 public ConcurrentHashMap<String, DataSegmentKey> dataSegments = new ConcurrentHashMap<String, DataSegmentKey>();
c78a1cc2cd8f implements Reply
one
parents: 5
diff changeset
12 public ConcurrentHashMap<Integer, Command> seqHash = new ConcurrentHashMap<Integer, Command>();
12
c4d6ff56b9bf unite Command and Reply
one
parents: 7
diff changeset
13 public LinkedBlockingQueue<Command> replyQueue = new LinkedBlockingQueue<Command>();
2
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
14
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
15 public abstract void put(String key, Value val);
5
80375ae09a1f add update api
one
parents: 3
diff changeset
16 public abstract void update(String key, Value val);
7
352eb19d837d implements reply of LocalDataSegment
one
parents: 6
diff changeset
17 public void take(String argKey, String key, CodeSegment cs) {
352eb19d837d implements reply of LocalDataSegment
one
parents: 6
diff changeset
18 take(argKey, key, 0, cs);
2
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
19 }
7
352eb19d837d implements reply of LocalDataSegment
one
parents: 6
diff changeset
20 public abstract void take(String argKey, String key, int index, CodeSegment cs);
352eb19d837d implements reply of LocalDataSegment
one
parents: 6
diff changeset
21 public void peek(String argKey, String key, CodeSegment cs) {
352eb19d837d implements reply of LocalDataSegment
one
parents: 6
diff changeset
22 peek(argKey, key, 0, cs);
2
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
23 }
7
352eb19d837d implements reply of LocalDataSegment
one
parents: 6
diff changeset
24 public abstract void peek(String argKey, String key, int index, CodeSegment cs);
3
91057e15065f add DataSegment API and CodeSegment
one
parents: 2
diff changeset
25 public abstract void remove(String key);
2
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
26
f71eabb1df2a create outline of DataSegment model
one
parents:
diff changeset
27 }