Package org.rrd4j.core
Class FetchRequest
java.lang.Object
org.rrd4j.core.FetchRequest
public class FetchRequest extends Object
Class to represent fetch request. For the complete explanation of all
fetch parameters consult RRDTool's
rrdfetch man page.
You cannot create FetchRequest
directly (no public constructor
is provided). Use createFetchRequest()
method of your RrdDb
object.
- Author:
- Sasa Markovic
-
Constructor Summary
Constructors Constructor Description FetchRequest(RrdDb parentDb, ConsolFun consolFun, long fetchStart, long fetchEnd, long resolution)
-
Method Summary
Modifier and Type Method Description String
dump()
Dumps the content of fetch request using the syntax of RRDTool's fetch command.FetchData
fetchData()
Returns data from the underlying RRD and puts it in a singleFetchData
object.ConsolFun
getConsolFun()
Returns consolidation function to be used during the fetch process.long
getFetchEnd()
Returns ending timestamp to be used for the fetch request.long
getFetchStart()
Returns starting timestamp to be used for the fetch request.String[]
getFilter()
Returns request filter.RrdDb
getParentDb()
Returns the underlying RrdDb object.long
getResolution()
Returns fetch resolution to be used for the fetch request.(package private) String
getRrdToolCommand()
void
setFilter(String filter)
Sets request filter in order to fetch data only for a single datasource (datasource name).void
setFilter(String... filter)
Sets request filter in order to fetch data only for the specified array of datasources (datasource names).void
setFilter(Set<String> filter)
Sets request filter in order to fetch data only for the specified set of datasources (datasource names).
-
Constructor Details
-
Method Details
-
setFilter
Sets request filter in order to fetch data only for the specified array of datasources (datasource names). If not set (or set to null), fetched data will contain values of all datasources defined in the corresponding RRD. To fetch data only from selected datasources, specify an array of datasource names as method argument.- Parameters:
filter
- Array of datasources (datasource names) to fetch data from.
-
setFilter
Sets request filter in order to fetch data only for the specified set of datasources (datasource names). If the filter is not set (or set to null), fetched data will contain values of all datasources defined in the corresponding RRD. To fetch data only from selected datasources, specify a set of datasource names as method argument.- Parameters:
filter
- Set of datasource names to fetch data for.
-
setFilter
Sets request filter in order to fetch data only for a single datasource (datasource name). If not set (or set to null), fetched data will contain values of all datasources defined in the corresponding RRD. To fetch data for a single datasource only, specify an array of datasource names as method argument.- Parameters:
filter
- A single datasource (datasource name) to fetch data from.
-
getFilter
Returns request filter. SeesetFilter()
for complete explanation.- Returns:
- Request filter (array of datasource names), null if not set.
-
getConsolFun
Returns consolidation function to be used during the fetch process.- Returns:
- Consolidation function.
-
getFetchStart
public long getFetchStart()Returns starting timestamp to be used for the fetch request.- Returns:
- Starting timestamp in seconds.
-
getFetchEnd
public long getFetchEnd()Returns ending timestamp to be used for the fetch request.- Returns:
- Ending timestamp in seconds.
-
getResolution
public long getResolution()Returns fetch resolution to be used for the fetch request.- Returns:
- Fetch resolution in seconds.
-
dump
Dumps the content of fetch request using the syntax of RRDTool's fetch command.- Returns:
- Fetch request dump.
-
getRrdToolCommand
String getRrdToolCommand() -
fetchData
Returns data from the underlying RRD and puts it in a singleFetchData
object.- Returns:
- FetchData object filled with timestamps and datasource values.
- Throws:
IOException
- Thrown in case of I/O error.
-
getParentDb
Returns the underlying RrdDb object.- Returns:
- RrdDb object used to create this FetchRequest object.
-