Package org.apache.lucene.monitor
Class MonitorConfiguration
java.lang.Object
org.apache.lucene.monitor.MonitorConfiguration
Encapsulates various configuration settings for a Monitor's query index
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected IndexWriterConfig
long
int
boolean
setDirectoryProvider
(IOSupplier<Directory> directoryProvider, MonitorQuerySerializer serializer) setDirectoryProvider
(IOSupplier<Directory> directoryProvider, MonitorQuerySerializer serializer, Boolean readOnly) Sets a custom directory, with a custom serializer.setIndexPath
(Path indexPath, MonitorQuerySerializer serializer) setPurgeFrequency
(long frequency, TimeUnit units) Set the frequency with with the Monitor's querycache will be garbage-collectedsetQueryDecomposer
(QueryDecomposer queryDecomposer) Set the QueryDecomposer to be used by the MonitorsetQueryUpdateBufferSize
(int size) Set how many queries will be buffered in memory before being committed to the queryindex
-
Constructor Details
-
MonitorConfiguration
public MonitorConfiguration()
-
-
Method Details
-
isReadOnly
public boolean isReadOnly() -
getDirectoryProvider
-
setDirectoryProvider
public MonitorConfiguration setDirectoryProvider(IOSupplier<Directory> directoryProvider, MonitorQuerySerializer serializer, Boolean readOnly) Sets a custom directory, with a custom serializer.You have also the chance to configure the Monitor as read-only.
- Parameters:
directoryProvider
- lambda to provide the index Directory implementationserializer
- the serializer used to store the queriesreadOnly
- set the monitor as read-only- Returns:
- MonitorCOnfiguration
-
setDirectoryProvider
public MonitorConfiguration setDirectoryProvider(IOSupplier<Directory> directoryProvider, MonitorQuerySerializer serializer) -
setIndexPath
-
buildIndexWriter
- Throws:
IOException
-
getIndexWriterConfig
-
getQuerySerializer
-
setQueryDecomposer
Set the QueryDecomposer to be used by the Monitor- Parameters:
queryDecomposer
- the QueryDecomposer to be used by the Monitor- Returns:
- the current configuration
-
getQueryDecomposer
- Returns:
- the QueryDecomposer used by the Monitor
-
setPurgeFrequency
Set the frequency with with the Monitor's querycache will be garbage-collected- Parameters:
frequency
- the frequency valueunits
- the frequency units- Returns:
- the current configuration
-
getPurgeFrequency
public long getPurgeFrequency()- Returns:
- the value of Monitor's querycache garbage-collection frequency
-
getPurgeFrequencyUnits
- Returns:
- Get the units of the Monitor's querycache garbage-collection frequency
-
setQueryUpdateBufferSize
Set how many queries will be buffered in memory before being committed to the queryindex- Parameters:
size
- how many queries will be buffered in memory before being committed to the queryindex- Returns:
- the current configuration
-
getQueryUpdateBufferSize
public int getQueryUpdateBufferSize()- Returns:
- the size of the queryindex's in-memory buffer
-