Save This Page
Home » lucene-2.3.2-src » org.apache » lucene » index » [javadoc | source]
org.apache.lucene.index
final class: SegmentInfos [javadoc | source]
java.lang.Object
   java.util.AbstractCollection
      java.util.AbstractList
         java.util.Vector
            org.apache.lucene.index.SegmentInfos

All Implemented Interfaces:
    List, Serializable, RandomAccess, Cloneable, Collection

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Nested Class Summary:
abstract public static class  SegmentInfos.FindSegmentsFile  Utility class for executing code that needs to do something with the current segments file. This is necessary with lock-less commits because from the time you locate the current segments file name, until you actually open it, read its contents, or check modified time, etc., it could have been deleted due to a writer commit finishing. 
Field Summary
public static final  int FORMAT    The file format version, a negative number. 
public static final  int FORMAT_LOCKLESS    This format adds details used for lockless commits. It differs slightly from the previous format in that file names are never re-used (write once). Instead, each file is written to the next generation. For example, segments_1, segments_2, etc. This allows us to not use a commit lock. See file formats for details. 
public static final  int FORMAT_SINGLE_NORM_FILE    This format adds a "hasSingleNormFile" flag into each segment info. See LUCENE-756 for details. 
public static final  int FORMAT_SHARED_DOC_STORE    This format allows multiple segments to share a single vectors and stored fields file. 
public  int counter     
Method from org.apache.lucene.index.SegmentInfos Summary:
clone,   generationFromSegmentsFileName,   getCurrentSegmentFileName,   getCurrentSegmentFileName,   getCurrentSegmentFileName,   getCurrentSegmentGeneration,   getCurrentSegmentGeneration,   getDefaultGenFileRetryCount,   getDefaultGenFileRetryPauseMsec,   getDefaultGenLookahedCount,   getGeneration,   getInfoStream,   getLastGeneration,   getNextSegmentFileName,   getVersion,   info,   range,   read,   read,   readCurrentVersion,   setDefaultGenFileRetryCount,   setDefaultGenFileRetryPauseMsec,   setDefaultGenLookaheadCount,   setInfoStream,   write
Methods from java.util.Vector:
add,   add,   addAll,   addAll,   addElement,   capacity,   clear,   clone,   contains,   containsAll,   copyInto,   elementAt,   elements,   ensureCapacity,   equals,   firstElement,   get,   hashCode,   indexOf,   indexOf,   insertElementAt,   isEmpty,   lastElement,   lastIndexOf,   lastIndexOf,   remove,   remove,   removeAll,   removeAllElements,   removeElement,   removeElementAt,   retainAll,   set,   setElementAt,   setSize,   size,   subList,   toArray,   toArray,   toString,   trimToSize
Methods from java.util.AbstractList:
add,   add,   addAll,   clear,   equals,   get,   hashCode,   indexOf,   iterator,   lastIndexOf,   listIterator,   listIterator,   remove,   set,   subList
Methods from java.util.AbstractCollection:
add,   addAll,   clear,   contains,   containsAll,   isEmpty,   iterator,   remove,   removeAll,   retainAll,   size,   toArray,   toArray,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.index.SegmentInfos Detail:
 public Object clone() 
    Returns a copy of this instance, also copying each SegmentInfo.
 public static long generationFromSegmentsFileName(String fileName) 
    Parse the generation off the segments file name and return it.
 public String getCurrentSegmentFileName() 
    Get the segments_N filename in use by this segment infos.
 public static String getCurrentSegmentFileName(String[] files) throws IOException 
    Get the filename of the current segments_N file from a list of files.
 public static String getCurrentSegmentFileName(Directory directory) throws IOException 
    Get the filename of the current segments_N file in the directory.
 public static long getCurrentSegmentGeneration(String[] files) 
    Get the generation (N) of the current segments_N file from a list of files.
 public static long getCurrentSegmentGeneration(Directory directory) throws IOException 
    Get the generation (N) of the current segments_N file in the directory.
 public static int getDefaultGenFileRetryCount() 
 public static int getDefaultGenFileRetryPauseMsec() 
 public static int getDefaultGenLookahedCount() 
 public long getGeneration() 
 public static PrintStream getInfoStream() 
 public long getLastGeneration() 
 public String getNextSegmentFileName() 
    Get the next segments_N filename that will be written.
 public long getVersion() 
    version number when this SegmentInfos was generated.
 public final SegmentInfo info(int i) 
 public SegmentInfos range(int first,
    int last) 
    Returns a new SegmentInfos containg the SegmentInfo instances in the specified range first (inclusive) to last (exclusive), so total number of segments returned is last-first.
 public final  void read(Directory directory) throws IOException, CorruptIndexException 
    This version of read uses the retry logic (for lock-less commits) to find the right segments file to load.
 public final  void read(Directory directory,
    String segmentFileName) throws IOException, CorruptIndexException 
    Read a particular segmentFileName. Note that this may throw an IOException if a commit is in process.
 public static long readCurrentVersion(Directory directory) throws IOException, CorruptIndexException 
    Current version number from segments file.
 public static  void setDefaultGenFileRetryCount(int count) 
    Advanced: set how many times to try loading the segments.gen file contents to determine current segment generation. This file is only referenced when the primary method (listing the directory) fails.
 public static  void setDefaultGenFileRetryPauseMsec(int msec) 
    Advanced: set how many milliseconds to pause in between attempts to load the segments.gen file.
 public static  void setDefaultGenLookaheadCount(int count) 
    Advanced: set how many times to try incrementing the gen when loading the segments file. This only runs if the primary (listing directory) and secondary (opening segments.gen file) methods fail to find the segments file.
 public static  void setInfoStream(PrintStream infoStream) 
    If non-null, information about retries when loading the segments file will be printed to this.
 public final  void write(Directory directory) throws IOException