19 #ifndef HASH_PARTITION_SINK_H
20 #define HASH_PARTITION_SINK_H
33 template <
class KeyType,
class ValueType>
52 std::vector<int> matches = myMachine.
match(attsToOperateOn);
59 std::cout <<
"numPartitions=" << numPartitions << std::endl;
60 std::cout <<
"numNodes=" << numNodes << std::endl;
71 makeObject<Vector<Handle<Vector<Handle<ValueType>>>>>(
numNodes);
74 = makeObject<Vector<Handle<ValueType>>>();
75 returnVal->push_back(curNodeVec);
91 unsafeCast<Vector<Handle<Vector<Handle<ValueType>>>>>(writeToMe);
96 std::vector<KeyType>& keyColumn = input->getColumn<KeyType>(
whichAttToHash);
102 size_t length = keyColumn.size();
103 for (
size_t i = 0; i < length; i++) {
118 keyColumn.erase(keyColumn.begin(), keyColumn.begin() + i);
119 valueColumn.erase(valueColumn.begin(), valueColumn.begin() + i);
Handle< Object > createNewOutputContainer() override
void writeOut(TupleSetPtr input, Handle< Object > &writeToMe) override
std::vector< int > match(TupleSpec &attsToMatch)
HashPartitionSink(int numPartitions, int numNodes, TupleSpec &inputSchema, TupleSpec &attsToOperateOn)
std::shared_ptr< TupleSet > TupleSetPtr
static auto hash(const KeyType &k) -> decltype(hash_impl(k, 0))
void push_back(const TypeContained &val)