TsvSampleOptions

Container for command line options and derived data.

TsvSampleOptions handles several aspects of command line options. On the input side, it defines the command line options available, performs validation, and sets up any derived state based on the options provided. These activities are handled by the processArgs() member.

Once argument processing is complete, TsvSampleOptions is used as a container holding the specific processing options used by the different sampling routines.

Members

Functions

processArgs
auto processArgs(string[] cmdArgs)

Process tsv-sample command line arguments.

Variables

compatibilityMode
bool compatibilityMode;

--compatibility-mode

delim
char delim;

--d|delimiter

distinctKeyIsFullLine
bool distinctKeyIsFullLine;

Derived. True if '--k|key-fields 0' is specfied.

genRandomInorder
bool genRandomInorder;

--gen-random-inorder

hasHeader
bool hasHeader;

--H|header

hasWeightField
bool hasWeightField;

Derived.

inclusionProbability
double inclusionProbability;

--p|prob - Inclusion probability

inputSources
InputSourceRange inputSources;

Input files

keyFields
size_t[] keyFields;

Derived: --k|key-fields - Used with inclusion probability

lineBuffered
bool lineBuffered;

--line-buffered

preferAlgorithmR
bool preferAlgorithmR;

--prefer-algorithm-r

preferSkipSampling
bool preferSkipSampling;

--prefer-skip-sampling

preserveInputOrder
bool preserveInputOrder;

--i|inorder

printRandom
bool printRandom;

--print-random

programName
string programName;

Program name

randomValueHeader
string randomValueHeader;

--random-value-header

sampleSize
ulong sampleSize;

--n|num - Size of the desired sample

seed
uint seed;

Derived from --static-seed, --seed-value

seedValueOptionArg
uint seedValueOptionArg;

--v|seed-value

srsWithReplacement
bool srsWithReplacement;

--r|replace

staticSeed
bool staticSeed;

--s|static-seed

useBernoulliSampling
bool useBernoulliSampling;

Derived.

useDistinctSampling
bool useDistinctSampling;

Derived.

usingUnpredictableSeed
bool usingUnpredictableSeed;

Derived from --static-seed, --seed-value

weightField
size_t weightField;

Derived: --w|weight-field - Field holding the weight

Meta