SMILA (incubation) API documentation

org.eclipse.smila.lucene
Class LuceneIndexService

java.lang.Object
  extended by org.eclipse.smila.lucene.LuceneServie
      extended by org.eclipse.smila.lucene.LuceneIndexService
All Implemented Interfaces:
ProcessingService

public class LuceneIndexService
extends LuceneServie
implements ProcessingService

Lucene Index Service.


Nested Class Summary
static class LuceneIndexService.ExecutionMode
          Types of errors this pipelet can produce.
 
Field Summary
static java.lang.String ALLOW_DOUBLETS
          name of annotation configuring if doublets are allowed in index.
static java.lang.String EXECUTION_MODE
          name of annotation configuring the mode of execution.
static java.lang.String PROPERTY_FORCE_UNLOCK_INDEX
          Configuration property if to force to unlock a locked index on service activation.
static java.lang.String PROPERTY_TEMPORARY_INDEX_DIR
          Configuration property for the index directory - if true, it will be generated and PROPERTY_INDEX_DIR will be ignored.
 
Fields inherited from class org.eclipse.smila.lucene.LuceneServie
BUNDLE_NAME, CONFIG_FILE_MAPPINGS, ID_FIELD, INDEX_NAME
 
Fields inherited from interface org.eclipse.smila.processing.ProcessingService
PROPERTY_NAME
 
Constructor Summary
LuceneIndexService()
           
 
Method Summary
protected  void activate(ComponentContext context)
          DS activate method.
 void createIndex(java.lang.String indexName)
          Creates the index.
protected  void deactivate(ComponentContext context)
          DS deactivate method.
 void deleteIndex(java.lang.String indexName)
          Delete index.
 void flushIndex(java.lang.String indexName)
          Flushes the index with the given name.
 java.util.Iterator<java.lang.String> getIndexNames()
          Returns the names of all available indexes.
 boolean isIndexExists(java.lang.String indexName)
          Checks if is index exists.
 Id[] process(Blackboard blackboard, Id[] recordIds)
          process records on Blackboard service.
 void removeWriteLock(java.lang.String indexName)
          Removes the write.lock of the Lucene index if any exists.
 void renameIndex(java.lang.String indexName, java.lang.String newIndexName)
          Rename index.
 void reorganizeIndex(java.lang.String indexName)
          Reorganize index.
 
Methods inherited from class org.eclipse.smila.lucene.LuceneServie
getMappings, loadMappings, unloadMappings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_TEMPORARY_INDEX_DIR

public static final java.lang.String PROPERTY_TEMPORARY_INDEX_DIR
Configuration property for the index directory - if true, it will be generated and PROPERTY_INDEX_DIR will be ignored.

See Also:
Constant Field Values

PROPERTY_FORCE_UNLOCK_INDEX

public static final java.lang.String PROPERTY_FORCE_UNLOCK_INDEX
Configuration property if to force to unlock a locked index on service activation. Unlocking may corrupt an existing index. This option is useful for tests. If not set the default is false.

See Also:
Constant Field Values

ALLOW_DOUBLETS

public static final java.lang.String ALLOW_DOUBLETS
name of annotation configuring if doublets are allowed in index.

See Also:
Constant Field Values

EXECUTION_MODE

public static final java.lang.String EXECUTION_MODE
name of annotation configuring the mode of execution.

See Also:
Constant Field Values
Constructor Detail

LuceneIndexService

public LuceneIndexService()
Method Detail

activate

protected void activate(ComponentContext context)
                 throws java.lang.Exception
DS activate method.

Parameters:
context - ComponentContext
Throws:
java.lang.Exception - if any error occurs

deactivate

protected void deactivate(ComponentContext context)
                   throws java.lang.Exception
DS deactivate method.

Parameters:
context - the ComponentContext
Throws:
java.lang.Exception - if any error occurs

process

public Id[] process(Blackboard blackboard,
                    Id[] recordIds)
             throws ProcessingException
process records on Blackboard service.

Specified by:
process in interface ProcessingService
Parameters:
blackboard - Blackboard service managing the records.
recordIds - Ids of records to process.
Returns:
Ids of result records.
Throws:
ProcessingException - error during processing.
See Also:
ProcessingService.process(Blackboard, Id[])

isIndexExists

public boolean isIndexExists(java.lang.String indexName)
                      throws IndexException
Checks if is index exists.

Parameters:
indexName - the index name
Returns:
true, if is index exists
Throws:
IndexException - the index exception

reorganizeIndex

public void reorganizeIndex(java.lang.String indexName)
                     throws IndexException
Reorganize index.

Parameters:
indexName - the index name
Throws:
IndexException - the index exception

createIndex

public void createIndex(java.lang.String indexName)
                 throws IndexException
Creates the index.

Parameters:
indexName - the index name
Throws:
IndexException - the index exception

deleteIndex

public void deleteIndex(java.lang.String indexName)
                 throws IndexException
Delete index.

Parameters:
indexName - the index name
Throws:
IndexException - the index exception

renameIndex

public void renameIndex(java.lang.String indexName,
                        java.lang.String newIndexName)
                 throws IndexException
Rename index.

Parameters:
indexName - the index name
newIndexName - the new index name
Throws:
IndexException - the index exception

getIndexNames

public java.util.Iterator<java.lang.String> getIndexNames()
Returns the names of all available indexes.

Returns:
an iterator over index names

flushIndex

public void flushIndex(java.lang.String indexName)
                throws IndexException
Flushes the index with the given name.

Parameters:
indexName - name of the index to flush
Throws:
IndexException - if any error occurs

removeWriteLock

public void removeWriteLock(java.lang.String indexName)
                     throws IndexException
Removes the write.lock of the Lucene index if any exists.

Parameters:
indexName - the name of the index to remove the lock
Throws:
IndexException - if any error occurs

SMILA (incubation) API documentation