comparison src/main/java/alice/datasegment/LocalDataSegmentManager.java @ 527:bfec2c3ff1b8 dispose

change unzip
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Thu, 30 Apr 2015 18:14:02 +0900
parents 928907206d21
children cb7c31848d16
comparison
equal deleted inserted replaced
526:928907206d21 527:bfec2c3ff1b8
73 if (key!=null) 73 if (key!=null)
74 dataSegments.remove(key); 74 dataSegments.remove(key);
75 } 75 }
76 76
77 @Override 77 @Override
78 public void put(String key, ReceiveData rData, boolean quickFlag) { 78 public void put(String key, ReceiveData rData, SendOption option) {
79 DataSegmentKey dataSegmentKey = getDataSegmentKey(key); 79 DataSegmentKey dataSegmentKey = getDataSegmentKey(key);
80 Command cmd = new Command(CommandType.PUT, null, key, rData, 0, 0, null, null, reverseKey); 80 Command cmd = new Command(CommandType.PUT, null, key, rData, 0, 0, null, null, reverseKey);//ここでMP変換している
81 cmd.setCompressFlag(option.getCompressFlag());
82 rData.setCompressFlag(option.getCompressFlag());
83
81 dataSegmentKey.runCommand(cmd); 84 dataSegmentKey.runCommand(cmd);
82 if (logger.isDebugEnabled()) 85 if (logger.isDebugEnabled())
83 logger.debug(cmd.getCommandString()); 86 logger.debug(cmd.getCommandString());
84 }
85
86 public void put(String key, ReceiveData rData) {
87 this.put(key, rData, false);
88 } 87 }
89 88
90 /** 89 /**
91 * Enqueue update command to the queue of each DataSegment key 90 * Enqueue update command to the queue of each DataSegment key
92 */ 91 */
93 92
94 @Override 93 @Override
95 public void update(String key, ReceiveData rData, boolean quickFlag) { 94 public void update(String key, ReceiveData rData, SendOption option) {
96 DataSegmentKey dataSegmentKey = getDataSegmentKey(key); 95 DataSegmentKey dataSegmentKey = getDataSegmentKey(key);
97 Command cmd = new Command(CommandType.UPDATE, null, key, rData, 0, 0, null, null, reverseKey); 96 Command cmd = new Command(CommandType.UPDATE, null, key, rData, 0, 0, null, null, reverseKey);
97 cmd.setCompressFlag(option.getCompressFlag());
98 rData.setCompressFlag(option.getCompressFlag());
99
98 dataSegmentKey.runCommand(cmd); 100 dataSegmentKey.runCommand(cmd);
99 if (logger.isDebugEnabled()) 101 if (logger.isDebugEnabled())
100 logger.debug(cmd.getCommandString()); 102 logger.debug(cmd.getCommandString());
101 } 103 }
102 104
103 @Override 105 @Override
104 public void take(Receiver receiver, CodeSegment cs, boolean quickFlag) { 106 public void take(Receiver receiver, CodeSegment cs, SendOption option) {
105 take(receiver, cs, quickFlag, false);
106 }
107
108 @Override
109 public void take(Receiver receiver, CodeSegment cs, boolean quickFlag, boolean compressFlag) {
110 DataSegmentKey dataSegmentKey = getDataSegmentKey(receiver.key); 107 DataSegmentKey dataSegmentKey = getDataSegmentKey(receiver.key);
111 int seq = this.seq.getAndIncrement(); 108 int seq = this.seq.getAndIncrement();
112 Command cmd = new Command(CommandType.TAKE, receiver, receiver.key, null, receiver.index, seq, replyQueue, cs, null); 109 Command cmd = new Command(CommandType.TAKE, receiver, receiver.key, null, receiver.index, seq, replyQueue, cs, null);
113 cmd.setCompressFlag(compressFlag); 110 cmd.setCompressFlag(option.getCompressFlag());
111
114 dataSegmentKey.runCommand(cmd); 112 dataSegmentKey.runCommand(cmd);
115 if (logger.isDebugEnabled()) 113 if (logger.isDebugEnabled())
116 logger.debug(cmd.getCommandString()); 114 logger.debug(cmd.getCommandString());
117 } 115 }
118 116
119 @Override 117 @Override
120 public void peek(Receiver receiver, CodeSegment cs, boolean quickFlag) { 118 public void peek(Receiver receiver, CodeSegment cs, SendOption option) {
121 DataSegmentKey dataSegmentKey = getDataSegmentKey(receiver.key); 119 DataSegmentKey dataSegmentKey = getDataSegmentKey(receiver.key);
122 int seq = this.seq.getAndIncrement(); 120 int seq = this.seq.getAndIncrement();
123 Command cmd = new Command(CommandType.PEEK, receiver, receiver.key, null, receiver.index, seq, replyQueue, cs, null); 121 Command cmd = new Command(CommandType.PEEK, receiver, receiver.key, null, receiver.index, seq, replyQueue, cs, null);
122 cmd.setCompressFlag(option.getCompressFlag());
123
124 dataSegmentKey.runCommand(cmd); 124 dataSegmentKey.runCommand(cmd);
125 if (logger.isDebugEnabled()) 125 if (logger.isDebugEnabled())
126 logger.debug(cmd.getCommandString()); 126 logger.debug(cmd.getCommandString());
127 } 127 }
128 128