org.gcube.indexmanagement.lucenewrapper
Class LuceneStatistics

java.lang.Object
  extended by org.gcube.indexmanagement.lucenewrapper.LuceneStatistics
All Implemented Interfaces:
IndexStatistics

public class LuceneStatistics
extends Object
implements IndexStatistics

Used for creating per term statistics from Lucene indexes.


Constructor Summary
LuceneStatistics(ServiceContextContainer ServiceContextCont)
          A constructor which sets the EPR of the calling Service.
 
Method Summary
 void close()
          Releases reserved resources.
 String createMergedStatistics(List<String> RS_EPRs)
          Creates a new statistics file, and merges additional statistics files into it.
 String createStatistics()
          Creates a statistics file and stores it in a ResultSet.
 void openIndex(String baseIndexDir, String indexName)
          Opens the index for the statistics operation.
 void updateIndex()
          Updates the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneStatistics

public LuceneStatistics(ServiceContextContainer ServiceContextCont)
A constructor which sets the EPR of the calling Service.

Parameters:
dlContextIdentifier - - the EPR of the calling Service.
Method Detail

openIndex

public void openIndex(String baseIndexDir,
                      String indexName)
               throws IndexException
Opens the index for the statistics operation.

Specified by:
openIndex in interface IndexStatistics
Parameters:
baseIndexDir - the base index storage directory
indexName - name of the index
Throws:
IndexException - - an error opening the index

updateIndex

public void updateIndex()
                 throws IndexException
Updates the index.

Specified by:
updateIndex in interface IndexStatistics
Throws:
IndexException - - an error updating the index

createStatistics

public String createStatistics()
                        throws IndexException
Creates a statistics file and stores it in a ResultSet. The statistics are represented as an XML document with a doc frequency ( number of documents the term was found in) and term frequency ( number of times the term occurred in the whole collection) for each term in the collection.

Specified by:
createStatistics in interface IndexStatistics
Returns:
The EPR of the created statistics ResultSet.
Throws:
IndexException - Unable to create the statistics file

createMergedStatistics

public String createMergedStatistics(List<String> RS_EPRs)
                              throws IndexException
Creates a new statistics file, and merges additional statistics files into it.

Specified by:
createMergedStatistics in interface IndexStatistics
Parameters:
RS_EPRs - of identifiers for the statistics to merge into newly created statistics
Returns:
String CMS ID of the merged statistics file
Throws:
IndexException - - an error creating merged statistics

close

public void close()
           throws IndexException
Releases reserved resources.

Specified by:
close in interface IndexStatistics
Throws:
IndexException - - an error closing the IndexStatistics isntance


Copyright © 2013. All Rights Reserved.