CPARK 1.0
A light-weighted, distributed computing framework for C++ that offers a fast and general-purpose large data processing solution.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
cpark::SampleRdd< R > Class Template Reference

#include <sample_rdd.h>

Inheritance diagram for cpark::SampleRdd< R >:
cpark::BaseRdd< SampleRdd< R > >

Public Types

using Base = BaseRdd< SampleRdd< R > >
 

Public Member Functions

constexpr SampleRdd (const R &prev, double fraction)
 
constexpr SampleRdd (const SampleRdd &)=default
 
SampleRddoperator= (const SampleRdd &)=default
 
- Public Member Functions inherited from cpark::BaseRdd< SampleRdd< R > >
 BaseRdd (const BaseRdd< R > &prev, bool copy_id)
 
 BaseRdd (const BaseRdd< R > &prev)
 
 BaseRdd (ExecutionContext *context)
 
BaseRddoperator= (const BaseRdd< R > &prev)
 
auto begin () const
 
auto end () const
 
ExecutionContext::RddId id () const noexcept
 

Public Attributes

friend Base
 

Additional Inherited Members

- Protected Attributes inherited from cpark::BaseRdd< SampleRdd< R > >
ExecutionContextcontext_
 
ExecutionContext::RddId rdd_id_
 
size_t splits_num_
 

Detailed Description

template<concepts::Rdd R>
requires std::invocable<std::function<bool(int)>, utils::RddElementType<R>>&& std::is_convertible_v< std::invoke_result_t<std::function<bool(int)>, utils::RddElementType<R>>, bool>
class cpark::SampleRdd< R >

An Rdd holding the sampled data from an old rdd by a specific sample fraction

Template Parameters
RType of the old Rdd. The type of the old Rdd R's elements should be able to invoke random boolean function, the invoke result must be in boolean, and the element type shouldn't change after sampling.
Examples
filter_even.cpp.

Constructor & Destructor Documentation

◆ SampleRdd()

template<concepts::Rdd R>
constexpr cpark::SampleRdd< R >::SampleRdd ( const R &  prev,
double  fraction 
)
inlineconstexpr

Main constructor of SampleRdd.

Parameters
prevReference to previous Rdd of type R
fractionThe desired sampling ratio from the 'prev' RDD

The documentation for this class was generated from the following file: