Java Doc for PartitionLexically.java in  » Search-Engine » mg4j » it » unimi » dsi » mg4j » tool » 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 » Search Engine » mg4j » it.unimi.dsi.mg4j.tool 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   it.unimi.dsi.mg4j.tool.PartitionLexically

PartitionLexically
public class PartitionLexically (Code)
Partitions an index lexically.

A global index is partitioned lexically by providing a LexicalPartitioningStrategy that specifies a destination local index for each term, and a local term number. The global index is read directly at the bit level, and the posting lists are divided among the local indices using the provided strategy. For instance, an ContiguousLexicalStrategy divides an index into contiguous blocks (of terms) specified by the given strategy.

By choice, document pointers are not remapped. Thus, it may happen that one of the local indices contains no posting with a certain document. However, computing the subset of documents contained in each local index to remap them in a contiguous interval is not a good idea, as usually the subset of documents appearing in the postings of each local index is large.

To speed up the search of the right local index of a not-so-frequent term (in particular with a ), after partitioning an index you can create that will be used to try to avoid inquiring indices that do not contain a term. The filters will be automatically loaded by it.unimi.dsi.mg4j.index.cluster.IndexCluster.getInstance(CharSequencebooleanboolean) .

Note that the size file is the same for each local index and is not copied. Please use standard operating system features such as symbolic links to provide size files to local indices.

If you plan to the partitioned indices and you need document sizes (e.g., for ), you can use the index property it.unimi.dsi.mg4j.index.Index.UriKeys.SIZES to load the original size file. If you plan on partitioning an index requiring document sizes, you should consider a custom index loading scheme that shares the among all local indices. Important: this class just partitions the index. No auxiliary files (most notably, or ) will be generated. Please refer to a StringMap implementation (e.g., ShiftAddXorSignedStringMap or ImmutableExternalPrefixMap ).

Write-once output and distributed index partitioning

The partitioning process writes each index file sequentially exactly once, so index partitioning can output its results to pipes, which in turn can spill their content, for instance, through the network. In other words, albeit this class theoretically creates a number of local indices on disk, those indices can be substituted with suitable pipes creating remote local indices without affecting the partitioning process. For instance, the following bash code creates three sets of pipes:

 for i in 0 1 2; do
 for e in frequencies globcounts index offsets properties sizes terms; do 
 mkfifo pipe-$i.$e
 done
 done
 

Each pipe must be emptied elsewhere, for instance (assuming you want local indices index0, index1 and index2 on example.com):

 for i in 0 1 2; do 
 for e in frequencies globcounts index offsets properties sizes terms; do 
 (cat pipe-$i.$e | ssh -x example.com "cat >index-$i.$e" &)
 done
 done
 

If we now start a partitioning process generating three local indices named pipe-0, pipe-1 and pipe-2 all pipes will be written to by the process, and the data will create remotely indices index-0, index-1 and index-2.
author:
   Sebastiano Vigna
since:
   1.0.1



Field Summary
final public static  intDEFAULT_BUFFER_SIZE
     The default buffer size for all involved indices.

Constructor Summary
public  PartitionLexically(String inputBasename, String outputBasename, LexicalPartitioningStrategy strategy, String strategyFilename, int bufferSize, long logInterval)
    

Method Summary
public static  voidmain(String[] arg)
    
public  voidrun()
    
public  voidrunTermsOnly()
    

Field Detail
DEFAULT_BUFFER_SIZE
final public static int DEFAULT_BUFFER_SIZE(Code)
The default buffer size for all involved indices.




Constructor Detail
PartitionLexically
public PartitionLexically(String inputBasename, String outputBasename, LexicalPartitioningStrategy strategy, String strategyFilename, int bufferSize, long logInterval)(Code)




Method Detail
main
public static void main(String[] arg) throws JSAPException, ConfigurationException, IOException, ClassNotFoundException, SecurityException, InstantiationException, IllegalAccessException(Code)



run
public void run() throws ConfigurationException, IOException, ClassNotFoundException(Code)



runTermsOnly
public void runTermsOnly() throws IOException(Code)



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.