|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.indexmanagement.lucenewrapper.LuceneGenerator
public class LuceneGenerator
An IndexGenerator implementation responsible for creating and updating a Lucene index.
| Constructor Summary | |
|---|---|
LuceneGenerator(String baseIndexDir,
String deletionDir)
A constructor which sets the base directory for Index directories, and the directory in which to store deletion files. |
|
| Method Summary | |
|---|---|
void |
abort()
Deletes inserted rowsets since last commit() |
void |
close()
Frees any resources used for updating indexes if any. |
void |
closeIndex()
Closes the index committing any uncommitted insertions |
void |
commit()
Commits inserted rowsets |
void |
createIndex(String indexName,
FullTextIndexType idxType,
boolean forceCreate)
Creates a new index |
File |
deleteDocuments(String[] documentIDs)
Deletes the listed documents both from the local storage and the main index |
int |
deleteDocumentsLocally(String[] documentIDs)
Deletes the listed documents from the local storage |
void |
deleteIndex()
Deletes the entire index with all it's inserted rowsets. |
long |
getCommittedFileSize()
Returns the size of the committed files |
long |
getIndexFileSize()
Shows the current file size of the index |
long |
getUnCommittedFileSize()
Returns the size of the uncommitted files |
int |
insertRowSet(String rowsetXML)
Inserts rowset of supported a supported indexType. |
int |
mergeDeletionFile(File deletionFile)
Deletes the documents from the file from the index |
int |
mergeIndex(File inputIndex)
Merges the named index into the open index |
void |
openIndex(String indexName)
Opens the index for insertion of rowsets |
void |
setIndexType(FullTextIndexType idxType)
Updates the Index' state object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LuceneGenerator(String baseIndexDir,
String deletionDir)
baseIndexDir - -
The base directory for Index directories.deletionDir - -
The directory in which to store deletion files.| Method Detail |
|---|
public void createIndex(String indexName,
FullTextIndexType idxType,
boolean forceCreate)
throws IndexException
createIndex in interface IndexGeneratorindexName - -
name of the indexidxType - -
the IndexType of the index to create
IndexException - -
an error creating the index to create
public void openIndex(String indexName)
throws IndexException
openIndex in interface IndexGeneratorindexName - name of the index
IndexException - -
an error opening the index
public void setIndexType(FullTextIndexType idxType)
throws IndexException
setIndexType in interface IndexGeneratorIndexException - -
an error setting the indexType
public long getIndexFileSize()
throws IndexException
getIndexFileSize in interface IndexGeneratorIndexException - -
an error deleting documents
public void abort()
throws IndexException
commit()
abort in interface IndexGeneratorIndexException - -
an error aborting
public void commit()
throws IndexException
commit in interface IndexGeneratorIndexException - -
an error committing
public long getCommittedFileSize()
throws IndexException
getCommittedFileSize in interface IndexGeneratorIndexException - -
an error getting the fileSize
public long getUnCommittedFileSize()
throws IndexException
getUnCommittedFileSize in interface IndexGeneratorIndexException - -
an error getting the fileSize
public int mergeIndex(File inputIndex)
throws IndexException
mergeIndex in interface IndexGeneratorIndexException - -
an merging the index
public int mergeDeletionFile(File deletionFile)
throws IndexException
mergeDeletionFile in interface IndexGeneratordeletionFile - a file identifying the documents to delete
IndexException - -
an error merging the deletion file
public void closeIndex()
throws IndexException
closeIndex in interface IndexGeneratorIndexException - -
an error closing the Indexpublic void close()
close in interface IndexGenerator
public void deleteIndex()
throws IndexException
Warning: there is no undelete method.
deleteIndex in interface IndexGeneratorIndexException - -
an error deleting documents
public File deleteDocuments(String[] documentIDs)
throws IndexException
deleteDocuments in interface IndexGeneratordocumentIDs - -
an array of the IDs of the documents to delete
IndexException - -
an error deleting documents
public int deleteDocumentsLocally(String[] documentIDs)
throws IndexException
deleteDocumentsLocally in interface IndexGeneratordocumentIDs - -
an array of the IDs of the documents to delete
IndexException - -
an error deleting documents
public int insertRowSet(String rowsetXML)
throws IndexException
insertRowSet in interface IndexGeneratorrowsetXML - xml that contain data to insert
IndexException - -
an error inserting the ROWSET
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||