com.splunk
Class Index

java.lang.Object
  extended by com.splunk.Resource
      extended by com.splunk.Entity
          extended by com.splunk.Index
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>

public class Index
extends Entity

The Index class represents an index.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.splunk.Resource
actions, path, service, title
 
Method Summary
 java.net.Socket attach()
          Creates a writable socket to this index.
 Index clean()
          Cleans this index, removing all events.
 boolean getAssureUTF8()
          Indicates whether the data retrieved from this index has been UTF8-encoded.
 java.lang.String getBlockSignatureDatabase()
          Returns the block signature database for this index.
 int getBlockSignSize()
          Returns the block sign size for this index.
 java.lang.String getColdPath()
          Returns the absolute file path to the cold database for this index.
 java.lang.String getColdPathExpanded()
          Returns the expanded absolute file path to the cold database for this index.
 java.lang.String getColdToFrozenDir()
          Returns the frozen archive destination path for this index.
 java.lang.String getColdToFrozenScript()
           
 boolean getCompressRawdata()
          Deprecated. Splunk always compresses raw data.
 int getCurrentDBSizeMB()
          Returns the current size of this index.
 java.lang.String getDefaultDatabase()
          Return the default index name of the Splunk instance.
 boolean getEnableRealtimeSearch()
          Indicates whether real-time search is enabled for this index.
 int getFrozenTimePeriodInSecs()
          Returns the maximum age for a bucket, after which the data in this index rolls to frozen.
 java.lang.String getHomePath()
          Returns the absolute path to both hot and warm buckets for this index.
 java.lang.String getHomePathExpanded()
          Returns the expanded absolute path to both hot and warm buckets for this index.
 java.lang.String getIndexThreads()
          Returns the index thread for this index.
 java.lang.String getLastInitTime()
          Returns the last initialization time for this index.
 int getMaxConcurrentOptimizes()
          Returns the maximum number of concurrent optimize processes that can run against a hot bucket for this index.
 java.lang.String getMaxDataSize()
          Returns the maximum data size before triggering a roll from hot to warm buckets for this index.
 int getMaxHotBuckets()
          Returns the maximum number of hot buckets that can exist for this index.
 int getMaxHotIdleSecs()
          Returns the maximum lifetime of a hot bucket for this index.
 int getMaxHotSpanSecs()
          Returns the upper bound of the target maximum timespan of hot and warm buckets for this index.
 int getMaxMemMB()
          Returns the amount of memory to allocate for buffering a single tsidx file into memory before flushing to disk.
 int getMaxMetaEntries()
          Returns the maximum number of unique lines that are allowed in a bucket's .data files for this index.
 int getMaxRunningProcessGroups()
          Returns the maximum number of concurrent helper processes for this index.
 java.util.Date getMaxTime()
          Returns the maximum time attribute for this index.
 int getMaxTotalDataSizeMB()
          Returns the maximum size for this index.
 int getMaxWarmDBCount()
          Returns the maximum number of warm buckets for this index.
 java.lang.String getMemPoolMB()
          Returns the memory pool for this index.
 java.lang.String getMinRawFileSyncSecs()
          Returns the frequency at which Splunkd forces a filesystem sync while compressing journal slices for this index.
 java.util.Date getMinTime()
          Returns the minimum time attribute for this index.
 int getPartialServiceMetaPeriod()
          Returns the frequency at which metadata is for partially synced (synced in-place) for this index.
 int getQuarantineFutureSecs()
          Returns the future event-time quarantine for this index.
 int getQuarantinePastSecs()
          Returns the past event-time quarantine for this index.
 int getRawChunkSizeBytes()
          Returns the target uncompressed size of individual raw slices in the rawdata journal for this index.
 int getRotatePeriodInSecs()
          Returns the frequency to check for the need to create a new hot bucket and the need to roll or freeze any warm or cold buckets for this index.
 int getServiceMetaPeriod()
          Returns the frequency at which metadata is synced to disk for this index.
 java.lang.String getSuppressBannerList()
          Returns a list of indexes that suppress "index missing" messages.
 boolean getSync()
          Returns the sync attribute for this index.
 boolean getSyncMeta()
          Indicates whether the sync operation is invoked before the file descriptor is closed on metadata updates.
 java.lang.String getThawedPath()
          Returns the absolute path to the thawed index for this index.
 java.lang.String getThawedPathExpanded()
          Returns the expanded absolute path to the thawed index for this index.
 int getThrottleCheckPeriod()
          Returns the frequency at which Splunk checks for an index throttling condition.
 int getTotalEventCount()
          Returns the total event count for this index.
 boolean isInternal()
          Indicates whether this index is an internal index.
 void rollHotBuckets()
          Performs rolling hot buckets for this index.
 void submit(java.lang.String data)
          Submits an event to this index through an HTTP POST request.
 void upload(java.lang.String filename)
          Uploads a file to this index as an event stream.
 
