Documentation ¶
Index ¶
- Variables
- type DB
- type DBMetaInfo
- type LogInfo
- type MetaDB
- func (m *MetaDB) AddNewDB(name string, currentChunk, totalChunks int) error
- func (m *MetaDB) AddParsedFiles(files []*fpt.IndexedFile) error
- func (m *MetaDB) AddTSRange(name string, min int64, max int64) error
- func (m *MetaDB) CheckCompatibleAnalyze(targetDatabase string) (bool, error)
- func (m *MetaDB) DBExists(name string) (bool, error)
- func (m *MetaDB) DeleteDB(name string) error
- func (m *MetaDB) GetAnalyzedDatabases() []string
- func (m *MetaDB) GetDBMetaInfo(name string) (DBMetaInfo, error)
- func (m *MetaDB) GetDatabases() []string
- func (m *MetaDB) GetFiles(database string) ([]fpt.IndexedFile, error)
- func (m *MetaDB) GetRollingSettings(db string) (exists bool, isRolling bool, currChunk int, totalChunks int, err error)
- func (m *MetaDB) GetTSRange(name string) (int64, int64, error)
- func (m *MetaDB) GetUnAnalyzedDatabases() []string
- func (m *MetaDB) IsChunkSet(cid int, db string) (bool, error)
- func (m *MetaDB) LastCheck() (time.Time, semver.Version)
- func (m *MetaDB) MarkDBAnalyzed(name string, complete bool) error
- func (m *MetaDB) SetChunk(cid int, db string, analyzed bool) error
- func (m *MetaDB) SetRollingSettings(db string, chunk int, numchunks int) error
- type Range
Constants ¶
This section is empty.
Variables ¶
var MaxMongoDBVersion = semver.Version{
Major: 3,
Minor: 7,
Patch: 0,
}
MaxMongoDBVersion is the upper, exclusive bound on the versions of MongoDB compatible with RITA
var MinMongoDBVersion = semver.Version{
Major: 3,
Minor: 2,
Patch: 0,
}
MinMongoDBVersion is the lower, inclusive bound on the versions of MongoDB compatible with RITA
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB is the workhorse container for messing with the database
func (*DB) AggregateCollection ¶ added in v1.0.0
func (d *DB) AggregateCollection(sourceCollection string, session *mgo.Session, pipeline []bson.D) *mgo.Iter
AggregateCollection builds a collection via a MongoDB pipeline
func (*DB) CollectionExists ¶ added in v1.0.0
CollectionExists returns true if collection exists in the currently selected database
func (*DB) CreateCollection ¶ added in v1.0.0
CreateCollection creates a new collection in the currently selected database with the required indexes
func (*DB) GetSelectedDB ¶ added in v1.0.0
GetSelectedDB retrieves the currently selected database for analysis
type DBMetaInfo ¶
type DBMetaInfo struct { ID bson.ObjectId `bson:"_id,omitempty"` // Ident Name string `bson:"name"` // Top level name of the database Analyzed bool `bson:"analyzed"` // Has this database been analyzed AnalyzeVersion string `bson:"analyze_version"` // Rita version at analyze Rolling bool `bson:"rolling"` TotalChunks int `bson:"total_chunks"` CurrentChunk int `bson:"current_chunk"` TsRange Range `bson:"ts_range"` }
DBMetaInfo defines some information about the database
type LogInfo ¶ added in v1.1.1
type LogInfo struct { ID bson.ObjectId `bson:"_id,omitempty"` // Ident Time time.Time `bson:"LastUpdateCheck"` // Top level name of the database Message string `bson:"Message"` // Top level name of the database Version string `bson:"NewestVersion"` // Top level name of the database }
LogInfo defines information about the UpdateChecker log
type MetaDB ¶ added in v1.0.2
type MetaDB struct {
// contains filtered or unexported fields
}
MetaDB exports control for the meta database
func (*MetaDB) AddNewDB ¶ added in v1.0.2
AddNewDB adds a new database to the DBMetaInfo table. All new databases are ready to be rolling databases.
func (*MetaDB) AddParsedFiles ¶ added in v1.0.2
func (m *MetaDB) AddParsedFiles(files []*fpt.IndexedFile) error
AddParsedFiles adds indexed files to the files the metaDB using the bulk API
func (*MetaDB) AddTSRange ¶
AddTSRange adds the min and max timestamps found in current dataset
func (*MetaDB) CheckCompatibleAnalyze ¶ added in v1.0.2
CheckCompatibleAnalyze checks if a database was analyzed with a version of RITA which is compatible with the running version
func (*MetaDB) DBExists ¶
DBExists returns whether or not a metadatabase record has been created for a database
func (*MetaDB) GetAnalyzedDatabases ¶ added in v1.0.2
GetAnalyzedDatabases builds a list of database names which have been analyzed
func (*MetaDB) GetDBMetaInfo ¶ added in v1.0.2
func (m *MetaDB) GetDBMetaInfo(name string) (DBMetaInfo, error)
GetDBMetaInfo returns a meta db entry. This is the only function which returns DBMetaInfo to code outside of meta.go.
func (*MetaDB) GetDatabases ¶ added in v1.0.2
GetDatabases returns a list of databases being tracked in metadb or an empty array on failure
func (*MetaDB) GetFiles ¶ added in v1.0.2
func (m *MetaDB) GetFiles(database string) ([]fpt.IndexedFile, error)
GetFiles gets a list of all IndexedFile objects associated with the given database. If successful return a list of files from the database. On failure return an empty list of files and generate a log message.
func (*MetaDB) GetRollingSettings ¶
func (m *MetaDB) GetRollingSettings(db string) (exists bool, isRolling bool, currChunk int, totalChunks int, err error)
GetRollingSettings gets the current rolling settings
func (*MetaDB) GetTSRange ¶
GetTSRange adds the min and max timestamps for current dataset
func (*MetaDB) GetUnAnalyzedDatabases ¶ added in v1.0.2
GetUnAnalyzedDatabases builds a list of database names which have yet to be analyzed
func (*MetaDB) IsChunkSet ¶
IsChunkSet ....
func (*MetaDB) MarkDBAnalyzed ¶ added in v1.0.2
MarkDBAnalyzed marks a database as having been analyzed