Public Member Functions | |
void | close () |
void | setExpectedNumberOfRecords (long numberOfRecords) |
Properties | index () |
Static Public Member Functions | |
static< VextendsValue > Indexer< V > | open (Class< V > clazz, Configuration config) |
Protected Member Functions | |
void | finalize () throws Throwable |
Static Package Functions | |
[static initializer] | |
Private Member Functions | |
Indexer (Pointer nativeIndexer) |
A class to build an inverted index programmatically from a number of records. The created index is static and read-only.
Definition at line 23 of file Indexer.java.
de::aitools::aq::invertedindex::core::Indexer< V extends Value >::Indexer | ( | Pointer | nativeIndexer | ) | [inline, private] |
Initializes this instance with an JNA Pointer, that refers to the native equivalent.
nativeIndexer | a pointer to the native indexer |
Definition at line 69 of file Indexer.java.
de::aitools::aq::invertedindex::core::Indexer< V extends Value >::[static initializer] | ( | ) | [inline, static, package] |
void de::aitools::aq::invertedindex::core::Indexer< V extends Value >::close | ( | ) | [inline] |
Closes and deletes the native index. This method is redundant to a successful call of index(), which even closes the index. However, you can use this method in some cleanup code, if your code interrupts abnormally during the put(Record) phase.
Definition at line 80 of file Indexer.java.
void de::aitools::aq::invertedindex::core::Indexer< V extends Value >::finalize | ( | ) | throws Throwable [inline, protected] |
Definition at line 103 of file Indexer.java.
Properties de::aitools::aq::invertedindex::core::Indexer< V extends Value >::index | ( | ) | [inline] |
Starts the final indexing process. This method has to be called at the very end of a sequence of put(Record) or put(String, Value) requests. Afterwards the native indexer will be closed and deleted automatically, and is not usable any longer.
Please note, depending of the number of inserted records this method can take a while, so be patient and enjoy the console output ...
Definition at line 123 of file Indexer.java.
References de::aitools::aq::invertedindex::core::Properties::impl.
static <VextendsValue> Indexer<V> de::aitools::aq::invertedindex::core::Indexer< V extends Value >::open | ( | Class< V > | clazz, | |
Configuration | config | |||
) | [inline, static] |
Instantiates a new writable inverted index in a dedicated directory, that can be filled programmatically with a (huge) number of records.
Please read the documentation to setup the Configuration object properly. In contrast to ManagedIndexer this indexing method provides Unicode support and allows whitespaces (no tabs) in key and value strings.
The configuration parameter required for this job are:
<V> | the value type parameter | |
clazz | the class object of the value type | |
config | the indexing job configuration |
Definition at line 54 of file Indexer.java.
References de::aitools::aq::invertedindex::core::Configuration::impl.
void de::aitools::aq::invertedindex::core::Indexer< V extends Value >::setExpectedNumberOfRecords | ( | long | numberOfRecords | ) | [inline] |
A tuning method to indicate the expected number of records to be inserted to the indexer. Estimating such upper bound in an early stage of put(Record) or put(String, Value) requests can increase the indexing performance dramatically.
Note that this value is only a hint and works only if KeySorting#UNSORTED is used. A wrong estimation definitely has no negative impact to the indexing behavior.
numberOfRecords | some upper bound of records to be inserted |
Definition at line 98 of file Indexer.java.