org.gcube.indexmanagement.common
Interface IndexGenerator

All Known Implementing Classes:
LuceneGenerator

public interface IndexGenerator

Interface for Index Generating Wrapper Classes.


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 indexType, 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 rowset)
          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
 

Method Detail

insertRowSet

int insertRowSet(String rowset)
                 throws IndexException
Inserts rowset of supported a supported indexType.

Parameters:
rowset - xml that contain data to insert
Returns:
number of handled documents
Throws:
IndexException - - an error inserting the ROWSET

deleteDocumentsLocally

int deleteDocumentsLocally(String[] documentIDs)
                           throws IndexException
Deletes the listed documents from the local storage

Parameters:
documentIDs - - an array of the IDs of the documents to delete
Returns:
the number of documents deleted
Throws:
IndexException - - an error deleting documents

deleteDocuments

File deleteDocuments(String[] documentIDs)
                     throws IndexException
Deletes the listed documents both from the local storage and the main index

Parameters:
documentIDs - - an array of the IDs of the documents to delete
Returns:
a new deletionFile
Throws:
IndexException - - an error deleting documents

commit

void commit()
            throws IndexException
Commits inserted rowsets

Throws:
IndexException - - an error committing

abort

void abort()
           throws IndexException
Deletes inserted rowsets since last commit()

Throws:
IndexException - - an error aborting

getCommittedFileSize

long getCommittedFileSize()
                          throws IndexException
Returns the size of the committed files

Throws:
IndexException - - an error getting the fileSize

getUnCommittedFileSize

long getUnCommittedFileSize()
                            throws IndexException
Returns the size of the uncommitted files

Throws:
IndexException - - an error getting the fileSize

createIndex

void createIndex(String indexName,
                 FullTextIndexType indexType,
                 boolean forceCreate)
                 throws IndexException
Creates a new index

Parameters:
indexName - - name of the index
collectionID - - the collectionID of the index to create
indexType - - the IndexType of the index to create
Throws:
IndexException - - an error creating the index to create

deleteIndex

void deleteIndex()
                 throws IndexException
Deletes the entire index with all it's inserted rowsets.

Warning: there is no undelete method.

Throws:
IndexException - - an error deleting documents

openIndex

void openIndex(String indexName)
               throws IndexException
Opens the index for insertion of rowsets

Parameters:
indexName - name of the index
Throws:
IndexException - - an error opening the index

setIndexType

void setIndexType(FullTextIndexType idxType)
                  throws IndexException
Updates the Index' state object

Throws:
IndexException - - an error setting the indexType

getIndexFileSize

long getIndexFileSize()
                      throws IndexException
Shows the current file size of the index

Throws:
IndexException - - an error deleting documents

mergeIndex

int mergeIndex(File inputIndex)
               throws IndexException
Merges the named index into the open index

Parameters:
inputIndexName - name of the input index
Throws:
IndexException - - an merging the index

mergeDeletionFile

int mergeDeletionFile(File deletionFile)
                      throws IndexException
Deletes the documents from the file from the index

Parameters:
deletionFile - a file identifying the documents to delete
Throws:
IndexException - - an error merging the deletion file

closeIndex

void closeIndex()
                throws IndexException
Closes the index committing any uncommitted insertions

Throws:
IndexException - - an error closing the Index

close

void close()
           throws IndexException
Frees any resources used for updating indexes if any.

Throws:
IndexException - - an error closing the IndexGenerator


Copyright © 2012. All Rights Reserved.