[cid:2fdbea19-7190-445c-86fe-c21253206e6c]
Hi,
I am trying to implement Apache Edgent in my project but before that I ran
into a problem. The basic objective up till now is to filter the readings of
temperature sensor, but unfortunately I could not understand the error that I
am getting. I have been following the Apache Edgent Documentation but does not
help my queries. The code is as follows:
static double OPTIMAL_TEMP_LOW = 80.0;
static double OPTIMAL_TEMP_HIGH = 85.0;
static Range<Double> optimalTempRange = Ranges.closed(OPTIMAL_TEMP_LOW,
OPTIMAL_TEMP_HIGH);
public static void main(String[] args) throws Exception {
TempSensor sensor = new TempSensor();
DirectProvider dp = new DirectProvider();
Topology topology = dp.newTopology();
TStream<Double> tempReadings = topology.poll(sensor, 1,
TimeUnit.MILLISECONDS).filter(tuple ->
!optimalTempRange.contains(tuple));
tempReadings.sink(tuple -> System.out.println("Temperature is out of range! "
+ "It is " + tuple + "\u00b0F!"));
tempReadings.print();
dp.submit(topology);
}
This program outputs the above figure with no Message. Why is it so?