Methods inherited from class com.splunk.Entity
actionPath, clear, containsKey, containsValue, disable, enable, entrySet, get, getMetadata, isDisabled, isEmpty, keySet, put, putAll, refresh, reload, remove, remove, size, update, validate, values
 
Methods inherited from class com.splunk.Resource
getActions, getName, getPath, getService, getTitle, invalidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

attach

public java.net.Socket attach()
                       throws java.io.IOException
Creates a writable socket to this index.

Returns:
The writable socket.
Throws:
java.io.IOException

clean

public Index clean()
Cleans this index, removing all events.

Returns:
This index.

getAssureUTF8

public boolean getAssureUTF8()
Indicates whether the data retrieved from this index has been UTF8-encoded.

Returns:
true if the retrieved data is in UTF8, false if not.

getBlockSignatureDatabase

public java.lang.String getBlockSignatureDatabase()
Returns the block signature database for this index.

Returns:
The block signature database.

getBlockSignSize

public int getBlockSignSize()
Returns the block sign size for this index. This value defines the number of events that make up a block for block signatures. A value of 0 means block signing is disabled.

Returns:
The block sign size.

getColdPath

public java.lang.String getColdPath()
Returns the absolute file path to the cold database for this index. This value may contain shell expansion terms.

Returns:
The colddbs's absolute file path, or null if not specified.

getColdPathExpanded

public java.lang.String getColdPathExpanded()
Returns the expanded absolute file path to the cold database for this index.

Returns:
The colddbs's expanded absolute file path, or null if not specified.

getColdToFrozenDir

public java.lang.String getColdToFrozenDir()
Returns the frozen archive destination path for this index.

Returns:
The frozen archive destination path, or null if not specified.

getColdToFrozenScript

public java.lang.String getColdToFrozenScript()
Returns:
The archiving script, or null if not specified.
See Also:
Attributes for the "data/indexes" endpoint in the REST API documentation

getCompressRawdata

public boolean getCompressRawdata()
Deprecated. Splunk always compresses raw data.

Indicates whether raw data is compressed.

Returns:
true if raw data is compressed, false if not.

getCurrentDBSizeMB

public int getCurrentDBSizeMB()
Returns the current size of this index.

Returns:
The current size of the index, in MB.

getDefaultDatabase

public java.lang.String getDefaultDatabase()
Return the default index name of the Splunk instance.

Returns:
The default index name.

getEnableRealtimeSearch

public boolean getEnableRealtimeSearch()
Indicates whether real-time search is enabled for this index.

Returns:
true if real-time search is enabled, false if not.

getFrozenTimePeriodInSecs

public int getFrozenTimePeriodInSecs()
Returns the maximum age for a bucket, after which the data in this index rolls to frozen. If archiving is necessary for frozen data, see the coldToFrozen attributes.

Returns:
The maximum age, in seconds, after which data rolls to frozen.

getHomePath

public java.lang.String getHomePath()
Returns the absolute path to both hot and warm buckets for this index. This value may contain shell expansion terms.

Returns:
This index's absolute path to both hot and warm buckets, or null if not specified.

getHomePathExpanded

public java.lang.String getHomePathExpanded()
Returns the expanded absolute path to both hot and warm buckets for this index.

Returns:
The expanded absolute path to both hot and warm buckets, or null if not specified.

getIndexThreads

public java.lang.String getIndexThreads()
Returns the index thread for this index.

Returns:
The index thread.

getLastInitTime

public java.lang.String getLastInitTime()
Returns the last initialization time for this index.

Returns:
The last initialization time, or null if not specified.

getMaxConcurrentOptimizes

public int getMaxConcurrentOptimizes()
Returns the maximum number of concurrent optimize processes that can run against a hot bucket for this index.

Returns:
The maximum number of concurrent optimize processes.

getMaxDataSize

public java.lang.String getMaxDataSize()
Returns the maximum data size before triggering a roll from hot to warm buckets for this index.

Returns:
The maximum data size, in MB, or "auto" (which means 750MB), or "auto_high_volume" (which means 10GB on a 64-bit system, or 1GB on a 32-bit system).

getMaxHotBuckets

public int getMaxHotBuckets()
Returns the maximum number of hot buckets that can exist for this index.

Returns:
The maximum number of hot buckets.

getMaxHotIdleSecs

public int getMaxHotIdleSecs()
Returns the maximum lifetime of a hot bucket for this index. If a hot bucket exceeds this value, Splunk rolls it to warm. A value of 0 means an infinite lifetime.

Returns:
The hot bucket's maximum lifetime, in seconds.

getMaxHotSpanSecs

public int getMaxHotSpanSecs()
Returns the upper bound of the target maximum timespan of hot and warm buckets for this index.

Returns:
The upper bound of the target maximum timespan, in seconds.

getMaxMemMB

public int getMaxMemMB()
Returns the amount of memory to allocate for buffering a single tsidx file into memory before flushing to disk.

Returns:
The amount of memory, in MB.

getMaxMetaEntries

public int getMaxMetaEntries()
Returns the maximum number of unique lines that are allowed in a bucket's .data files for this index. A value of 0 means infinite lines.

Returns:
The maximum number of unique lines.

getMaxRunningProcessGroups

public int getMaxRunningProcessGroups()
Returns the maximum number of concurrent helper processes for this index.

Returns:
The maximum number of concurrent helper processes.

getMaxTime

public java.util.Date getMaxTime()
Returns the maximum time attribute for this index.

Returns:
The maximum time attribute, or null if not specified.

getMaxTotalDataSizeMB

public int getMaxTotalDataSizeMB()
Returns the maximum size for this index. If an index grows larger than this value, the oldest data is frozen.

Returns:
The maximum index size, in MB.

getMaxWarmDBCount

public int getMaxWarmDBCount()
Returns the maximum number of warm buckets for this index. If this value is exceeded, the warm buckets with the lowest value for their latest times are moved to cold.

Returns:
The maximum number of warm buckets.

getMemPoolMB

public java.lang.String getMemPoolMB()
Returns the memory pool for this index.

Returns:
The memory pool, in MB or "auto".

getMinRawFileSyncSecs

public java.lang.String getMinRawFileSyncSecs()
Returns the frequency at which Splunkd forces a filesystem sync while compressing journal slices for this index. A value of "disable" disables this feature completely, while a value of 0 forces a file-system sync after completing compression of every journal slice.

Returns:
The file-system sync frequency, as an integer or "disable".

getMinTime

public java.util.Date getMinTime()
Returns the minimum time attribute for this index.

Returns:
The minimum time attribute, or null if not specified.

getPartialServiceMetaPeriod

public int getPartialServiceMetaPeriod()
Returns the frequency at which metadata is for partially synced (synced in-place) for this index. A value of 0 disables partial syncing, so metadata is only synced on the ServiceMetaPeriod interval.

Returns:
The metadata sync interval, in seconds.
See Also:
getServiceMetaPeriod

getQuarantineFutureSecs

public int getQuarantineFutureSecs()
Returns the future event-time quarantine for this index. Events that are newer than now plus this value are quarantined.

Returns:
The future event-time quarantine, in seconds.

getQuarantinePastSecs

public int getQuarantinePastSecs()
Returns the past event-time quarantine for this index. Events that are older than now minus this value are quarantined.

Returns:
The past event-time quarantine, in seconds.

getRawChunkSizeBytes

public int getRawChunkSizeBytes()
Returns the target uncompressed size of individual raw slices in the rawdata journal for this index.

Returns:
The target uncompressed size, in bytes.

getRotatePeriodInSecs

public int getRotatePeriodInSecs()
Returns the frequency to check for the need to create a new hot bucket and the need to roll or freeze any warm or cold buckets for this index.

Returns:
The check frequency, in seconds.

getServiceMetaPeriod

public int getServiceMetaPeriod()
Returns the frequency at which metadata is synced to disk for this index.

Returns:
The meta data sync frequency, in seconds.

getSuppressBannerList

public java.lang.String getSuppressBannerList()
Returns a list of indexes that suppress "index missing" messages.

Returns:
A comma-separated list of indexes.

getSync

public boolean getSync()
Returns the sync attribute for this index.

Returns:
The sync attribute.

getSyncMeta

public boolean getSyncMeta()
Indicates whether the sync operation is invoked before the file descriptor is closed on metadata updates.

Returns:
true if the sync operation is invoked before the file descriptor is closed on metadata updates, false if not.

getThawedPath

public java.lang.String getThawedPath()
Returns the absolute path to the thawed index for this index. This value may contain shell expansion terms.

Returns:
The absolute path to the thawed index, or null if not specified.

getThawedPathExpanded

public java.lang.String getThawedPathExpanded()
Returns the expanded absolute path to the thawed index for this index.

Returns:
The expanded absolute path to the thawed index, or null if not specified.

getThrottleCheckPeriod

public int getThrottleCheckPeriod()
Returns the frequency at which Splunk checks for an index throttling condition.

Returns:
The frequency of the throttling check, in seconds.

getTotalEventCount

public int getTotalEventCount()
Returns the total event count for this index.

Returns:
The total event count.

isInternal

public boolean isInternal()
Indicates whether this index is an internal index.

Returns:
true if this index is an internal index, false if not.

rollHotBuckets

public void rollHotBuckets()
Performs rolling hot buckets for this index.


submit

public void submit(java.lang.String data)
Submits an event to this index through an HTTP POST request.

Parameters:
data - The event data that was posted.

upload

public void upload(java.lang.String filename)
Uploads a file to this index as an event stream.
Note: This file must be directly accessible by the Splunk server.

Parameters:
filename - The uploaded file.