2
|
1 package alice.datasegment;
|
|
2
|
|
3 import java.util.concurrent.ConcurrentHashMap;
|
6
|
4 import java.util.concurrent.LinkedBlockingQueue;
|
|
5
|
3
|
6 import org.msgpack.type.Value;
|
2
|
7
|
3
|
8 import alice.codesegment.CodeSegment;
|
2
|
9
|
|
10 public abstract class DataSegmentManager {
|
6
|
11 public ConcurrentHashMap<String, DataSegmentKey> dataSegments = new ConcurrentHashMap<String, DataSegmentKey>();
|
|
12 public ConcurrentHashMap<Integer, Command> seqHash = new ConcurrentHashMap<Integer, Command>();
|
12
|
13 public LinkedBlockingQueue<Command> replyQueue = new LinkedBlockingQueue<Command>();
|
2
|
14
|
|
15 public abstract void put(String key, Value val);
|
5
|
16 public abstract void update(String key, Value val);
|
7
|
17 public void take(String argKey, String key, CodeSegment cs) {
|
|
18 take(argKey, key, 0, cs);
|
2
|
19 }
|
7
|
20 public abstract void take(String argKey, String key, int index, CodeSegment cs);
|
|
21 public void peek(String argKey, String key, CodeSegment cs) {
|
|
22 peek(argKey, key, 0, cs);
|
2
|
23 }
|
7
|
24 public abstract void peek(String argKey, String key, int index, CodeSegment cs);
|
3
|
25 public abstract void remove(String key);
|
2
|
26
|
|
27 }
|