mongotrainer

package
v0.0.0-...-512ff7a Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2013 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MongoServer to connect to
	MongoServer = flag.String("mongo_server", "localhost", "")
	// MongoDatabase to use
	MongoDatabase = flag.String("mongo_database", "test", "")
	// MongoCollection with active tasks
	MongoCollection = flag.String("mongo_collection", "decisiontrees", "")
	// MongoFs with GridFS files
	MongoFs = flag.String("mongo_fs", "fs", "")
	// MongoPollTime is the interval between polling the task collection for
	// unclaimed tasks
	MongoPollTime = flag.Duration("mongo_poll_time", 30*time.Second, "")
)

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	GetTrainingData() (*pb.TrainingData, error)
}

DataSource is an interface for extracting training data from an arbitrary location TODO(tulloch) - make this an iterator?

func NewDataSource

func NewDataSource(c *pb.DataSourceConfig, s *mgo.Session) (DataSource, error)

NewDataSource is a factory function that returns a new DataSource given the input DataSourceConfig.

type MongoTrainer

type MongoTrainer struct {
	Collection *mgo.Collection
}

MongoTrainer polls a MongoDB collection for changes and spins up training jobs based on these changes

func (*MongoTrainer) Loop

func (m *MongoTrainer) Loop()

Loop starts the polling thread, and selects on the channel of potential tasks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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