Java Doc for LogMergePolicy.java in  » Net » lucene-connector » org » apache » lucene » index » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » lucene connector » org.apache.lucene.index 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.lucene.index.MergePolicy
      org.apache.lucene.index.LogMergePolicy

All known Subclasses:   org.apache.lucene.index.LogDocMergePolicy,  org.apache.lucene.index.LogByteSizeMergePolicy,
LogMergePolicy
abstract public class LogMergePolicy extends MergePolicy (Code)

This class implements a MergePolicy that tries to merge segments into levels of exponentially increasing size, where each level has < mergeFactor segments in it. Whenever a given levle has mergeFactor segments or more in it, they will be merged.

This class is abstract and requires a subclass to define the LogMergePolicy.size method which specifies how a segment's size is determined. LogDocMergePolicy is one subclass that measures size by document count in the segment. LogByteSizeMergePolicy is another subclass that measures size as the total byte size of the file(s) for the segment.



Field Summary
final public static  intDEFAULT_MAX_MERGE_DOCS
     Default maximum segment size.
final public static  intDEFAULT_MERGE_FACTOR
    
final public static  doubleLEVEL_LOG_SPAN
     Defines the allowed range of log(size) for each level.
 intmaxMergeDocs
    
 longmaxMergeSize
    
 longminMergeSize
    


Method Summary
public  voidclose()
    
public  MergeSpecificationfindMerges(SegmentInfos infos, IndexWriter writer)
     Checks if any merges are now necessary and returns a MergePolicy.MergeSpecification if so.
public  MergeSpecificationfindMergesForOptimize(SegmentInfos infos, IndexWriter writer, int maxNumSegments, Set segmentsToOptimize)
     Returns the merges necessary to optimize the index. This merge policy defines "optimized" to mean only one segment in the index, where that segment has no deletions pending nor separate norms, and it is in compound file format if the current useCompoundFile setting is true.
public  intgetMaxMergeDocs()
     Returns the largest segment (measured by document count) that may be merged with other segments.
public  intgetMergeFactor()
    
public  booleangetUseCompoundDocStore()
     Returns true if newly flushed and newly merge doc store segment files (term vectors and stored fields) are written in compound file format.
public  booleangetUseCompoundFile()
     Returns true if newly flushed and newly merge segments are written in compound file format.
public  voidsetMaxMergeDocs(int maxMergeDocs)
    

Determines the largest segment (measured by document count) that may be merged with other segments. Small values (e.g., less than 10,000) are best for interactive indexing, as this limits the length of pauses while indexing to a few seconds.

public  voidsetMergeFactor(int mergeFactor)
     Determines how often segment indices are merged by addDocument().
public  voidsetUseCompoundDocStore(boolean useCompoundDocStore)
     Sets whether compound file format should be used for newly flushed and newly merged doc store segment files (term vectors and stored fields).
public  voidsetUseCompoundFile(boolean useCompoundFile)
     Sets whether compound file format should be used for newly flushed and newly merged segments.
abstract protected  longsize(SegmentInfo info)
    
public  booleanuseCompoundDocStore(SegmentInfos infos)
    
public  booleanuseCompoundFile(SegmentInfos infos, SegmentInfo info)
    

Field Detail
DEFAULT_MAX_MERGE_DOCS
final public static int DEFAULT_MAX_MERGE_DOCS(Code)
Default maximum segment size. A segment of this size or larger will never be merged. @see setMaxMergeDocs



DEFAULT_MERGE_FACTOR
final public static int DEFAULT_MERGE_FACTOR(Code)
Default merge factor, which is how many segments are merged at a time



LEVEL_LOG_SPAN
final public static double LEVEL_LOG_SPAN(Code)
Defines the allowed range of log(size) for each level. A level is computed by taking the max segment log size, minuse LEVEL_LOG_SPAN, and finding all segments falling within that range.



maxMergeDocs
int maxMergeDocs(Code)



maxMergeSize
long maxMergeSize(Code)



minMergeSize
long minMergeSize(Code)





