• R/O
  • SSH
  • HTTPS

okuyama: 提交


Commit MetaInfo

修訂1040 (tree)
時間2013-11-11 11:29:12
作者okuyamaoo

Log Message

Fuse修正

Change Summary

差異

--- trunk/okuyamaFuse/src/fuse/okuyamafs/OkuyamaFilesystem.java (revision 1039)
+++ trunk/okuyamaFuse/src/fuse/okuyamafs/OkuyamaFilesystem.java (revision 1040)
@@ -24,8 +24,8 @@
2424
2525 public volatile static int blockSizeAssist = 50;
2626
27- //public volatile static int blockSize = 1024*512;//5200; // Blockサイズ
28- public volatile static int blockSize = 5632; // Blockサイズ
27+ public volatile static int blockSize = 1024*128;//5200; // Blockサイズ
28+ //public volatile static int blockSize = 5632; // Blockサイズ
2929
3030
3131 public volatile static int writeBufferSize = 1024 * 1024 * 5 + 1024;
@@ -152,6 +152,18 @@
152152 try {
153153 String[] setInfo = new String[11];
154154
155+ synchronized (this.parallelDataAccessSync[((path.hashCode() << 1) >>> 1) % 100]) {
156+
157+ // 読み込むファイルがバッファリング書き込み中の場合一旦全てのバッファをflushする
158+ List bufferedDataFhList = writeBufFpMap.removeGroupingData(path);
159+ if (bufferedDataFhList != null) {
160+ for (int idx = 0; idx < bufferedDataFhList.size(); idx++) {
161+ Object bFh = bufferedDataFhList.get(idx);
162+ this.fixNoCommitData(bFh);
163+ }
164+ }
165+ }
166+
155167 if (path.trim().equals("/")) {
156168
157169 setInfo[1] = new Integer(FuseFtypeConstants.TYPE_DIR | 0777).toString();
@@ -564,7 +576,11 @@
564576 return 0;
565577 }
566578
567- public int unlink(String path) throws FuseException {
579+/* public int unlink(String path) throws FuseException {
580+ return 0;
581+ }
582+*/
583+ public int unlink(String path) throws FuseException {
568584 log.info("unlink " + path);
569585
570586 try {
@@ -741,7 +757,11 @@
741757 if (fh == null) return Errno.EBADE;
742758 //long start = System.nanoTime();
743759 try {
744-
760+/*System.out.println("--------------- start --------------- ");
761+ for (int i = 0; i < writeData.length; i++) {
762+ System.out.println("path=" + path + " offet=" + offset +" writeData[" + i + "]=" + writeData[i]);
763+ }
764+System.out.println("--------------- end --------------- ");*/
745765 String pathTrimStr = path.trim();
746766 String pathInfoStr = (String)client.getPathDetail(pathTrimStr);
747767 if (pathInfoStr == null) return Errno.ENOENT;
@@ -799,6 +819,8 @@
799819 }
800820
801821 public int read(String path, Object fh, ByteBuffer buf, long offset) throws FuseException {
822+
823+
802824 /*long start1 = 0L;
803825 long start2 = 0L;
804826 long start3 = 0L;
@@ -831,8 +853,9 @@
831853 String pathInfoStr = (String)client.getPathDetail(trimToPath);
832854
833855 String[] pathInfo = pathInfoStr.split("\t");
856+ long nowSize = Long.parseLong(pathInfo[4]);
834857 int readLen = client.readValue(trimToPath, offset, buf.limit(), pathInfo[pathInfo.length - 2], buf);
835-
858+
836859 if (readLen == -1 || readLen < 1) {
837860
838861 log.info("read data nothing read=" + "read:" + path + " offset:" + offset + " buf.limit:" + buf.limit());
--- trunk/okuyamaFuse/src/fuse/okuyamafs/OkuyamaFsMap.java (revision 1039)
+++ trunk/okuyamaFuse/src/fuse/okuyamafs/OkuyamaFsMap.java (revision 1040)
@@ -192,6 +192,7 @@
192192
193193 //long start = System.nanoTime();
194194 client.sendByteValue(keyStr, OkuyamaFsMapUtil.dataCompress(value));
195+ dataCache.put(keyStr, value);
195196 //long end = System.nanoTime();
196197 //System.out.println("putBytes=" + ((end - start) / 1000 / 1000) + " Len=" + value.length);
197198
@@ -232,6 +233,7 @@
232233 byte[] data = (byte[])putData[1];
233234 //dataCache.put(keyStr, data);
234235 if (daemon != null) {
236+ dataCache.put(keyStr, data);
235237 daemon.putRequest(keyStr, data);
236238 useDaemonList.add(daemon);
237239 } else {
@@ -238,6 +240,7 @@
238240
239241 OkuyamaClient client = createClient();
240242 client.sendByteValue(keyStr, OkuyamaFsMapUtil.dataCompress(data));
243+ dataCache.put(keyStr, data);
241244 client.close();
242245 }
243246 }
@@ -270,6 +273,7 @@
270273 try {
271274
272275 client.setObjectValue(type + "\t" + (String)key, value);
276+ dataCache.remove(type + "\t" + (String)key);
273277 } catch (Exception e) {
274278 e.printStackTrace();
275279 } finally {
Show on old repository browser