How to calculate a variable on a backend except RrdFileBackend?

46 views
Skip to first unread message

Daniel

unread,
May 8, 2015, 4:57:18 AM5/8/15
to rrd4j-...@googlegroups.com
Hi.

I have two questions:
1. I've replaced deprecated FetchData.getAggregate(dsName, cFunc) by:

      DataProcessor dataProcessor = new DataProcessor(fetchData.getRequest().getFetchStart(), fetchData.getRequest().getFetchEnd());
      dataProcessor.addDatasource("source", dsName, fetchData);
      dataProcessor.addDatasource("variable", "source", cFunc.getVariable());
      dataProcessor.processData();
      final Variable.Value variable = dataProcessor.getVariable("variable");

Is this correct?

2. I get an exception in case of FetchData is taken on RrdMemoryBackend: 

Caused by: java.lang.RuntimeException: java.io.IOException: The underlying backend has no canonical path 
at org.rrd4j.data.Def.<init>(Def.java:28) 
at org.rrd4j.data.Def.<init>(Def.java:16) 
at org.rrd4j.data.DataProcessor.addDatasource(DataProcessor.java:556) 
... 21 more 
Caused by: java.io.IOException: The underlying backend has no canonical path 
at org.rrd4j.core.RrdDb.getCanonicalPath(RrdDb.java:993) 
at org.rrd4j.data.Def.<init>(Def.java:25) 
... 23 more 

Is there a way to calculate a variable for memory backend?

Fabrice Bacchella

unread,
May 8, 2015, 5:55:11 AM5/8/15
to rrd4j-...@googlegroups.com
Le 8 mai 2015 à 10:57, Daniel <dbas...@gmail.com> a écrit :

Hi.

I have two questions:
1. I've replaced deprecated FetchData.getAggregate(dsName, cFunc) by:

      DataProcessor dataProcessor = new DataProcessor(fetchData.getRequest().getFetchStart(), fetchData.getRequest().getFetchEnd());
      dataProcessor.addDatasource("source", dsName, fetchData);
      dataProcessor.addDatasource("variable", "source", cFunc.getVariable());
      dataProcessor.processData();
      final Variable.Value variable = dataProcessor.getVariable("variable");

Is this correct?

Yes you're right.


2. I get an exception in case of FetchData is taken on RrdMemoryBackend: 

Caused by: java.lang.RuntimeException: java.io.IOException: The underlying backend has no canonical path 
at org.rrd4j.data.Def.<init>(Def.java:28) 
at org.rrd4j.data.Def.<init>(Def.java:16) 
at org.rrd4j.data.DataProcessor.addDatasource(DataProcessor.java:556) 
... 21 more 
Caused by: java.io.IOException: The underlying backend has no canonical path 
at org.rrd4j.core.RrdDb.getCanonicalPath(RrdDb.java:993) 
at org.rrd4j.data.Def.<init>(Def.java:25) 
... 23 more 

Is there a way to calculate a variable for memory backend?

That's a bug (and missing tests). I will correct that.

Daniel

unread,
May 8, 2015, 6:49:16 AM5/8/15
to rrd4j-...@googlegroups.com
Thank you Fabrice,

You doing a great job!

пятница, 8 мая 2015 г., 12:55:11 UTC+3 пользователь Fabrice Bacchella написал:
Reply all
Reply to author
Forward
0 new messages