You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tv...@apache.org on 2015/04/06 16:01:39 UTC
svn commit: r1671537 - in /commons/proper/jcs/trunk:
commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/block/
commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/indexed/
src/changes/
Author: tv
Date: Mon Apr 6 14:01:39 2015
New Revision: 1671537
URL: http://svn.apache.org/r1671537
Log:
Fix JCS-148: Unnecessary use of FileChannel.force() in Indexed and Block Disk Caches
Modified:
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDisk.java
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDisk.java
commons/proper/jcs/trunk/src/changes/changes.xml
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDisk.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDisk.java?rev=1671537&r1=1671536&r2=1671537&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDisk.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDisk.java Mon Apr 6 14:01:39 2015
@@ -19,12 +19,6 @@ package org.apache.commons.jcs.auxiliary
* under the License.
*/
-import org.apache.commons.jcs.engine.behavior.IElementSerializer;
-import org.apache.commons.jcs.utils.serialization.StandardSerializer;
-import org.apache.commons.jcs.utils.struct.SingleLinkedList;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
@@ -36,6 +30,12 @@ import java.nio.channels.FileChannel;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
+import org.apache.commons.jcs.engine.behavior.IElementSerializer;
+import org.apache.commons.jcs.utils.serialization.StandardSerializer;
+import org.apache.commons.jcs.utils.struct.SingleLinkedList;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* This class manages reading an writing data to disk. When asked to write a value, it returns a
* block array. It can read an object from the block numbers in a byte array.
@@ -223,7 +223,7 @@ public class BlockDisk
offset += length;
}
- fc.force(false);
+ //fc.force(false);
return blocks;
}
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDisk.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDisk.java?rev=1671537&r1=1671536&r2=1671537&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDisk.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDisk.java Mon Apr 6 14:01:39 2015
@@ -19,10 +19,6 @@ package org.apache.commons.jcs.auxiliary
* under the License.
*/
-import org.apache.commons.jcs.engine.behavior.IElementSerializer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -31,6 +27,10 @@ import java.io.Serializable;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
+import org.apache.commons.jcs.engine.behavior.IElementSerializer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/** Provides thread safe access to the underlying random access file. */
class IndexedDisk
{
@@ -193,7 +193,7 @@ class IndexedDisk
buffer.put(data);
buffer.flip();
int written = fc.write(buffer, pos);
- fc.force(true);
+ //fc.force(true);
return written == data.length;
}
Modified: commons/proper/jcs/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/changes/changes.xml?rev=1671537&r1=1671536&r2=1671537&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/changes/changes.xml (original)
+++ commons/proper/jcs/trunk/src/changes/changes.xml Mon Apr 6 14:01:39 2015
@@ -20,6 +20,9 @@
</properties>
<body>
<release version="2.0" date="unreleased" description="JDK 1.6 based major release">
+ <action issue="JCS-148" dev="tv" type="fix" due-to="Wiktor Niesiobedzki">
+ Unnecessary use of FileChannel.force() in Indexed and Block Disk Caches
+ </action>
<action issue="JCS-146" dev="tv" type="fix" due-to="Wiktor Niesiobedzki">
IndexedDiskCache: Mismatched memory and disk length (0) for
[DED: pos = 63802 len = 9658] during optimization