public class NullRrdStrategy extends Object implements RrdStrategy<Object,Object>
RrdStrategy
implementation that does nothing.
Used in cases where an instance of RrdStrategy
is required
but no implementations are available.Constructor and Description |
---|
NullRrdStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
closeFile(Object rrd)
This closes the supplied round robin database
|
Object |
createDefinition(String creator,
String directory,
String rrdName,
int step,
List<RrdDataSource> dataSources,
List<String> rraList)
Create a round robin database definition from the supplied parameters.
|
void |
createFile(Object rrdDef,
Map<String,String> attrMapping)
Creates the round robin database defined by the supplied definition.
|
InputStream |
createGraph(String command,
File workDir)
Creates an InputStream representing the bytes of a graph created from
round robin data.
|
RrdGraphDetails |
createGraphReturnDetails(String command,
File workDir)
Creates an RrdGraphDetails object representing the graph created from
round robin data.
|
Double |
fetchLastValue(String rrdFile,
String ds,
int interval)
Fetches the last value from the round robin database with the given name.
|
Double |
fetchLastValue(String rrdFile,
String ds,
String consolidationFunction,
int interval)
Fetches the last value from the round robin database with the given name.
|
Double |
fetchLastValueInRange(String rrdFile,
String ds,
int interval,
int range)
Fetches the last value from the round robin database with the given name
within a time range.
|
String |
getDefaultFileExtension()
Get the file extension appropriate for files of this type
|
int |
getGraphLeftOffset()
Returns the number of pixels that the leftt-hand side of the graph is
offset from the left side of the created image.
|
int |
getGraphRightOffset()
Returns the number of pixels that the right-hand side of the graph is
offset from the right side of the created image.
|
int |
getGraphTopOffsetWithText()
Returns the number of pixels that the top of the graph is offset from
the top of the created image if there is single line of header text.
|
String |
getStats()
Provides the round robin database an opportunity to contribute statistics
information to the logs file.
|
Object |
openFile(String fileName)
Opens the round robin database with the supplied name.
|
void |
promoteEnqueuedFiles(Collection<String> rrdFiles)
In the event that this is a queuing implementation of the RrdStrategy.
|
void |
setConfigurationProperties(Properties configurationParameters)
setConfigurationProperties
|
void |
updateFile(Object rrd,
String owner,
String data)
Updates the supplied round robin database with the given timestamp:value
point
|
public void setConfigurationProperties(Properties configurationParameters)
RrdStrategy
setConfigurationProperties
setConfigurationProperties
in interface RrdStrategy<Object,Object>
configurationParameters
- a Properties
object.public void closeFile(Object rrd)
RrdStrategy
closeFile
in interface RrdStrategy<Object,Object>
rrd
- an rrd object created using openFilepublic Object createDefinition(String creator, String directory, String rrdName, int step, List<RrdDataSource> dataSources, List<String> rraList)
RrdStrategy
createDefinition
in interface RrdStrategy<Object,Object>
creator
- - A string representing who is creating this file for use in
log msgsdirectory
- - The directory to create the file inrrdName
- - The name to use for the round robin databasestep
- - the step for the databasedataSources
- - the data sources to use for round robin databaserraList
- - a List of the round robin archives to create in the
database. defines after which time the data is condensed to a
defined lower steppublic void createFile(Object rrdDef, Map<String,String> attrMapping)
RrdStrategy
createFile
in interface RrdStrategy<Object,Object>
rrdDef
- an round robin database definition created using the
createDefinition call.attrMapping
- a Map
that represents the mapping of
attributeId to rrd track names. default there is only one
track per datasource, but it is possible to store multiple
tracks in one datasourcepublic InputStream createGraph(String command, File workDir)
RrdStrategy
createGraph
in interface RrdStrategy<Object,Object>
command
- the command needed to create the graphworkDir
- the directory that all referenced files are relative topublic RrdGraphDetails createGraphReturnDetails(String command, File workDir)
RrdStrategy
createGraphReturnDetails
in interface RrdStrategy<Object,Object>
command
- the command needed to create the graphworkDir
- the directory that all referenced files are relative topublic Double fetchLastValue(String rrdFile, String ds, int interval)
RrdStrategy
fetchLastValue
in interface RrdStrategy<Object,Object>
rrdFile
- a name the represents a round robin databaseds
- a name the represents a data source to be usedinterval
- a step interval of the round robin databasepublic Double fetchLastValueInRange(String rrdFile, String ds, int interval, int range)
RrdStrategy
fetchLastValueInRange
in interface RrdStrategy<Object,Object>
rrdFile
- a name the represents a round robin databaseds
- a name the represents a data source to be usedinterval
- a step interval of the round robin databaserange
- an acceptable range for which the last value will be returnedpublic String getStats()
RrdStrategy
getStats
in interface RrdStrategy<Object,Object>
public Object openFile(String fileName)
RrdStrategy
openFile
in interface RrdStrategy<Object,Object>
fileName
- the name of the associated rrd filepublic void updateFile(Object rrd, String owner, String data)
RrdStrategy
updateFile
in interface RrdStrategy<Object,Object>
rrd
- an rrd object created using openFileowner
- the owner of the rrddata
- a string of the form public int getGraphLeftOffset()
RrdStrategy
getGraphLeftOffset
in interface RrdStrategy<Object,Object>
public int getGraphRightOffset()
RrdStrategy
getGraphRightOffset
in interface RrdStrategy<Object,Object>
public int getGraphTopOffsetWithText()
RrdStrategy
getGraphTopOffsetWithText
in interface RrdStrategy<Object,Object>
public String getDefaultFileExtension()
RrdStrategy
getDefaultFileExtension
in interface RrdStrategy<Object,Object>
String
object.public Double fetchLastValue(String rrdFile, String ds, String consolidationFunction, int interval)
RrdStrategy
fetchLastValue
in interface RrdStrategy<Object,Object>
rrdFile
- a name the represents a round robin databaseds
- a name the represents a data source to be usedconsolidationFunction
- a String
object.interval
- a step interval of the round robin databasepublic void promoteEnqueuedFiles(Collection<String> rrdFiles)
RrdStrategy
promoteEnqueuedFiles
in interface RrdStrategy<Object,Object>
rrdFiles
- a Collection
object.Copyright © 2017. All rights reserved.