jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r831831 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java
Date Mon, 02 Nov 2009 09:12:58 GMT
Author: mreutegg
Date: Mon Nov  2 09:12:58 2009
New Revision: 831831

URL: http://svn.apache.org/viewvc?rev=831831&view=rev
Log:
JCR-2373: Buffered I/O in IndexInfos

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java?rev=831831&r1=831830&r2=831831&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java
Mon Nov  2 09:12:58 2009
@@ -16,21 +16,23 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
+import java.io.BufferedInputStream;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.BufferedOutputStream;
 import java.util.ArrayList;
-import java.util.List;
-import java.util.LinkedHashMap;
 import java.util.Iterator;
-import java.util.NoSuchElementException;
+import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.NoSuchElementException;
 
-import org.apache.lucene.store.Directory;
 import org.apache.jackrabbit.core.query.lucene.directory.IndexInputStream;
 import org.apache.jackrabbit.core.query.lucene.directory.IndexOutputStream;
+import org.apache.lucene.store.Directory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -147,8 +149,8 @@
         String newName = getFileName();
         boolean success = false;
         try {
-            OutputStream out = new IndexOutputStream(
-                    directory.createOutput(newName));
+            OutputStream out = new BufferedOutputStream(new IndexOutputStream(
+                    directory.createOutput(newName)));
             try {
                 log.debug("Writing IndexInfos {}", newName);
                 DataOutputStream dataOut = new DataOutputStream(out);
@@ -288,7 +290,8 @@
      */
     private void read() throws IOException {
         String fileName = getFileName(generation);
-        InputStream in = new IndexInputStream(directory.openInput(fileName));
+        InputStream in = new BufferedInputStream(new IndexInputStream(
+                directory.openInput(fileName)));
         try {
             LinkedHashMap<String, IndexInfo> indexes = new LinkedHashMap<String,
IndexInfo>();
             DataInputStream di = new DataInputStream(in);



Mime
View raw message