public class QueuingRrdStrategy extends Object implements RrdStrategy<QueuingRrdStrategy.CreateOperation,String>, Runnable
| Modifier and Type | Class and Description |
|---|---|
class |
QueuingRrdStrategy.CreateOperation
This class represents an operation to create an rrd file
|
class |
QueuingRrdStrategy.UpdateOperation
Represents an update to a rrd file.
|
class |
QueuingRrdStrategy.ZeroUpdateOperation
Represents an update whose value is 0.
|
| Constructor and Description |
|---|
QueuingRrdStrategy(RrdStrategy<Object,Object> delegate)
Constructor for QueuingRrdStrategy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeFile(String rrd)
closeFile
|
QueuingRrdStrategy.CreateOperation |
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(QueuingRrdStrategy.CreateOperation op)
createFile
|
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 |
getCategory()
getCategory
|
Properties |
getConfigurationProperties()
getConfigurationProperties
|
long |
getCreatesCompleted()
getCreatesCompleted
|
String |
getDefaultFileExtension()
getDefaultFileExtension
|
RrdStrategy<Object,Object> |
getDelegate()
getDelegate
|
long |
getDequeuedItems()
getDequeuedItems
|
long |
getDequeuedOperations()
getDequeuedOperations
|
long |
getEnqueuedOperations()
getEnqueuedOperations
|
long |
getErrors()
getErrors
|
int |
getGraphLeftOffset()
getGraphLeftOffset
|
int |
getGraphRightOffset()
getGraphRightOffset
|
int |
getGraphTopOffsetWithText()
getGraphTopOffsetWithText
|
long |
getInSigHighWaterMark()
getInSigHighWaterMark
|
long |
getMaxInsigUpdateSeconds()
getMaxInsigUpdateSeconds
|
long |
getModulus()
getModulus
|
long |
getPromotionCount()
getPromotionCount
|
long |
getQueueHighWaterMark()
getQueueHighWaterMark
|
long |
getSigHighWaterMark()
getSigHighWaterMark
|
long |
getSignificantOpsCompleted()
getSignificantOpsCompleted
|
long |
getSignificantOpsDequeued()
getSignificantOpsDequeued
|
long |
getSignificantOpsEnqueued()
getSignificantOpsEnqueued
|
long |
getStartTime()
getStartTime
|
String |
getStats()
Print queue statistics.
|
long |
getTotalOperationsPending()
getTotalOperationsPending
|
long |
getUpdatesCompleted()
getUpdatesCompleted
|
long |
getWriteThreadExitDelay()
getWriteThreadExitDelay
|
int |
getWriteThreads()
getWriteThreads
|
long |
getWriteThreadSleepTime()
getWriteThreadSleepTime
|
String |
openFile(String fileName)
Opens the round robin database with the supplied name.
|
boolean |
prioritizeSignificantUpdates()
prioritizeSignificantUpdates
|
void |
promoteEnqueuedFiles(Collection<String> rrdFiles)
In the event that this is a queuing implementation of the RrdStrategy.
|
boolean |
queueCreates()
queueCreates
|
void |
run()
run
|
void |
setCategory(String category)
setCategory
|
void |
setConfigurationProperties(Properties configurationParameters)
setConfigurationProperties
|
void |
setCreatesCompleted(long createsCompleted)
setCreatesCompleted
|
void |
setDequeuedItems(long dequeuedItems)
setDequeuedItems
|
void |
setDequeuedOperations(long dequeuedOperations)
setDequeuedOperations
|
void |
setEnqueuedOperations(long enqueuedOperations)
setEnqueuedOperations
|
void |
setErrors(long errors)
setErrors
|
void |
setInSigHighWaterMark(long inSigHighWaterMark)
setInSigHighWaterMark
|
void |
setMaxInsigUpdateSeconds(long maxInsigUpdateSeconds)
setMaxInsigUpdateSeconds
|
void |
setModulus(long modulus)
setModulus
|
void |
setPrioritizeSignificantUpdates(boolean prioritizeSignificantUpdates)
setPrioritizeSignificantUpdates
|
void |
setPromotionCount(long promotionCount)
setPromotionCount
|
void |
setQueueCreates(boolean queueCreates)
setQueueCreates
|
void |
setQueueHighWaterMark(long queueHighWaterMark)
setQueueHighWaterMark
|
void |
setSigHighWaterMark(long sigHighWaterMark)
setSigHighWaterMark
|
void |
setSignificantOpsCompleted(long significantOpsCompleted)
setSignificantOpsCompleted
|
void |
setSignificantOpsDequeued(long significantOpsDequeued)
setSignificantOpsDequeued
|
void |
setSignificantOpsEnqueued(long significantOpsEnqueued)
setSignificantOpsEnqueued
|
void |
setStartTime(long updateStart)
setStartTime
|
void |
setTotalOperationsPending(long totalOperationsPending)
setTotalOperationsPending
|
void |
setUpdatesCompleted(long updatesCompleted)
setUpdatesCompleted
|
void |
setWriteThreadExitDelay(long writeThreadExitDelay)
setWriteThreadExitDelay
|
void |
setWriteThreads(int writeThreads)
setWriteThreads
|
void |
setWriteThreadSleepTime(long writeThreadSleepTime)
setWriteThreadSleepTime
|
void |
updateFile(String rrdFile,
String owner,
String data)
Updates the supplied round robin database with the given timestamp:value
point
|
public QueuingRrdStrategy(RrdStrategy<Object,Object> delegate)
Constructor for QueuingRrdStrategy.
delegate - a RrdStrategy object.public Properties getConfigurationProperties()
getConfigurationProperties
Properties object.public void setConfigurationProperties(Properties configurationParameters)
setConfigurationProperties
setConfigurationProperties in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>configurationParameters - a Properties object.public int getWriteThreads()
getWriteThreads
public void setWriteThreads(int writeThreads)
setWriteThreads
writeThreads - a int.public boolean queueCreates()
queueCreates
public void setQueueCreates(boolean queueCreates)
setQueueCreates
queueCreates - a boolean.public boolean prioritizeSignificantUpdates()
prioritizeSignificantUpdates
public void setPrioritizeSignificantUpdates(boolean prioritizeSignificantUpdates)
setPrioritizeSignificantUpdates
prioritizeSignificantUpdates - a boolean.public long getInSigHighWaterMark()
getInSigHighWaterMark
public void setInSigHighWaterMark(long inSigHighWaterMark)
setInSigHighWaterMark
inSigHighWaterMark - a long.public long getSigHighWaterMark()
getSigHighWaterMark
public void setSigHighWaterMark(long sigHighWaterMark)
setSigHighWaterMark
sigHighWaterMark - a long.public long getQueueHighWaterMark()
getQueueHighWaterMark
public void setQueueHighWaterMark(long queueHighWaterMark)
setQueueHighWaterMark
queueHighWaterMark - a long.public long getModulus()
getModulus
public void setModulus(long modulus)
setModulus
modulus - a long.public void setCategory(String category)
setCategory
category - a String object.public long getMaxInsigUpdateSeconds()
getMaxInsigUpdateSeconds
public void setMaxInsigUpdateSeconds(long maxInsigUpdateSeconds)
setMaxInsigUpdateSeconds
maxInsigUpdateSeconds - a long.public long getWriteThreadSleepTime()
getWriteThreadSleepTime
public void setWriteThreadSleepTime(long writeThreadSleepTime)
setWriteThreadSleepTime
writeThreadSleepTime - a long.public long getWriteThreadExitDelay()
getWriteThreadExitDelay
public void setWriteThreadExitDelay(long writeThreadExitDelay)
setWriteThreadExitDelay
writeThreadExitDelay - a long.public void promoteEnqueuedFiles(Collection<String> rrdFiles)
promoteEnqueuedFiles in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>rrdFiles - a Collection object.public RrdStrategy<Object,Object> getDelegate()
getDelegate
RrdStrategy object.public void closeFile(String rrd) throws Exception
closeFile
closeFile in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>rrd - a String object.Exception - if any.public QueuingRrdStrategy.CreateOperation createDefinition(String creator, String directory, String rrdName, int step, List<RrdDataSource> dataSources, List<String> rraList) throws Exception
createDefinition in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>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 stepException - If an error occurs while creating the definitionpublic void createFile(QueuingRrdStrategy.CreateOperation op) throws Exception
createFile
createFile in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>op - a Operation object.Exception - if any.public String openFile(String fileName) throws Exception
openFile in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>fileName - the name of the associated rrd fileException - if an error occurs opening the filepublic void updateFile(String rrdFile, String owner, String data) throws Exception
updateFile in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>rrdFile - an rrd object created using openFileowner - the owner of the rrddata - a string of the form Exception - if an error occurs updating the filepublic Double fetchLastValue(String rrdFile, String ds, int interval) throws NumberFormatException, RrdException
fetchLastValue in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>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 databaseNumberFormatException - if any.RrdException - if any.public Double fetchLastValue(String rrdFile, String ds, String consolidationFunction, int interval) throws NumberFormatException, RrdException
fetchLastValue in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>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 databaseNumberFormatException - if any.RrdException - if any.public Double fetchLastValueInRange(String rrdFile, String ds, int interval, int range) throws NumberFormatException, RrdException
fetchLastValueInRange in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>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 returnedNumberFormatException - if any.RrdException - if any.public InputStream createGraph(String command, File workDir) throws IOException, RrdException
createGraph in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>command - the command needed to create the graphworkDir - the directory that all referenced files are relative toIOException - if an IOError occursRrdException - if an RRD error occurspublic String getStats()
getStats in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>String object.public int getGraphLeftOffset()
getGraphLeftOffset
getGraphLeftOffset in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>public int getGraphRightOffset()
getGraphRightOffset
getGraphRightOffset in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>public int getGraphTopOffsetWithText()
getGraphTopOffsetWithText
getGraphTopOffsetWithText in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>public String getDefaultFileExtension()
getDefaultFileExtension
getDefaultFileExtension in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>String object.public RrdGraphDetails createGraphReturnDetails(String command, File workDir) throws IOException, RrdException
createGraphReturnDetails in interface RrdStrategy<QueuingRrdStrategy.CreateOperation,String>command - the command needed to create the graphworkDir - the directory that all referenced files are relative toIOException - if an IOError occursRrdException - if an RRD error occurspublic long getTotalOperationsPending()
getTotalOperationsPending
public void setTotalOperationsPending(long totalOperationsPending)
setTotalOperationsPending
totalOperationsPending - a long.public long getCreatesCompleted()
getCreatesCompleted
public void setCreatesCompleted(long createsCompleted)
setCreatesCompleted
createsCompleted - a long.public long getUpdatesCompleted()
getUpdatesCompleted
public void setUpdatesCompleted(long updatesCompleted)
setUpdatesCompleted
updatesCompleted - a long.public long getErrors()
getErrors
public void setErrors(long errors)
setErrors
errors - a long.public long getPromotionCount()
getPromotionCount
public void setPromotionCount(long promotionCount)
setPromotionCount
promotionCount - a long.public long getSignificantOpsEnqueued()
getSignificantOpsEnqueued
public void setSignificantOpsEnqueued(long significantOpsEnqueued)
setSignificantOpsEnqueued
significantOpsEnqueued - a long.public long getSignificantOpsDequeued()
getSignificantOpsDequeued
public void setSignificantOpsDequeued(long significantOpsDequeued)
setSignificantOpsDequeued
significantOpsDequeued - a long.public long getEnqueuedOperations()
getEnqueuedOperations
public void setEnqueuedOperations(long enqueuedOperations)
setEnqueuedOperations
enqueuedOperations - a long.public long getDequeuedOperations()
getDequeuedOperations
public void setDequeuedOperations(long dequeuedOperations)
setDequeuedOperations
dequeuedOperations - a long.public long getDequeuedItems()
getDequeuedItems
public void setDequeuedItems(long dequeuedItems)
setDequeuedItems
dequeuedItems - a long.public long getSignificantOpsCompleted()
getSignificantOpsCompleted
public void setSignificantOpsCompleted(long significantOpsCompleted)
setSignificantOpsCompleted
significantOpsCompleted - a long.public long getStartTime()
getStartTime
public void setStartTime(long updateStart)
setStartTime
updateStart - a long.Copyright © 2020. All rights reserved.