Faster  0.0.4Alpha
Superfastdistributtedcomputing
workerFddGroup.h
1 #ifndef LIBFASTER_WORKERFDDGROUP_H
2 #define LIBFASTER_WORKERFDDGROUP_H
3 
4 #include <vector>
5 #include <string>
6 
7 #include "workerFddBase.h"
8 
9 namespace faster{
10 
11  template <typename K>
12  class workerFddGroup : public workerFddBase{
13  private:
14  std::vector<workerFddBase*> members;
15  std::vector<K> uKeys;
16 
17  /*template <typename T0, typename T1, typename T2>
18  void decodeLast(void * func, fddOpType op, workerFddBase * dest, fastCommBuffer & buffer);
19  template <typename T0, typename T1>
20  inline void decodeThird(void * func, fddOpType op, workerFddBase * dest, fastCommBuffer & buffer);
21  template <typename T0>
22  inline void decodeSecond(void * func, fddOpType op, workerFddBase * dest, fastCommBuffer & buffer);// */
23 
24  std::vector< std::vector<void*>> findKeyInterval(size_t i);
25  std::vector< std::vector<void*> > * getMemberKeyLocations(size_t i);
26 
27 
28  //template <typename U, typename T0, typename T1, typename T2>
29  template <typename U>
30  void _apply(void * func, fddOpType op, workerFddBase * dest);
31  //template <typename L, typename U, typename T0, typename T1, typename T2>
32  template <typename L, typename U>
33  void _applyI(void * func, fddOpType op, workerFddBase * dest);
34 
35  //template <typename T0, typename T1, typename T2>
36  void _applyReduce(void * func, fddOpType op, fastCommBuffer & buffer);
37 
38  //template <typename T0, typename T1, typename T2>
39  void _preApply(void * func, fddOpType op, workerFddBase * dest);
40  //template <typename L, typename T0, typename T1, typename T2>
41  template <typename L>
42  void _preApplyI(void * func, fddOpType op, workerFddBase * dest);
43 
44 
45  //template <typename U, typename T0, typename T1, typename T2>
46  template <typename U>
47  void mapByKey(workerFddBase * dest, void * mapByKeyFunc);
48  //template <typename L, typename U, typename T0, typename T1, typename T2>
49  template <typename L, typename U>
50  void mapByKeyI(workerFddBase * dest, void * mapByKeyFunc);
51 
52  //template <typename U, typename T0, typename T1, typename T2>
53  template <typename U>
54  void flatMapByKey(workerFddBase * dest, void * mapByKeyFunc);
55  //template <typename L, typename U, typename T0, typename T1, typename T2>
56  template <typename L, typename U>
57  void flatMapByKeyI(workerFddBase * dest, void * mapByKeyFunc);
58 
59  template <typename U>
60  void bulkFlatMap(workerFddBase * dest, void * mapByKeyFunc);
61  template <typename L, typename U>
62  void bulkFlatMapI(workerFddBase * dest, void * mapByKeyFunc);
63 
64  void updateByKey(void * mapByKeyFunc);
65  void bulkUpdate(void * mapByKeyFunc);
66 
67  void exchangeDataByKey(fastComm *comm UNUSED, void * keyMap UNUSED){};
68  std::vector< std::vector<void*> > * getKeyLocations(){ return NULL; }
69  void cogroup(fastComm *comm);
70 
71  public:
72  workerFddGroup(unsigned long int id, fddType keyT, std::vector<workerFddBase*> & members);
73 
74  fddType getType() { return Null; }
75  fddType getKeyType() { return this->keyType; }
76 
77  void setData( void * d UNUSED, size_t s UNUSED) {}
78  void setData( void * d UNUSED, size_t * ds UNUSED, size_t s UNUSED) {}
79  void setData( void * k UNUSED, void * d UNUSED, size_t s UNUSED) {}
80  void setData( void * k UNUSED, void * d UNUSED, size_t * ds UNUSED, size_t s UNUSED) {}
81 
82  void setDataRaw( void * d UNUSED, size_t s UNUSED) {}
83  void setDataRaw( void * d UNUSED, size_t * ds UNUSED, size_t s UNUSED) {}
84  void setDataRaw( void * k UNUSED, void * d UNUSED, size_t s UNUSED) {}
85  void setDataRaw( void * k UNUSED, void * d UNUSED, size_t * ds UNUSED, size_t s UNUSED) {}
86 
87  void * getItem(size_t UNUSED p) { return NULL; }
88 
89  void * getKeys() { return NULL; }
90  void * getData() { return NULL; }
91  size_t getSize() { return 0; }
92  size_t * getLineSizes() { return NULL; }
93  void setSize(size_t s UNUSED) {}
94 
95  size_t itemSize() { return 0; }
96  size_t baseSize() { return 0; }
97 
98  void deleteItem(void * item UNUSED) {}
99 
100  void shrink(){}
101  void insertl(void * v UNUSED) {}
102  void insert(void * k UNUSED, void * v UNUSED, size_t s UNUSED) {}
103 
104  void apply(void * func, fddOpType op, workerFddBase * dest, fastCommBuffer & buffer);
105  void preapply(unsigned long int id, void * func, fddOpType op, workerFddBase * dest, fastComm * comm) ;
106 
107  void collect(fastComm * comm UNUSED) { /* TODO */ }
108  };
109 
110 }
111 #endif
Definition: fastComm.h:116
Definition: workerFddBase.h:15
Definition: fastCommBuffer.h:15
Definition: _workerFdd.h:11
Definition: workerFddGroup.h:12