query.h 1.05 KB
Newer Older
Axel Auweter's avatar
Axel Auweter committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * query.cpp
 *
 *  Created on: Feb 20, 2015
 *      Author: Axel Auweter
 */

#include <list>
#include <string>

#include "dcdb/timestamp.h"
#include "dcdb/sensordatastore.h"
#include "cassandra.h"


#ifndef QUERY_H
#define QUERY_H

/* FIXME: Most of this logic should go into DCDBLib */
class DCDBQuery
{
public:
23
  static void doQuery(const char* hostname, std::list<std::string> sensors, DCDBTimeStamp start, DCDBTimeStamp end, bool raw);
Axel Auweter's avatar
Axel Auweter committed
24
25

protected:
26
27
  static void lookupPublishedSensorPattern(CassSession* session, std::string name, std::string& pattern);
  static void expandSensorPattern(CassSession* session, std::string sensorPattern, DCDBTimeStamp start, DCDBTimeStamp end, std::list<SensorId>& sensorIds);
28
29
30
  static bool topicToSid(SensorId& sid, std::string topic);
  static std::string sidConvert(SensorId& sid);
  static bool sidPatternMatch(SensorId& sid, std::string pattern);
31
  static void querySensorsCSV(CassSession* session, std::string sensorName, std::list<SensorId>& sidList, DCDBTimeStamp& start, DCDBTimeStamp& end, bool raw);
Axel Auweter's avatar
Axel Auweter committed
32
33
34
35
};


#endif /* QUERY_H */