/** * Indicates whether the data retrieved from this index has been * UTF8-encoded. * * @return {@code true} if the retrieved data is in UTF8, {@code false} if * not. */ public boolean getAssureUTF8() { return getBoolean("assureUTF8"); }
/** * Returns the minimum time attribute for this index. * * @return The minimum time attribute, or {@code null} if not specified. */ public Date getMinTime() { return getDate("minTime", null); }
/** * 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. * * @return The maximum number of warm buckets. */ public int getMaxWarmDBCount() { return getInteger("maxWarmDBCount"); }
saved.put("maxTotalDataSizeMB", getMaxTotalDataSizeMB()); saved.put("frozenTimePeriodInSecs", getFrozenTimePeriodInSecs()); try { Args reset = new Args(); reset.put("maxTotalDataSizeMB", "1"); reset.put("frozenTimePeriodInSecs", "1"); update(reset); rollHotBuckets(); if (this.getTotalEventCount() == 0) { return this; refresh(); update(saved);
/** * Returns the absolute path to both hot and warm buckets for this index. * This value may contain shell expansion terms. * * @return This index's absolute path to both hot and warm buckets, or * {@code null} if not specified. */ public String getHomePath() { return getString("homePath", null); }
/** * Submits an event to this index through an HTTP POST request. * * @param data The event data to post. */ public void submit(String data) { Receiver receiver = service.getReceiver(); receiver.submit(getName(), data); }
/** * Writes events to this index, reusing the connection. * This method passes an output stream connected to the index to the * {@code run} method of the {@code ReceiverBehavior} object, then handles * setting up and tearing down the socket. * <p> * For an example of how to use this method, see * <a href="http://dev.splunk.com/view/SP-CAAAEJ2" target="_blank">How to * get data into Splunk</a> on * <a href="http://dev.splunk.com/view/SP-CAAAEJ2" * target="_blank">dev.splunk.com</a>. * * @param behavior The body of a {@code try} block as an anonymous * implementation of the {@code ReceiverBehavior} interface. */ public void attachWith(ReceiverBehavior behavior) throws IOException { Socket socket = null; OutputStream output = null; try { socket = attach(); output = socket.getOutputStream(); behavior.run(output); output.flush(); } finally { if (output != null) { output.close(); } if (socket != null) { socket.close(); } } }
/** * Returns the expanded absolute path to both hot and warm buckets for this * index. * * @return The expanded absolute path to both hot and warm buckets, or * {@code null} if not specified. */ public String getHomePathExpanded() { return getString("homePath_expanded", null); }
/** * Submits an event to this index through an HTTP POST request. * * @param args Optional arguments for this request. Valid parameters are: * "host", "host_regex", "source", and "sourcetype". * @param data The event data to post. */ public void submit(Args args, String data) { Receiver receiver = service.getReceiver(); receiver.submit(getName(), args, data); }
/** * 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. * * @return The hot bucket's maximum lifetime, in seconds. */ public int getMaxHotIdleSecs() { return getInteger("maxHotIdleSecs"); }
/** * Returns the index thread for this index. * * @return The index thread. */ public String getIndexThreads() { return getString("indexThreads"); }
/** * Creates a writable socket to this index. * * @return The writable socket. * @throws IOException */ public Socket attach() throws IOException { Receiver receiver = service.getReceiver(); return receiver.attach(getName()); }
/** * Indicates whether raw data is compressed. * * @deprecated Splunk always compresses raw data. * @return {@code true} if raw data is compressed, {@code false} if not. */ public boolean getCompressRawdata() { return getBoolean("compressRawdata"); }
/** * Returns the maximum time attribute for this index. * * @return The maximum time attribute, or {@code null} if not specified. */ public Date getMaxTime() { return getDate("maxTime", null); }
/** * Returns the upper bound of the target maximum timespan of * hot and warm buckets for this index. * * @return The upper bound of the target maximum timespan, in seconds. */ public int getMaxHotSpanSecs() { return getInteger("maxHotSpanSecs"); }
/** * Returns the absolute path to the thawed index for this index. This value * may contain shell expansion terms. * * @return The absolute path to the thawed index, or {@code null} if not * specified. */ public String getThawedPath() { return getString("thawedPath", null); }
/** * Creates a writable socket to this index. * * @param args Optional arguments for this stream. Valid parameters are: * "host", "host_regex", "source", and "sourcetype". * @return The socket. * @throws IOException */ public Socket attach(Args args) throws IOException { Receiver receiver = service.getReceiver(); return receiver.attach(getName(), args); }
/** * Indicates whether the sync operation is called before the file * descriptor is closed on metadata updates. * * @return {@code true} if the sync operation is called before the file * descriptor is closed on metadata updates, {@code false} if not. */ public boolean getSyncMeta() { return getBoolean("syncMeta"); }
/** * Returns the amount of memory to allocate for buffering * a single .tsidx file into memory before flushing to disk. * * @return The amount of memory, in MB. */ public int getMaxMemMB() { return getInteger("maxMemMB"); }
/** * Returns the frozen archive destination path for this index. * * @return The frozen archive destination path, or {@code null} if not * specified. */ public String getColdToFrozenDir() { return getString("coldToFrozenDir", null); }