HCE project C++ developers source code library
1.1.1
HCE project developer library
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
ReducerFunctionalObject.hpp
Go to the documentation of this file.
1
14
#ifndef REDUCERFUNCTIONALOBJECT_HPP_
15
#define REDUCERFUNCTIONALOBJECT_HPP
16
17
#include "
ReducingHandlerBuilder.hpp
"
18
#include "
PocoJSONReducingInputMessageConvertor.hpp
"
19
#include <Poco/SharedPtr.h>
20
21
namespace
HCE{
22
namespace
reduce{
23
24
const
int
OK
= 0;
25
const
int
WRONG_JSON_STRUCT_ERROR
= 1;
26
const
int
NOT_FOUND_ITEM_ID_ERROR
= 2;
27
const
std::string
WRONG_JSON_STRUCT_DESCR
=
"err string"
;
28
const
std::string
NOT_FOUND_ITEM_ID_DESCR
=
"err string2"
;
29
30
class
ReducerFunctionalObject
{
31
public
:
32
ReducerFunctionalObject
();
33
~ReducerFunctionalObject
();
34
35
void
accumulate
(std::string& jsonReducingInputMessage,
unsigned
long
long
itemId);
36
bool
isCompleteTask
(
unsigned
long
long
itemId,
int
nodesCount,
37
unsigned
int
ttl =
USE_TASK_TTL_VALUE
);
38
Poco::SharedPtr<HCE::reduce_types::ReducingOutputMessage>
reduce
(
unsigned
long
long
itemId);
39
40
unsigned
int
getTasksNumber
();
41
int
getErrCode
()
const
;
42
std::string
getErrMsg
()
const
;
43
44
int
cleanupExpiredTasksByTTL
(
unsigned
int
maxRemoveTasks = 1,
45
unsigned
int
ttl =
USE_TASK_TTL_VALUE
);
46
unsigned
int
cleanupExpiredTasksByTTLQueue
(
unsigned
int
maxRemoveItems,
47
unsigned
int
minTerminateTime );
48
void
getExceededTTLTasks
(
unsigned
int
maxTaskNumber,
49
std::vector<unsigned long long>& exceededTTLTasks,
50
unsigned
int
ttl =
USE_TASK_TTL_VALUE
);
51
int
getRejectedMessages
()
const
;
52
53
private
:
54
Poco::SharedPtr<HCE::reduce::ReducingHandler>_reducingHandler;
55
HCE::reduce_convertors::PocoJSONReducingInputMessageConvertor
_pocoJSONReducingInputMessageConvertor;
56
int
errCode;
57
std::string errMsg;
58
int
_rejectedMessages;
59
};
60
61
}
62
}
63
64
#endif
sources
reduceHandler
src
ReducerFunctionalObject.hpp
Generated on Mon Jan 13 2014 13:08:37 for HCE project C++ developers source code library by
1.8.1.2