Method Detail
close
public void close()(Code)



findMerges
public MergeSpecification findMerges(SegmentInfos infos, IndexWriter writer) throws IOException(Code)
Checks if any merges are now necessary and returns a MergePolicy.MergeSpecification if so. A merge is necessary when there are more than LogMergePolicy.setMergeFactor segments at a given level. When multiple levels have too many segments, this method will return multiple merges, allowing the MergeScheduler to use concurrency.



findMergesForOptimize
public MergeSpecification findMergesForOptimize(SegmentInfos infos, IndexWriter writer, int maxNumSegments, Set segmentsToOptimize) throws IOException(Code)
Returns the merges necessary to optimize the index. This merge policy defines "optimized" to mean only one segment in the index, where that segment has no deletions pending nor separate norms, and it is in compound file format if the current useCompoundFile setting is true. This method returns multiple merges (mergeFactor at a time) so the MergeScheduler in use may make use of concurrency.



getMaxMergeDocs
public int getMaxMergeDocs()(Code)
Returns the largest segment (measured by document count) that may be merged with other segments.
See Also:   LogMergePolicy.setMaxMergeDocs
See Also:   



getMergeFactor
public int getMergeFactor()(Code)

Returns the number of segments that are merged at once and also controls the total number of segments allowed to accumulate in the index.




getUseCompoundDocStore
public boolean getUseCompoundDocStore()(Code)
Returns true if newly flushed and newly merge doc store segment files (term vectors and stored fields) are written in compound file format. @see #setUseCompoundDocStore



getUseCompoundFile
public boolean getUseCompoundFile()(Code)
Returns true if newly flushed and newly merge segments are written in compound file format. @see #setUseCompoundFile



setMaxMergeDocs
public void setMaxMergeDocs(int maxMergeDocs)(Code)

Determines the largest segment (measured by document count) that may be merged with other segments. Small values (e.g., less than 10,000) are best for interactive indexing, as this limits the length of pauses while indexing to a few seconds. Larger values are best for batched indexing and speedier searches.

The default value is Integer.MAX_VALUE .

The default merge policy ( LogByteSizeMergePolicy ) also allows you to set this limit by net size (in MB) of the segment, using LogByteSizeMergePolicy.setMaxMergeMB .




setMergeFactor
public void setMergeFactor(int mergeFactor)(Code)
Determines how often segment indices are merged by addDocument(). With smaller values, less RAM is used while indexing, and searches on unoptimized indices are faster, but indexing speed is slower. With larger values, more RAM is used during indexing, and while searches on unoptimized indices are slower, indexing is faster. Thus larger values (> 10) are best for batch index creation, and smaller values (< 10) for indices that are interactively maintained.



setUseCompoundDocStore
public void setUseCompoundDocStore(boolean useCompoundDocStore)(Code)
Sets whether compound file format should be used for newly flushed and newly merged doc store segment files (term vectors and stored fields).



setUseCompoundFile
public void setUseCompoundFile(boolean useCompoundFile)(Code)
Sets whether compound file format should be used for newly flushed and newly merged segments.



size
abstract protected long size(SegmentInfo info) throws IOException(Code)



useCompoundDocStore
public boolean useCompoundDocStore(SegmentInfos infos)(Code)



useCompoundFile
public boolean useCompoundFile(SegmentInfos infos, SegmentInfo info)(Code)



Methods inherited from org.apache.lucene.index.MergePolicy
abstract void close()(Code)(Java Doc)
abstract MergeSpecification findMerges(SegmentInfos segmentInfos, IndexWriter writer) throws CorruptIndexException, IOException(Code)(Java Doc)
abstract MergeSpecification findMergesForOptimize(SegmentInfos segmentInfos, IndexWriter writer, int maxSegmentCount, Set segmentsToOptimize) throws CorruptIndexException, IOException(Code)(Java Doc)
abstract boolean useCompoundDocStore(SegmentInfos segments)(Code)(Java Doc)
abstract boolean useCompoundFile(SegmentInfos segments, SegmentInfo newSegment)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.