sample

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2017 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package sample represents sample stage of analysis. Task of the sample stage is to select the desired sample of documents from the collection and pass them to next stages of analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BsonChannelToSlice

func BsonChannelToSlice(ch <-chan bson.M) []interface{}

BsonChannelToSlice reads BSON documents from channel into slice.

func RawToBsonChannel

func RawToBsonChannel(input interface{}) <-chan bson.M

RawToBsonChannel converts the channel of raw (binary) data from DB to channel of BSON documents.

Types

type AnalysisScope

type AnalysisScope uint8

AnalysisScope defines the method of sampling.

const (
	// All - analyse all documents in collection
	All AnalysisScope = iota

	// First - analyse first N documents in collection
	First

	// Last - analyse last N documents in collection
	Last

	// Random - analyse random N documents in collection
	Random
)

type Options

type Options struct {
	Query bson.M
	Scope AnalysisScope
	Limit uint64
}

Options of sample stage.

type StageFactory

type StageFactory func(sampleOptions *Options) *analysis.Stage

StageFactory prototype.

Directories

Path Synopsis
Package sampleInDB is the implementation of the sampling stage.
Package sampleInDB is the implementation of the sampling stage.
Package sampleTests contains common tests for sample stage.
Package sampleTests contains common tests for sample stage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL