catalog

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2014 License: Apache-2.0 Imports: 3 Imported by: 33

Documentation

Overview

Package catalog provides a common catalog abstraction over all storage engines, such as Couchbase server, cloud, mobile, file, 3rd-party databases and storage engines, etc.

Index

Constants

View Source
const CHANNEL = "CATALOG"

log channel for the catalog lifecycle

Variables

This section is empty.

Functions

This section is empty.

Types

type Bin

type Bin interface {
	Count() (int64, query.Error)
	Min() (dparval.Value, query.Error)
	Max() (dparval.Value, query.Error)
	DistinctCount(int64, query.Error)
}

Bin represents a range bin within IndexStatistics.

type Bucket

type Bucket interface {
	PoolId() string
	Id() string
	Name() string
	Count() (int64, query.Error)
	IndexIds() ([]string, query.Error)
	IndexNames() ([]string, query.Error)
	IndexById(id string) (Index, query.Error)
	IndexByName(name string) (Index, query.Error)
	IndexByPrimary() (PrimaryIndex, query.Error)     // Returns the server-recommended primary index
	IndexesByPrimary() ([]PrimaryIndex, query.Error) // Returns all available primary indexes
	Indexes() ([]Index, query.Error)
	Fetch(id string) (*dparval.Value, query.Error)
	BulkFetch([]string) (map[string]*dparval.Value, query.Error)
	Release()
	CreatePrimaryIndex() (PrimaryIndex, query.Error)
	CreateIndex(name string, key IndexKey, using IndexType) (Index, query.Error)
}

Bucket is a collection of key-value entries (typically key-document, but not always).

type CountIndex added in v0.6.0

type CountIndex interface {
	Index
	ValueCount() (int64, query.Error)
}

CountIndex represents indexes that can efficiently produce entry counts.

type Direction

type Direction int

Direction represents ASC and DESC TODO: Is this needed?

const (
	ASC  Direction = 1
	DESC           = 2
)

type EntryChannel added in v0.6.0

type EntryChannel chan *IndexEntry

type ExistenceIndex

type ExistenceIndex interface {
	Check(value LookupValue, ch EntryChannel, warnch, errch query.ErrorChannel)
}

ExistenceIndex represents existence indexes.

type Index

type Index interface {
	BucketId() string
	Id() string
	Name() string
	Type() IndexType
	IsPrimary() bool
	Key() IndexKey
	Drop() query.Error // PrimaryIndexes cannot be dropped
}

Index is the base type for all indexes.

type IndexEntry added in v0.6.0

type IndexEntry struct {
	EntryKey   LookupValue
	PrimaryKey string
}

type IndexKey

type IndexKey []ast.Expression

type IndexType

type IndexType string
const (
	UNSPECIFIED IndexType = "unspecified" // used by non-view primary_indexes
	VIEW        IndexType = "view"
)

type LookupIndex

type LookupIndex interface {
	Lookup(value LookupValue, ch EntryChannel, warnch, errch query.ErrorChannel)
}

LookupIndex represents lookup indexes.

type LookupValue

type LookupValue []*dparval.Value

type Pool

type Pool interface {
	SiteId() string
	Id() string
	Name() string
	BucketIds() ([]string, query.Error)
	BucketNames() ([]string, query.Error)
	BucketById(name string) (Bucket, query.Error)
	BucketByName(name string) (Bucket, query.Error)
}

Pool represents a logical authentication, query, and resource allocation boundary, as well as a grouping of buckets.

type PrimaryIndex

type PrimaryIndex interface {
	Index
	ScanIndex
	LookupIndex
	ScanBucket(limit int64, ch EntryChannel, warnch, errch query.ErrorChannel)
}

PrimaryIndex represents primary key indexes.

type RangeInclusion

type RangeInclusion int

Inclusion controls how the boundaries values of a range are treated

const (
	Neither RangeInclusion = iota
	Low
	High
	Both
)

type RangeIndex

type RangeIndex interface {
	Index
	ScanIndex
	LookupIndex
	Direction() Direction
	Statistics() (RangeStatistics, query.Error)
	ScanRange(low LookupValue, high LookupValue, inclusion RangeInclusion, limit int64, ch EntryChannel, warnch, errch query.ErrorChannel)
}

RangeIndex represents range scan indexes.

type RangeStatistics

type RangeStatistics interface {
	Count() (int64, query.Error)
	Min() (dparval.Value, query.Error)
	Max() (dparval.Value, query.Error)
	DistinctCount(int64, query.Error)
	Bins() ([]Bin, query.Error)
}

RangeStatistics captures statistics for a range index.

type ScanIndex

type ScanIndex interface {
	ScanEntries(limit int64, ch EntryChannel, warnch, errch query.ErrorChannel)
}

ScanIndex represents scanning indexes.

type SearchIndex

type SearchIndex interface {
	Index
	SearchValue(value string, limit int64, ch EntryChannel, warnch, errch query.ErrorChannel)
}

SearchIndex represents full text search indexes.

type Site

type Site interface {
	Id() string
	URL() string
	PoolIds() ([]string, query.Error)
	PoolNames() ([]string, query.Error)
	PoolById(id string) (Pool, query.Error)
	PoolByName(name string) (Pool, query.Error)
}

Site represents a cluster or single-node server.

Directories

Path Synopsis
Package file provides a file-based implementation of the catalog package.
Package file provides a file-based implementation of the catalog package.
Package mock provides a fake, mock 100%-in-memory implementation of the catalog package, which can be useful for testing.
Package mock provides a fake, mock 100%-in-memory implementation of the catalog package, which can be useful for testing.

Jump to

Keyboard shortcuts

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