Examples of IndexInputStream


Examples of org.apache.jackrabbit.core.query.lucene.directory.IndexInputStream

     *
     * @param dir the directory from where to read the index infos.
     * @throws IOException if an error occurs.
     */
    void read(Directory dir) throws IOException {
        InputStream in = new IndexInputStream(dir.openInput(name));
        try {
            DataInputStream di = new DataInputStream(in);
            counter = di.readInt();
            for (int i = di.readInt(); i > 0; i--) {
                String indexName = di.readUTF();
                indexes.add(indexName);
                names.add(indexName);
            }
        } finally {
            in.close();
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.query.lucene.directory.IndexInputStream

     */
    private void read(ActionCollector collector) throws IOException {
        if (!dir.fileExists(REDO_LOG)) {
            return;
        }
        InputStream in = new IndexInputStream(dir.openInput(REDO_LOG));
        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
            String line;
            while ((line = reader.readLine()) != null) {
                try {
                    collector.collect(MultiIndex.Action.fromString(line));
                } catch (IllegalArgumentException e) {
                    log.warn("Malformed redo entry: " + e.getMessage());
                }
            }
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e) {
                    log.warn("Exception while closing redo log: " + e.toString());
                }
            }
        }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexInputStream

            {
            if (!dir.fileExists(REDO_LOG))
            {
               return null;
            }
            InputStream in = new IndexInputStream(dir.openInput(REDO_LOG));
            try
            {
               BufferedReader reader = new BufferedReader(new InputStreamReader(in));
               String line;
               while ((line = reader.readLine()) != null)
               {
                  try
                  {
                     collector.collect(MultiIndex.Action.fromString(line));
                  }
                  catch (IllegalArgumentException e)
                  {
                     log.warn("Malformed redo entry: " + e.getMessage());
                  }
               }
            }
            finally
            {
               if (in != null)
               {
                  try
                  {
                     in.close();
                  }
                  catch (IOException e)
                  {
                     log.warn("Exception while closing redo log: " + e.toString());
                  }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexInputStream

            names.clear();
            indexes.clear();
            if (dir.fileExists(name))
            {
               // clear current lists
               InputStream in = new IndexInputStream(dir.openInput(name));
               DataInputStream di = null;
               try
               {
                  di = new DataInputStream(in);
                  counter = di.readInt();
                  for (int i = di.readInt(); i > 0; i--)
                  {
                     String indexName = di.readUTF();
                     indexes.add(indexName);
                     names.add(indexName);
                  }
               }
               finally
               {
                  if (di != null)
                     di.close();
                  in.close();
               }
            }
            return null;
         }
      });
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexInputStream

            names.clear();
            indexes.clear();
            if (dir.fileExists(name))
            {
               // clear current lists
               InputStream in = new IndexInputStream(dir.openInput(name));
               try
               {
                  DataInputStream di = new DataInputStream(in);
                  counter = di.readInt();
                  for (int i = di.readInt(); i > 0; i--)
                  {
                     String indexName = di.readUTF();
                     indexes.add(indexName);
                     names.add(indexName);
                  }
               }
               finally
               {
                  in.close();
               }
            }
            return null;
         }
      });
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexInputStream

      names.clear();
      indexes.clear();
      if (dir.fileExists(name))
      {
         // clear current lists
         InputStream in = new IndexInputStream(dir.openInput(name));
         try
         {
            DataInputStream di = new DataInputStream(in);
            counter = di.readInt();
            for (int i = di.readInt(); i > 0; i--)
            {
               String indexName = di.readUTF();
               indexes.add(indexName);
               names.add(indexName);
            }
         }
         finally
         {
            in.close();
         }
      }
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexInputStream

   {
      if (!dir.fileExists(REDO_LOG))
      {
         return;
      }
      InputStream in = new IndexInputStream(dir.openInput(REDO_LOG));
      try
      {
         BufferedReader reader = new BufferedReader(new InputStreamReader(in));
         String line;
         while ((line = reader.readLine()) != null)
         {
            try
            {
               collector.collect(MultiIndex.Action.fromString(line));
            }
            catch (IllegalArgumentException e)
            {
               log.warn("Malformed redo entry: " + e.getMessage());
            }
         }
      }
      finally
      {
         if (in != null)
         {
            try
            {
               in.close();
            }
            catch (IOException e)
            {
               log.warn("Exception while closing redo log: " + e.toString());
            }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexInputStream

      {
         public Object run() throws Exception
         {
            if (dir.fileExists(INDEXING_QUEUE_FILE))
            {
               InputStream in = new IndexInputStream(dir.openInput(INDEXING_QUEUE_FILE));
               BufferedReader reader = new BufferedReader(new InputStreamReader(in, ENCODING));
               try
               {
                  String line;
                  while ((line = reader.readLine()) != null)
                  {
                     int idx = line.indexOf(' ');
                     if (idx == -1)
                     {
                        // invalid line
                        log.warn("invalid line in {}: {}", INDEXING_QUEUE_FILE, line);
                     }
                     else
                     {
                        String cmd = line.substring(0, idx);
                        String uuid = line.substring(idx + 1, line.length());
                        if (ADD.equals(cmd))
                        {
                           pending.add(uuid);
                        }
                        else if (REMOVE.equals(cmd))
                        {
                           pending.remove(uuid);
                        }
                        else
                        {
                           // invalid line
                           log.warn("invalid line in {}: {}", INDEXING_QUEUE_FILE, line);
                        }
                     }
                  }
               }
               finally
               {
                  in.close();
               }
            }
            return null;
         }
      });
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexInputStream

            names.clear();
            indexes.clear();
            if (dir.fileExists(name))
            {
               // clear current lists
               InputStream in = new IndexInputStream(dir.openInput(name));
               try
               {
                  DataInputStream di = new DataInputStream(in);
                  counter = di.readInt();
                  for (int i = di.readInt(); i > 0; i--)
                  {
                     String indexName = di.readUTF();
                     indexes.add(indexName);
                     names.add(indexName);
                  }
               }
               finally
               {
                  in.close();
               }
            }
            return null;
         }
      });
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexInputStream

     *
     * @param dir the directory from where to read the index infos.
     * @throws IOException if an error occurs.
     */
    void read(Directory dir) throws IOException {
        InputStream in = new IndexInputStream(dir.openInput(name));
        try {
            DataInputStream di = new DataInputStream(in);
            counter = di.readInt();
            for (int i = di.readInt(); i > 0; i--) {
                String indexName = di.readUTF();
                indexes.add(indexName);
                names.add(indexName);
            }
        } finally {
            in.close();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.