lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: open and access memory mapped file in read mode
Date Wed, 31 Dec 2014 18:46:42 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 3c3b8f620 -> b47de89ef


open and access memory mapped file in read mode


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/b47de89e
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/b47de89e
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/b47de89e

Branch: refs/heads/master
Commit: b47de89ef9f832163eda803f84b88bb21f479529
Parents: 3c3b8f6
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Wed Dec 31 12:42:54 2014 -0500
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Wed Dec 31 12:42:54 2014 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Core/Store/MMapDirectory.cs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b47de89e/src/Lucene.Net.Core/Store/MMapDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/MMapDirectory.cs b/src/Lucene.Net.Core/Store/MMapDirectory.cs
index 676be11..2e2d8ab 100644
--- a/src/Lucene.Net.Core/Store/MMapDirectory.cs
+++ b/src/Lucene.Net.Core/Store/MMapDirectory.cs
@@ -352,14 +352,16 @@ namespace Lucene.Net.Store
              */
 
             if (input.memoryMappedFile == null)
-                input.memoryMappedFile = MemoryMappedFile.CreateFromFile(fc, null, length
== 0 ? 100 : length, MemoryMappedFileAccess.ReadWrite, null, HandleInheritability.Inheritable,
false);
+            {
+                input.memoryMappedFile = MemoryMappedFile.CreateFromFile(fc, null, length
== 0 ? 100 : length, MemoryMappedFileAccess.Read, null, HandleInheritability.Inheritable,
false);
+            }
 
             long bufferStart = 0L;
             for (int bufNr = 0; bufNr < nrBuffers; bufNr++)
             {
                 int bufSize = (int)((length > (bufferStart + chunkSize)) ? chunkSize :
(length - bufferStart));
                 //LUCENE TO-DO
-                buffers[bufNr] = new MemoryMappedFileByteBuffer(input.memoryMappedFile.CreateViewAccessor(offset
+ bufferStart, bufSize), -1, 0, bufSize, bufSize);
+                buffers[bufNr] = new MemoryMappedFileByteBuffer(input.memoryMappedFile.CreateViewAccessor(offset
+ bufferStart, bufSize, MemoryMappedFileAccess.Read), -1, 0, bufSize, bufSize);
                 //buffers[bufNr] = fc.Map(FileStream.MapMode.READ_ONLY, offset + bufferStart,
bufSize);
                 bufferStart += bufSize;
             }


Mime
View raw message