Examples of IndexInputStream


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

      {
         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));
               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

    * @throws IOException
    */
   private void rename(String from, String to) throws IOException
   {
      IndexOutputStream out = null;
      IndexInputStream in = null;
      try
      {
         out = new IndexOutputStream(dir.createOutput(to));
         in = new IndexInputStream(dir.openInput(from));
         DirectoryHelper.transfer(in, out);
      }
      finally
      {
         if (in != null)
         {
            in.close();
         }

         if (out != null)
         {
            out.flush();
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));
      BufferedReader reader = null;
      try
      {
         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 (reader != null)
         {
            try
            {
               reader.close();
            }
            catch (IOException e)
            {
               log.warn("Exception while closing redo log: " + e.toString());
            }
         }
         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));
               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

    * @throws IOException
    */
   private void rename(String from, String to) throws IOException
   {
      IndexOutputStream out = null;
      IndexInputStream in = null;
      try
      {
         out = new IndexOutputStream(dir.createOutput(to));
         in = new IndexInputStream(dir.openInput(from));
         DirectoryHelper.transfer(in, out);
      }
      finally
      {
         if (in != null)
         {
            in.close();
         }

         if (out != null)
         {
            out.flush();
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.