Documentation
¶
Overview ¶
Copyright (c) 2019 Couchbase, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func AddServerInterceptor() grpc.ServerOption
- func AggregateBleveDestPartitionStats() map[string]interface{}
- func AnalyzeDoc(mgr *cbgt.Manager, indexName, indexUUID string, req []byte, res io.Writer) error
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func BleveInitRouter(r *mux.Router, phase string, mgr *cbgt.Manager)
- func BleveMetaExtra(m map[string]interface{})
- func BleveQuerySamples() []cbgt.Documentation
- func CheckAPIAuth(mgr *cbgt.Manager, w http.ResponseWriter, req *http.Request, path string) (allowed bool)
- func CheckAPIVersion(w http.ResponseWriter, req *http.Request) (err error)
- func CountAlias(mgr *cbgt.Manager, indexName, indexUUID string) (uint64, error)
- func CountBleve(mgr *cbgt.Manager, indexName, indexUUID string) (uint64, error)
- func FetchCurMemoryUsed() uint64
- func GetAuditEventData(eventId uint32, req *http.Request) interface{}
- func GetSourcePartitionSeqs(sourceSpec SourceSpec) map[string]cbgt.UUIDSeq
- func HandleAPIVersion(h string) (string, error)
- func InitBleveResultCacheOptions(options map[string]string) error
- func InitResultCacheOptions(options map[string]string) error
- func InitStaticRouter(staticDir, staticETag string, mgr *cbgt.Manager) *mux.Router
- func MarshalJSON(v interface{}) ([]byte, error)
- func MustAsset(name string) []byte
- func MustEncodeWithParser(w io.Writer, i interface{})
- func NewBlevePIndexImpl(indexType, indexParams, path string, restart func()) (cbgt.PIndexImpl, cbgt.Dest, error)
- func NewIndexStat() map[string]interface{}
- func NewRESTRouter(versionMain string, mgr *cbgt.Manager, staticDir, staticETag string, ...) (*mux.Router, map[string]rest.RESTMeta, error)
- func NsHostsForIndex(name string, planPIndexes *cbgt.PlanPIndexes, nodeDefs *cbgt.NodeDefs) []string
- func OpenBlevePIndexImpl(indexType, path string, restart func()) (cbgt.PIndexImpl, cbgt.Dest, error)
- func OpenBlevePIndexImplUsing(indexType, path, indexParams string, restart func()) (cbgt.PIndexImpl, cbgt.Dest, error)
- func ParseExtras(s string) (map[string]string, error)
- func PrepareAlias(indexDef *cbgt.IndexDef) (*cbgt.IndexDef, error)
- func PrepareIndexDef(indexDef *cbgt.IndexDef) (*cbgt.IndexDef, error)
- func QueryAlias(mgr *cbgt.Manager, indexName, indexUUID string, req []byte, res io.Writer) error
- func QueryBleve(mgr *cbgt.Manager, indexName, indexUUID string, req []byte, res io.Writer) error
- func RegisterRemoteClientsForSecurity()
- func RestartOnIndexDefChanges(configRequest *cbgt.ConfigAnalyzeRequest) cbgt.ResultCode
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func RunRecentInfoCache(mgr *cbgt.Manager)
- func RunSourcePartitionSeqs(options map[string]string, stopCh chan struct{})
- func UnmarshalJSON(b []byte, v interface{}) error
- func UpdateCurMemoryUsed() uint64
- func ValidateAlias(indexType, indexName, indexParams string) error
- func ValidateBleve(indexType, indexName, indexParams string) error
- func ValidateConsistencyParams(c *cbgt.ConsistencyParams) error
- func WithJSONVersion(v string) string
- type AliasParams
- type AliasParamsTarget
- type AnalyzeDocHandler
- type AuthVersionHandler
- type BleveDest
- func (t *BleveDest) AddError(op, partition string, key []byte, seq uint64, val []byte, err error)
- func (t *BleveDest) Close() error
- func (t *BleveDest) ConsistencyWait(partition, partitionUUID string, consistencyLevel string, ...) error
- func (t *BleveDest) Count(pindex *cbgt.PIndex, cancelCh <-chan bool) (uint64, error)
- func (t *BleveDest) Dest(partition string) (cbgt.Dest, error)
- func (t *BleveDest) PartitionSeqs() (map[string]cbgt.UUIDSeq, error)
- func (t *BleveDest) Query(pindex *cbgt.PIndex, req []byte, res io.Writer, parentCancelCh <-chan bool) error
- func (t *BleveDest) Rollback(partition string, vBucketUUID uint64, rollbackSeq uint64) error
- func (t *BleveDest) Stats(w io.Writer) (err error)
- func (t *BleveDest) StatsMap() (rv map[string]interface{}, err error)
- type BleveDestPartition
- func (t *BleveDestPartition) Close() error
- func (t *BleveDestPartition) ConsistencyWait(partition, partitionUUID string, consistencyLevel string, ...) error
- func (t *BleveDestPartition) Count(pindex *cbgt.PIndex, cancelCh <-chan bool) (uint64, error)
- func (t *BleveDestPartition) DataDelete(partition string, key []byte, seq uint64, cas uint64, ...) error
- func (t *BleveDestPartition) DataUpdate(partition string, key []byte, seq uint64, val []byte, cas uint64, ...) error
- func (t *BleveDestPartition) OpaqueGet(partition string) ([]byte, uint64, error)
- func (t *BleveDestPartition) OpaqueSet(partition string, value []byte) error
- func (t *BleveDestPartition) Query(pindex *cbgt.PIndex, req []byte, res io.Writer, cancelCh <-chan bool) error
- func (t *BleveDestPartition) Rollback(partition string, rollbackSeq uint64) error
- func (t *BleveDestPartition) RollbackEx(partition string, vBucketUUID uint64, rollbackSeq uint64) error
- func (t *BleveDestPartition) SnapshotStart(partition string, snapStart, snapEnd uint64) error
- func (t *BleveDestPartition) Stats(w io.Writer) error
- type BleveDocument
- type BleveDocumentConfig
- func (b *BleveDocumentConfig) BuildDocument(key, val []byte, defaultType string) (*BleveDocument, error)
- func (b *BleveDocumentConfig) BuildDocumentEx(key, val []byte, defaultType string, extrasType cbgt.DestExtrasType, ...) (*BleveDocument, error)
- func (b *BleveDocumentConfig) BuildDocumentFromObj(key []byte, v interface{}, defaultType string) *BleveDocument
- func (b *BleveDocumentConfig) DetermineType(key []byte, v interface{}, defaultType string) string
- func (b *BleveDocumentConfig) MarshalJSON() ([]byte, error)
- func (b *BleveDocumentConfig) UnmarshalJSON(data []byte) error
- type BleveIndexCollector
- type BleveInterface
- type BleveParams
- type BleveParamsStore
- type CBAuthBasicLogin
- type Collection
- type ConciseOptions
- type CustomJSONImpl
- func (p *CustomJSONImpl) Decode(r io.Reader, v interface{}) error
- func (p *CustomJSONImpl) Encode(w io.Writer, v interface{}) error
- func (p *CustomJSONImpl) GetManagerOptions() map[string]string
- func (p *CustomJSONImpl) GetParserType() string
- func (p *CustomJSONImpl) Marshal(v interface{}) ([]byte, error)
- func (p *CustomJSONImpl) SetManager(mgr *cbgt.Manager)
- func (p *CustomJSONImpl) Unmarshal(b []byte, v interface{}) error
- type FilteredListIndexHandler
- type GRPCPathStats
- type GrpcClient
- func (g *GrpcClient) Advanced() (index.Index, store.KVStore, error)
- func (g *GrpcClient) AuthType() string
- func (g *GrpcClient) Batch(b *bleve.Batch) error
- func (g *GrpcClient) Close() error
- func (g *GrpcClient) Count() (uint64, error)
- func (g *GrpcClient) Delete(id string) error
- func (g *GrpcClient) DeleteInternal(key []byte) error
- func (g *GrpcClient) DocCount() (uint64, error)
- func (g *GrpcClient) Document(id string) (*document.Document, error)
- func (g *GrpcClient) DumpAll() chan interface{}
- func (g *GrpcClient) DumpDoc(id string) chan interface{}
- func (g *GrpcClient) DumpFields() chan interface{}
- func (g *GrpcClient) FieldDict(field string) (index.FieldDict, error)
- func (g *GrpcClient) FieldDictPrefix(field string, termPrefix []byte) (index.FieldDict, error)
- func (g *GrpcClient) FieldDictRange(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error)
- func (g *GrpcClient) Fields() ([]string, error)
- func (g *GrpcClient) GetHostPort() string
- func (g *GrpcClient) GetInternal(key []byte) ([]byte, error)
- func (g *GrpcClient) GetLast() (int, []byte)
- func (g *GrpcClient) Index(id string, data interface{}) error
- func (g *GrpcClient) Mapping() mapping.IndexMapping
- func (g *GrpcClient) Name() string
- func (g *GrpcClient) NewBatch() *bleve.Batch
- func (g *GrpcClient) Query(ctx context.Context, req *scatterRequest) (*bleve.SearchResult, error)
- func (g *GrpcClient) Search(req *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (g *GrpcClient) SearchInContext(ctx context.Context, req *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (g *GrpcClient) SearchRPC(ctx context.Context, req *scatterRequest, pbReq *pb.SearchRequest) (*bleve.SearchResult, error)
- func (g *GrpcClient) SetInternal(key, val []byte) error
- func (g *GrpcClient) SetName(name string)
- func (g *GrpcClient) SetStreamHandler(sc streamHandler)
- func (g *GrpcClient) Stats() *bleve.IndexStat
- func (g *GrpcClient) StatsMap() map[string]interface{}
- type IndexAuditLog
- type IndexClient
- func (r *IndexClient) Advanced() (index.Index, store.KVStore, error)
- func (r *IndexClient) AuthType() string
- func (r *IndexClient) Batch(b *bleve.Batch) error
- func (r *IndexClient) Close() error
- func (r *IndexClient) Count() (uint64, error)
- func (r *IndexClient) Delete(id string) error
- func (r *IndexClient) DeleteInternal(key []byte) error
- func (r *IndexClient) DocCount() (uint64, error)
- func (r *IndexClient) Document(id string) (*document.Document, error)
- func (r *IndexClient) DumpAll() chan interface{}
- func (r *IndexClient) DumpDoc(id string) chan interface{}
- func (r *IndexClient) DumpFields() chan interface{}
- func (r *IndexClient) FieldDict(field string) (index.FieldDict, error)
- func (r *IndexClient) FieldDictPrefix(field string, termPrefix []byte) (index.FieldDict, error)
- func (r *IndexClient) FieldDictRange(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error)
- func (r *IndexClient) Fields() ([]string, error)
- func (r *IndexClient) GetHostPort() string
- func (r *IndexClient) GetInternal(key []byte) ([]byte, error)
- func (r *IndexClient) GetLast() (int, []byte)
- func (r *IndexClient) Index(id string, data interface{}) error
- func (r *IndexClient) Mapping() mapping.IndexMapping
- func (r *IndexClient) Name() string
- func (r *IndexClient) NewBatch() *bleve.Batch
- func (r *IndexClient) Query(buf []byte) ([]byte, error)
- func (r *IndexClient) Search(req *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (r *IndexClient) SearchInContext(ctx context.Context, req *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (r *IndexClient) SetInternal(key, val []byte) error
- func (r *IndexClient) SetName(name string)
- func (r *IndexClient) SetStreamHandler(s streamHandler)
- func (r *IndexClient) Stats() *bleve.IndexStat
- func (r *IndexClient) StatsMap() map[string]interface{}
- type IndexControlAuditLog
- type JSONStatsWriter
- type LowerLevelStoreHolder
- type ManagerOptionsExt
- type Manifest
- type MissingPIndex
- func (m *MissingPIndex) Advanced() (index.Index, store.KVStore, error)
- func (m *MissingPIndex) Batch(b *bleve.Batch) error
- func (m *MissingPIndex) Close() error
- func (m *MissingPIndex) Delete(id string) error
- func (m *MissingPIndex) DeleteInternal(key []byte) error
- func (m *MissingPIndex) DocCount() (uint64, error)
- func (m *MissingPIndex) Document(id string) (*document.Document, error)
- func (m *MissingPIndex) DumpAll() chan interface{}
- func (m *MissingPIndex) DumpDoc(id string) chan interface{}
- func (m *MissingPIndex) DumpFields() chan interface{}
- func (m *MissingPIndex) FieldDict(field string) (index.FieldDict, error)
- func (m *MissingPIndex) FieldDictPrefix(field string, termPrefix []byte) (index.FieldDict, error)
- func (m *MissingPIndex) FieldDictRange(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error)
- func (m *MissingPIndex) Fields() ([]string, error)
- func (m *MissingPIndex) GetInternal(key []byte) ([]byte, error)
- func (m *MissingPIndex) Index(id string, data interface{}) error
- func (m *MissingPIndex) Mapping() mapping.IndexMapping
- func (m *MissingPIndex) Name() string
- func (m *MissingPIndex) NewBatch() *bleve.Batch
- func (m *MissingPIndex) Search(req *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (m *MissingPIndex) SearchInContext(ctx context.Context, req *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (m *MissingPIndex) SetInternal(key, val []byte) error
- func (m *MissingPIndex) SetName(name string)
- func (m *MissingPIndex) Stats() *bleve.IndexStat
- func (m *MissingPIndex) StatsMap() map[string]interface{}
- type MossStoreActualHolder
- type NSIndexStats
- type NodeDefsFetcher
- type NsSearchResultRedirct
- type NsStatsHandler
- type NsStatusHandler
- type PartitionSelectionStrategy
- type PartitionSeqsProvider
- type QueryEvent
- type QueryEventKind
- type QueryKiller
- type QueryPIndexes
- type QuerySupervisor
- func (qs *QuerySupervisor) AddEntry(qsc *QuerySupervisorContext) uint64
- func (qs *QuerySupervisor) Count() uint64
- func (qs *QuerySupervisor) DeleteEntry(id uint64)
- func (qs *QuerySupervisor) ExecutionTime(id uint64) (time.Duration, bool)
- func (qs *QuerySupervisor) GetLastAccessTimeForIndex(name string) string
- func (qs *QuerySupervisor) KillQuery(id uint64) bool
- func (qs *QuerySupervisor) ListLongerThan(longerThan time.Duration) map[uint64]*RunningQueryDetails
- type QuerySupervisorContext
- type QuerySupervisorDetails
- type RPCFocusStats
- type RemoteClient
- type RunningQueryDetails
- type Scope
- type SearchRequest
- type SearchService
- func (s *SearchService) Check(ctx context.Context, in *pb.HealthCheckRequest) (*pb.HealthCheckResponse, error)
- func (s *SearchService) DocCount(ctx context.Context, req *pb.DocCountRequest) (*pb.DocCountResult, error)
- func (s *SearchService) Search(req *pb.SearchRequest, stream pb.SearchService_SearchServer) (err error)
- func (s *SearchService) SetManager(mgr *cbgt.Manager)
- type SourcePartitionSeqs
- type SourceSpec
Constants ¶
const ( AuditDeleteIndexEvent = 24576 // 0x6000 AuditCreateUpdateIndexEvent = 24577 // 0x6001 AuditControlEvent = 24579 // 0x6003 AuditConfigRefreshEvent = 24580 // 0x6004 AuditConfigReplanEvent = 24581 // 0x6005 AuditRunGCEvent = 24582 // 0x6006 AuditProfileCPUEvent = 24583 // 0x6007 AuditProfileMemoryEvent = 24584 // 0x6008 )
const API_MAX_VERSION = "2.0.0"
cbft api versions, helps in controlling the service expectations during upgrades. See: MB-17990 on cbft API versioning.
const API_MIN_VERSION = "0.0.0"
const RESTIndexQueryPath = "/api/index/{indexName}/query"
const RemoteRequestOverhead = 500 * time.Millisecond
const VERSION = "v0.5.5"
cbft product version
const VersionTag = "version="
Variables ¶
var API_MAX_VERSION_JSON = WithJSONVersion(API_MAX_VERSION)
var BatchBytesAdded uint64
var BatchBytesRemoved uint64
var BleveBatchFlushDuration = time.Duration(100 * time.Millisecond)
var BleveKVStoreMetricsAllow = false // Use metrics wrapper KVStore by default.
var BleveMaxOpsPerBatch = 200 // Unlimited when <= 0.
var BlevePIndexAllowMoss = false // Unit tests prefer no moss.
var BleveResultCacheMaxHits = 100
Only cache a bleve result whose size in number of hits isn't too large in order to avoid consuming too much memory for the cache.
var BleveRouteMethods map[string]string
var CBAuthIsAllowed = func(creds cbauth.Creds, permission string) ( bool, error) { return creds.IsAllowed(permission) }
CBAuthIsAllowed extra level-of-indirection allows for overrides and for more testability.
var CBAuthSendForbidden = func(w http.ResponseWriter, permission string) { cbauth.SendForbidden(w, permission) }
CBAuthSendForbidden extra level-of-indirection allows for overrides and for more testability.
CBAuthSendUnauthorized extra level-of-indirection allows for overrides and for more testability.
var CBAuthWebCreds = cbauth.AuthWebCreds
CBAuthWebCreds extra level-of-indirection allows for overrides and for more testability.
var CollMetaFieldName = "_$scope_$collection"
var ConfigModeColPrefix = "scope.collection"
var ConfigModeColPrefixLen = len(ConfigModeColPrefix)
var DefaultGrpcConnectionHeartBeatInterval = time.Duration(60) * time.Second
var DefaultGrpcConnectionIdleTimeout = time.Duration(60) * time.Second
default values same as that for http/rest connections
var DefaultGrpcMaxBackOffDelay = time.Duration(10) * time.Second
var DefaultGrpcMaxConcurrentStreams = uint32(math.MaxInt32)
The number of concurrent streams/requests on a client connection can only be controlled by adjusting the server value. Set a very large value for the server config so that we have no fixed limit on the number of concurrent streams/requests on either the client or server.
var DefaultGrpcMaxRecvMsgSize = 1024 * 1024 * 50 // 50 MB
var DefaultGrpcMaxSendMsgSize = 1024 * 1024 * 50 // 50 MB
var DefaultStreamBatchSize = 100
var EventQueryEnd = QueryEventKind(2)
EventQueryEnd is fired upon the completion of a query.
var EventQueryStart = QueryEventKind(1)
EventQueryStart is fired before a query begins the search.
var FeatureCollections = cbgt.SOURCE_GOCBCORE + ":collections"
var FeatureGRPC = "protocol:gRPC"
var FeatureScorchIndex = featureIndexType + ":" + scorch.Name
var FeatureUpsidedownIndex = featureIndexType + ":" + upsidedown.Name
var FetchBleveTargets = func(mgr *cbgt.Manager, indexName, indexUUID string, planPIndexFilterName string, partitionSelection PartitionSelectionStrategy) ( []*cbgt.PIndex, []*cbgt.RemotePlanPIndex, []string, error) { if mgr == nil { return nil, nil, nil, fmt.Errorf("manager not defined") } return mgr.CoveringPIndexesEx(cbgt.CoveringPIndexesSpec{ IndexName: indexName, IndexUUID: indexUUID, PlanPIndexFilterName: planPIndexFilterName, }, nil, false) }
var GrpcPathStats = GRPCPathStats{ // contains filtered or unexported fields }
GrpcIndexQueryPath is keyed by path spec strings.
var GrpcPort = ":15000"
GrpcPort represents the port used with gRPC.
var HttpClient = http.DefaultClient // Overridable for testability / advanced needs.
var HttpGet = func(client *http.Client, url string) (*http.Response, error) {
return client.Get(url)
}
Overridable for testability / advanced needs.
var HttpPost = func(client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { return client.Post(url, bodyType, body) }
Overridable for testability / advanced needs.
var HttpTransportDialContextKeepAlive = 30 * time.Second // Go's default is 30 secs.
var HttpTransportDialContextTimeout = 30 * time.Second // Go's default is 30 secs.
var HttpTransportExpectContinueTimeout = 1 * time.Second // Go's default is 1 secs.
var HttpTransportIdleConnTimeout = 90 * time.Second // Go's default is 90 secs.
var HttpTransportMaxIdleConns = 300 // Go's default is 100 (0 means no limit).
var HttpTransportMaxIdleConnsPerHost = 100 // Go's default is 2.
var HttpTransportTLSHandshakeTimeout = 10 * time.Second // Go's default is 10 secs.
var LogEveryNStats = 300
Dump stats to log once every 5min. This stat is configurable through the ENV_OPTION: logStatsEvery
var LogLevels map[string]uint32
List of log levels that maps strings to integers. (Works with clog - https://github.com/couchbase/clog)
var MapRESTPathStats = map[string]*rest.RESTPathStats{ RESTIndexQueryPath: {}, }
MapRESTPathStats is keyed by path spec strings.
var OnMemoryUsedDropped func(curMemoryUsed, prevMemoryUsed uint64)
Optional callback when current memory used has dropped since the last sampling.
var RESULT_CACHE_DEFAULT_MAX_BYTES_PER_ENTRY = 32 * 1024
Default maximum size in bytes of an entry result. Results larger than this are not cached.
var RESULT_CACHE_DEFAULT_MAX_LEN = 0
Default max number of entries in a result cache.
var RESULT_CACHE_DEFAULT_MIN_LOOKUPS = 3
Default number of lookups needed before we start caching a result. The idea is avoid using resources for rarely encountered lookups.
var RPCClientConn map[string][]*grpc.ClientConn
RPCClientConn represent the gRPC client connection cache.
var RegistryQueryEventCallback func(int, QueryEvent, uint64) error
RegistryQueryEventCallbacks should be treated as read-only after process init()'ialization.
var ResultCache = resultCache{ // contains filtered or unexported fields }
Global result cache per cbft process.
var SourcePartitionSeqsCacheTimeoutDefault = 60 * time.Second
var SourcePartitionSeqsSleepDefault = 10 * time.Second
var TotBatchesFlushedOnMaxOps uint64
var TotBatchesFlushedOnTimer uint64
var TotBleveDestClosed uint64
var TotBleveDestOpened uint64
var TotGRPCListenersClosed uint64
var TotGRPCListenersOpened uint64
Atomic counters to keep track of the number of active grpc and grpc-ssl listeners.
var TotGRPCSListenersClosed uint64
var TotGRPCSListenersOpened uint64
var TotHTTPLimitListenersClosed uint64
var TotHTTPLimitListenersOpened uint64
Atomic counters to keep track of the number of active http and https limit listeners.
var TotHTTPSLimitListenersClosed uint64
var TotHTTPSLimitListenersOpened uint64
var TotHerderOnBatchExecuteStartBeg uint64
var TotHerderOnBatchExecuteStartEnd uint64
var TotHerderQueriesRejected uint64
var TotHerderWaitingIn uint64
App-herder pertinent atomic stats.
var TotHerderWaitingOut uint64
var TotRollbackFull uint64
var TotRollbackPartial uint64
var UrlWithAuth = func(authType, urlStr string) (string, error) { if authType == "cbauth" { return cbgt.CBAuthURL(urlStr) } return urlStr, nil }
UrlWithAuth extra level-of-indirection allows for overrides and for more testability.
Functions ¶
func AddServerInterceptor ¶ added in v0.4.0
func AddServerInterceptor() grpc.ServerOption
func AggregateBleveDestPartitionStats ¶ added in v0.4.0
func AggregateBleveDestPartitionStats() map[string]interface{}
func AnalyzeDoc ¶ added in v0.4.0
func Asset ¶ added in v0.0.1
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶ added in v0.0.1
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/
foo.txt
img/
a.png
b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶ added in v0.0.1
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetNames ¶ added in v0.0.1
func AssetNames() []string
AssetNames returns the names of the assets.
func BleveInitRouter ¶ added in v0.4.0
func BleveMetaExtra ¶ added in v0.1.0
func BleveMetaExtra(m map[string]interface{})
func BleveQuerySamples ¶ added in v0.4.0
func BleveQuerySamples() []cbgt.Documentation
func CheckAPIAuth ¶ added in v0.4.0
func CheckAPIVersion ¶ added in v0.4.0
func CheckAPIVersion(w http.ResponseWriter, req *http.Request) (err error)
func CountAlias ¶ added in v0.0.1
func CountBleve ¶ added in v0.4.0
func FetchCurMemoryUsed ¶ added in v0.4.0
func FetchCurMemoryUsed() uint64
func GetAuditEventData ¶ added in v0.4.0
func GetSourcePartitionSeqs ¶ added in v0.4.0
func GetSourcePartitionSeqs(sourceSpec SourceSpec) map[string]cbgt.UUIDSeq
func HandleAPIVersion ¶ added in v0.4.0
func InitBleveResultCacheOptions ¶ added in v0.4.0
InitBleveResultCacheOptions initializes the bleve related result cache options.
func InitResultCacheOptions ¶ added in v0.4.0
InitResultCacheOptions initializes the global result cache.
func InitStaticRouter ¶ added in v0.3.0
func MarshalJSON ¶ added in v0.4.0
MarshalJSON abstracts the underlying json lib used
func MustAsset ¶ added in v0.0.1
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func MustEncodeWithParser ¶ added in v0.4.0
MustEncodeWithParser encode with the registered parserType,
func NewBlevePIndexImpl ¶ added in v0.0.1
func NewIndexStat ¶ added in v0.3.0
func NewIndexStat() map[string]interface{}
NewIndexStat ensures that all index stats have the same shape and 0 values to prevent seeing N/A in ns_server UI
func NewRESTRouter ¶ added in v0.3.0
func NewRESTRouter(versionMain string, mgr *cbgt.Manager, staticDir, staticETag string, mr *cbgt.MsgRing, adtSvc *audit.AuditSvc) ( *mux.Router, map[string]rest.RESTMeta, error)
NewRESTRouter creates a mux.Router initialized with the REST API and web UI routes. See also InitStaticRouter if you need finer control of the router initialization.
func NsHostsForIndex ¶ added in v0.4.0
func OpenBlevePIndexImpl ¶ added in v0.0.1
func OpenBlevePIndexImplUsing ¶ added in v0.4.0
func PrepareAlias ¶ added in v0.4.0
func PrepareIndexDef ¶ added in v0.4.0
func QueryAlias ¶ added in v0.0.1
func QueryBleve ¶ added in v0.4.0
func RegisterRemoteClientsForSecurity ¶ added in v0.4.0
func RegisterRemoteClientsForSecurity()
func RestartOnIndexDefChanges ¶ added in v0.4.0
func RestartOnIndexDefChanges( configRequest *cbgt.ConfigAnalyzeRequest) cbgt.ResultCode
RestartOnIndexDefChanges checks whether the changes in the indexDefns are quickly adoptable over a reboot of the pindex implementations. eg: kvstore configs updates like compaction percentage.
func RestoreAsset ¶ added in v0.0.1
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶ added in v0.0.1
RestoreAssets restores an asset under the given directory recursively
func RunRecentInfoCache ¶ added in v0.4.0
func RunSourcePartitionSeqs ¶ added in v0.4.0
func UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON abstracts the underlying json lib used
func UpdateCurMemoryUsed ¶ added in v0.4.0
func UpdateCurMemoryUsed() uint64
func ValidateAlias ¶ added in v0.0.1
func ValidateBleve ¶ added in v0.4.0
func ValidateConsistencyParams ¶ added in v0.4.0
func ValidateConsistencyParams(c *cbgt.ConsistencyParams) error
func WithJSONVersion ¶ added in v0.4.0
Types ¶
type AliasParams ¶ added in v0.0.1
type AliasParams struct {
Targets map[string]*AliasParamsTarget `json:"targets"` // Keyed by indexName.
}
AliasParams holds the definition for a user-defined index alias. A user-defined index alias can be used as a level of indirection (the "LastQuartersSales" alias points currently to the "2014-Q3-Sales" index, but the administrator might repoint it in the future without changing the application) or to scatter-gather or fan-out a query across multiple real indexes (e.g., to query across customer records, product catalog, call-center records, etc, in one shot).
type AliasParamsTarget ¶ added in v0.0.1
type AliasParamsTarget struct {
IndexUUID string `json:"indexUUID"` // Optional.
}
type AnalyzeDocHandler ¶ added in v0.4.0
type AnalyzeDocHandler struct {
// contains filtered or unexported fields
}
AnalyzeDocHandler is a REST handler for analyzing documents against a given index.
func NewAnalyzeDocHandler ¶ added in v0.4.0
func NewAnalyzeDocHandler(mgr *cbgt.Manager) *AnalyzeDocHandler
func (*AnalyzeDocHandler) RESTOpts ¶ added in v0.4.0
func (h *AnalyzeDocHandler) RESTOpts(opts map[string]string)
func (*AnalyzeDocHandler) ServeHTTP ¶ added in v0.4.0
func (h *AnalyzeDocHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type AuthVersionHandler ¶ added in v0.4.0
func NewAuthVersionHandler ¶ added in v0.4.0
func NewAuthVersionHandler(mgr *cbgt.Manager, adtSvc *audit.AuditSvc, h http.Handler) *AuthVersionHandler
func (*AuthVersionHandler) ServeHTTP ¶ added in v0.4.0
func (c *AuthVersionHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type BleveDest ¶ added in v0.0.1
type BleveDest struct {
// contains filtered or unexported fields
}
func NewBleveDest ¶ added in v0.0.1
func NewBleveDest(path string, bindex bleve.Index, restart func(), bleveDocConfig BleveDocumentConfig) *BleveDest
func (*BleveDest) ConsistencyWait ¶ added in v0.0.1
func (*BleveDest) PartitionSeqs ¶ added in v0.4.0
Implements the PartitionSeqProvider interface.
type BleveDestPartition ¶ added in v0.0.1
type BleveDestPartition struct {
// contains filtered or unexported fields
}
Used to track state for a single partition.
func (*BleveDestPartition) Close ¶ added in v0.0.1
func (t *BleveDestPartition) Close() error
func (*BleveDestPartition) ConsistencyWait ¶ added in v0.0.1
func (*BleveDestPartition) DataDelete ¶ added in v0.0.3
func (t *BleveDestPartition) DataDelete(partition string, key []byte, seq uint64, cas uint64, extrasType cbgt.DestExtrasType, extras []byte) error
func (*BleveDestPartition) DataUpdate ¶ added in v0.0.3
func (t *BleveDestPartition) DataUpdate(partition string, key []byte, seq uint64, val []byte, cas uint64, extrasType cbgt.DestExtrasType, extras []byte) error
func (*BleveDestPartition) OpaqueGet ¶ added in v0.0.3
func (t *BleveDestPartition) OpaqueGet(partition string) ([]byte, uint64, error)
func (*BleveDestPartition) OpaqueSet ¶ added in v0.0.3
func (t *BleveDestPartition) OpaqueSet(partition string, value []byte) error
func (*BleveDestPartition) Rollback ¶ added in v0.0.1
func (t *BleveDestPartition) Rollback(partition string, rollbackSeq uint64) error
func (*BleveDestPartition) RollbackEx ¶ added in v0.4.0
func (t *BleveDestPartition) RollbackEx(partition string, vBucketUUID uint64, rollbackSeq uint64) error
func (*BleveDestPartition) SnapshotStart ¶ added in v0.0.3
func (t *BleveDestPartition) SnapshotStart(partition string, snapStart, snapEnd uint64) error
type BleveDocument ¶ added in v0.4.0
type BleveDocument struct {
BleveInterface `json:""`
// contains filtered or unexported fields
}
func (*BleveDocument) Type ¶ added in v0.4.0
func (c *BleveDocument) Type() string
type BleveDocumentConfig ¶ added in v0.4.0
type BleveDocumentConfig struct {
Mode string `json:"mode"`
TypeField string `json:"type_field"`
DocIDPrefixDelim string `json:"docid_prefix_delim"`
DocIDRegexp *regexp.Regexp `json:"docid_regexp"`
CollPrefixLookup map[uint32]collMetaField
// contains filtered or unexported fields
}
func (*BleveDocumentConfig) BuildDocument ¶ added in v0.4.0
func (b *BleveDocumentConfig) BuildDocument(key, val []byte, defaultType string) (*BleveDocument, error)
BuildDocument returns a BleveDocument for the k/v pair NOTE: err may be non-nil AND a document is returned this allows the error to be logged, but a stub document to be indexed
func (*BleveDocumentConfig) BuildDocumentEx ¶ added in v0.4.0
func (b *BleveDocumentConfig) BuildDocumentEx(key, val []byte, defaultType string, extrasType cbgt.DestExtrasType, extras []byte) (*BleveDocument, error)
func (*BleveDocumentConfig) BuildDocumentFromObj ¶ added in v0.4.0
func (b *BleveDocumentConfig) BuildDocumentFromObj(key []byte, v interface{}, defaultType string) *BleveDocument
func (*BleveDocumentConfig) DetermineType ¶ added in v0.4.0
func (b *BleveDocumentConfig) DetermineType(key []byte, v interface{}, defaultType string) string
func (*BleveDocumentConfig) MarshalJSON ¶ added in v0.4.0
func (b *BleveDocumentConfig) MarshalJSON() ([]byte, error)
func (*BleveDocumentConfig) UnmarshalJSON ¶ added in v0.4.0
func (b *BleveDocumentConfig) UnmarshalJSON(data []byte) error
type BleveIndexCollector ¶ added in v0.4.0
BleveIndexCollector interface is a subset of the bleve.IndexAlias interface, with just the Add() method, allowing alternative implementations that need to collect "backend" bleve indexes based on a user defined index.
type BleveInterface ¶ added in v0.4.0
type BleveInterface interface{}
type BleveParams ¶ added in v0.0.1
type BleveParams struct {
Mapping mapping.IndexMapping `json:"mapping"`
Store map[string]interface{} `json:"store"`
DocConfig BleveDocumentConfig `json:"doc_config"`
}
BleveParams represents the bleve index params. See also cbgt.IndexDef.Params. A JSON'ified BleveParams looks like...
{
"mapping": {
// See bleve.mapping.IndexMapping.
},
"store": {
// See BleveParamsStore.
},
"doc_config": {
// See BleveDocumentConfig.
}
}
func NewBleveParams ¶ added in v0.0.1
func NewBleveParams() *BleveParams
type BleveParamsStore ¶ added in v0.4.0
type BleveParamsStore struct {
// The indexType defaults to bleve.Config.DefaultIndexType.
// Example: "upside_down". See bleve.index.upsidedown.Name and
// bleve.registry.RegisterIndexType().
IndexType string `json:"indexType"`
// The kvStoreName defaults to bleve.Config.DefaultKVStore.
// See also bleve.registry.RegisterKVStore().
KvStoreName string `json:"kvStoreName"`
// The kvStoreMetricsAllow flag defaults to
// cbft.BleveKVStoreMetricsAllow. When true, an
// interposing wrapper that captures additional metrics will be
// initialized as part of a bleve index's KVStore.
//
// Note: the interposing metrics wrapper might introduce
// additional performance costs.
KvStoreMetricsAllow bool `json:"kvStoreMetricsAllow"`
// The kvStoreMossAllow defaults to true.
//
// The moss cache will be used for a bleve index's KVStore when
// both this kvStoreMossAllow flag and the
// cbft.BlevePIndexAllowMoss global flag are true.
//
// A user can also explicitly specify a kvStoreName of "moss" to
// force usage of the moss cache.
KvStoreMossAllow bool `json:"kvStoreMossAllow"`
// The mossCollectionOptions allows users to specify moss cache
// collection options, with defaults coming from
// moss.DefaultCollectionOptions.
//
// It only applies when a moss cache is in use for an index (see
// kvStoreMossAllow).
MossCollectionOptions moss.CollectionOptions `json:"mossCollectionOptions"`
// The mossLowerLevelStoreName specifies which lower-level
// bleve.index.store.KVStore to use underneath a moss cache.
// See also bleve.registry.RegisterKVStore().
//
// It only applies when a moss cache is in use for an index (see
// kvStoreMossAllow).
//
// As a special case, when moss cache is allowed, and the
// kvStoreName is not "moss", and the mossLowerLevelStoreName is
// unspecified or "", then the system will automatically
// reconfigure as a convenience so that the
// mossLowerLevelStoreName becomes the kvStoreName, and the
// kvStoreName becomes "moss", hence injecting moss cache into
// usage for an index.
//
// In another case, when the kvStoreName is "moss" and the
// mossLowerLevelStoreName is "" (empty string), that means the
// moss cache will run in memory-only mode with no lower-level
// storage.
MossLowerLevelStoreName string `json:"mossLowerLevelStoreName"`
// The mossLowerLevelStoreConfig can be used to provide advanced
// options to the lower-level KVStore that's used under a moss
// cache.
//
// NOTE: when the mossLowerLevelStoreName is "mossStore", the
// mossLowerLevelStoreConfig is not used; instead, please use
// mossStoreOptions.
MossLowerLevelStoreConfig map[string]interface{} `json:"mossLowerLevelStoreConfig"`
// The mossStoreOptions allows the user to specify advanced
// configuration options when moss cache is in use and when the
// mossLowerLevelStoreName is "mossStore",
MossStoreOptions moss.StoreOptions `json:"mossStoreOptions"`
}
BleveParamsStore represents some of the publically available options in the "store" part of a bleve index params. See also the BleveParams.Store field.
type CBAuthBasicLogin ¶ added in v0.4.0
type CBAuthBasicLogin struct {
// contains filtered or unexported fields
}
func CBAuthBasicLoginHandler ¶ added in v0.4.0
func CBAuthBasicLoginHandler(mgr *cbgt.Manager) (*CBAuthBasicLogin, error)
func (*CBAuthBasicLogin) ServeHTTP ¶ added in v0.4.0
func (h *CBAuthBasicLogin) ServeHTTP( w http.ResponseWriter, req *http.Request)
type Collection ¶ added in v0.4.0
type ConciseOptions ¶ added in v0.4.0
type ConciseOptions struct {
// contains filtered or unexported fields
}
func NewConciseOptions ¶ added in v0.4.0
func NewConciseOptions(mgr *cbgt.Manager) *ConciseOptions
func (*ConciseOptions) ServeHTTP ¶ added in v0.4.0
func (h *ConciseOptions) ServeHTTP( w http.ResponseWriter, req *http.Request)
type CustomJSONImpl ¶ added in v0.4.0
type CustomJSONImpl struct {
CustomJSONImplType string
// contains filtered or unexported fields
}
CustomJSONImpl enables the custom json parser is an implementation of JSONParserImplType
var JSONImpl *CustomJSONImpl
JSONImpl holds the custom json parser impl
func (*CustomJSONImpl) Decode ¶ added in v0.4.0
func (p *CustomJSONImpl) Decode(r io.Reader, v interface{}) error
Decode abstracts the underlying json lib used
func (*CustomJSONImpl) Encode ¶ added in v0.4.0
func (p *CustomJSONImpl) Encode(w io.Writer, v interface{}) error
Encode abstracts the underlying json lib used
func (*CustomJSONImpl) GetManagerOptions ¶ added in v0.4.0
func (p *CustomJSONImpl) GetManagerOptions() map[string]string
GetManagerOptions gets the manager options
func (*CustomJSONImpl) GetParserType ¶ added in v0.4.0
func (p *CustomJSONImpl) GetParserType() string
GetParserType returns the custom parser type
func (*CustomJSONImpl) Marshal ¶ added in v0.4.0
func (p *CustomJSONImpl) Marshal(v interface{}) ([]byte, error)
Marshal abstracts the underlying json lib used
func (*CustomJSONImpl) SetManager ¶ added in v0.4.0
func (p *CustomJSONImpl) SetManager(mgr *cbgt.Manager)
SetManager sets the manager instance
func (*CustomJSONImpl) Unmarshal ¶ added in v0.4.0
func (p *CustomJSONImpl) Unmarshal(b []byte, v interface{}) error
Unmarshal abstracts the underlying json lib used
type FilteredListIndexHandler ¶ added in v0.4.0
type FilteredListIndexHandler struct {
// contains filtered or unexported fields
}
FilteredListIndexHandler is a REST handler that lists indexes, similar to cbgt.rest.ListIndexHandler, but filters results based on cbauth permissions.
func NewFilteredListIndexHandler ¶ added in v0.4.0
func NewFilteredListIndexHandler(mgr *cbgt.Manager) *FilteredListIndexHandler
func (*FilteredListIndexHandler) ServeHTTP ¶ added in v0.4.0
func (h *FilteredListIndexHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type GRPCPathStats ¶ added in v0.4.0
type GRPCPathStats struct {
// contains filtered or unexported fields
}
GRPCPathStats represents the stats for a gRPC path spec.
func (*GRPCPathStats) FocusStats ¶ added in v0.4.0
func (s *GRPCPathStats) FocusStats(focusVal string) *RPCFocusStats
FocusStats returns the RPCFocusStats for a given focus value like an indexName
func (*GRPCPathStats) FocusValues ¶ added in v0.4.0
func (s *GRPCPathStats) FocusValues() (rv []string)
FocusValues returns the focus value strings
type GrpcClient ¶ added in v0.4.0
type GrpcClient struct {
Mgr *cbgt.Manager
HostPort string
IndexName string
IndexUUID string
PIndexNames []string
Consistency *cbgt.ConsistencyParams
GrpcCli pb.SearchServiceClient
// contains filtered or unexported fields
}
GrpcClient implements the Search() and DocCount() subset of the bleve.Index interface by accessing a remote cbft server via grpc protocol. This allows callers to add a GrpcClient as a target of a bleve.IndexAlias, and implements cbft protocol features like query consistency and auth.
func GroupGrpcClientsByHostPort ¶ added in v0.4.0
func GroupGrpcClientsByHostPort(clients []*GrpcClient) (rv []*GrpcClient)
GroupGrpcClientsByHostPort groups the gRPC clients by their HostPort, merging the pindexNames. This is an enabler to allow scatter/gather to use fewer gRPC calls.
func (*GrpcClient) AuthType ¶ added in v0.4.0
func (g *GrpcClient) AuthType() string
func (*GrpcClient) Close ¶ added in v0.4.0
func (g *GrpcClient) Close() error
func (*GrpcClient) Count ¶ added in v0.4.0
func (g *GrpcClient) Count() (uint64, error)
func (*GrpcClient) Delete ¶ added in v0.4.0
func (g *GrpcClient) Delete(id string) error
func (*GrpcClient) DeleteInternal ¶ added in v0.4.0
func (g *GrpcClient) DeleteInternal(key []byte) error
func (*GrpcClient) DocCount ¶ added in v0.4.0
func (g *GrpcClient) DocCount() (uint64, error)
func (*GrpcClient) Document ¶ added in v0.4.0
func (g *GrpcClient) Document(id string) (*document.Document, error)
func (*GrpcClient) DumpAll ¶ added in v0.4.0
func (g *GrpcClient) DumpAll() chan interface{}
func (*GrpcClient) DumpDoc ¶ added in v0.4.0
func (g *GrpcClient) DumpDoc(id string) chan interface{}
func (*GrpcClient) DumpFields ¶ added in v0.4.0
func (g *GrpcClient) DumpFields() chan interface{}
func (*GrpcClient) FieldDict ¶ added in v0.4.0
func (g *GrpcClient) FieldDict(field string) (index.FieldDict, error)
func (*GrpcClient) FieldDictPrefix ¶ added in v0.4.0
func (*GrpcClient) FieldDictRange ¶ added in v0.4.0
func (*GrpcClient) Fields ¶ added in v0.4.0
func (g *GrpcClient) Fields() ([]string, error)
func (*GrpcClient) GetHostPort ¶ added in v0.4.0
func (g *GrpcClient) GetHostPort() string
func (*GrpcClient) GetInternal ¶ added in v0.4.0
func (g *GrpcClient) GetInternal(key []byte) ([]byte, error)
func (*GrpcClient) GetLast ¶ added in v0.4.0
func (g *GrpcClient) GetLast() (int, []byte)
func (*GrpcClient) Index ¶ added in v0.4.0
func (g *GrpcClient) Index(id string, data interface{}) error
func (*GrpcClient) Mapping ¶ added in v0.4.0
func (g *GrpcClient) Mapping() mapping.IndexMapping
func (*GrpcClient) Name ¶ added in v0.4.0
func (g *GrpcClient) Name() string
func (*GrpcClient) NewBatch ¶ added in v0.4.0
func (g *GrpcClient) NewBatch() *bleve.Batch
func (*GrpcClient) Query ¶ added in v0.4.0
func (g *GrpcClient) Query(ctx context.Context, req *scatterRequest) (*bleve.SearchResult, error)
func (*GrpcClient) Search ¶ added in v0.4.0
func (g *GrpcClient) Search(req *bleve.SearchRequest) ( *bleve.SearchResult, error)
func (*GrpcClient) SearchInContext ¶ added in v0.4.0
func (g *GrpcClient) SearchInContext(ctx context.Context, req *bleve.SearchRequest) (*bleve.SearchResult, error)
func (*GrpcClient) SearchRPC ¶ added in v0.4.0
func (g *GrpcClient) SearchRPC(ctx context.Context, req *scatterRequest, pbReq *pb.SearchRequest) (*bleve.SearchResult, error)
func (*GrpcClient) SetInternal ¶ added in v0.4.0
func (g *GrpcClient) SetInternal(key, val []byte) error
func (*GrpcClient) SetName ¶ added in v0.4.0
func (g *GrpcClient) SetName(name string)
func (*GrpcClient) SetStreamHandler ¶ added in v0.4.0
func (g *GrpcClient) SetStreamHandler(sc streamHandler)
func (*GrpcClient) Stats ¶ added in v0.4.0
func (g *GrpcClient) Stats() *bleve.IndexStat
func (*GrpcClient) StatsMap ¶ added in v0.4.0
func (g *GrpcClient) StatsMap() map[string]interface{}
type IndexAuditLog ¶ added in v0.4.0
type IndexAuditLog struct {
audit.GenericFields
IndexName string `json:"index_name"`
}
type IndexClient ¶ added in v0.0.1
type IndexClient struct {
HostPort string
IndexName string
IndexUUID string
PIndexNames []string
QueryURL string
CountURL string
Consistency *cbgt.ConsistencyParams
// contains filtered or unexported fields
}
IndexClient implements the Search() and DocCount() subset of the bleve.Index interface by accessing a remote cbft server via REST protocol. This allows callers to add a IndexClient as a target of a bleve.IndexAlias, and implements cbft protocol features like query consistency and auth.
TODO: Implement propagating auth info in IndexClient.
func GroupIndexClientsByHostPort ¶ added in v0.4.0
func GroupIndexClientsByHostPort(clients []*IndexClient) (rv []*IndexClient, err error)
GroupIndexClientsByHostPort groups the index clients by their HostPort, merging the pindexNames. This is an enabler to allow scatter/gather to use fewer REST requests/connections.
func (*IndexClient) AuthType ¶ added in v0.4.0
func (r *IndexClient) AuthType() string
func (*IndexClient) Close ¶ added in v0.0.1
func (r *IndexClient) Close() error
func (*IndexClient) Count ¶ added in v0.0.1
func (r *IndexClient) Count() (uint64, error)
func (*IndexClient) Delete ¶ added in v0.0.1
func (r *IndexClient) Delete(id string) error
func (*IndexClient) DeleteInternal ¶ added in v0.0.1
func (r *IndexClient) DeleteInternal(key []byte) error
func (*IndexClient) DocCount ¶ added in v0.0.1
func (r *IndexClient) DocCount() (uint64, error)
func (*IndexClient) Document ¶ added in v0.0.1
func (r *IndexClient) Document(id string) (*document.Document, error)
func (*IndexClient) DumpAll ¶ added in v0.0.1
func (r *IndexClient) DumpAll() chan interface{}
func (*IndexClient) DumpDoc ¶ added in v0.0.1
func (r *IndexClient) DumpDoc(id string) chan interface{}
func (*IndexClient) DumpFields ¶ added in v0.0.1
func (r *IndexClient) DumpFields() chan interface{}
func (*IndexClient) FieldDict ¶ added in v0.0.1
func (r *IndexClient) FieldDict(field string) (index.FieldDict, error)
func (*IndexClient) FieldDictPrefix ¶ added in v0.0.1
func (*IndexClient) FieldDictRange ¶ added in v0.0.1
func (*IndexClient) Fields ¶ added in v0.0.1
func (r *IndexClient) Fields() ([]string, error)
func (*IndexClient) GetHostPort ¶ added in v0.4.0
func (r *IndexClient) GetHostPort() string
func (*IndexClient) GetInternal ¶ added in v0.0.1
func (r *IndexClient) GetInternal(key []byte) ([]byte, error)
func (*IndexClient) GetLast ¶ added in v0.4.0
func (r *IndexClient) GetLast() (int, []byte)
func (*IndexClient) Index ¶ added in v0.0.1
func (r *IndexClient) Index(id string, data interface{}) error
func (*IndexClient) Mapping ¶ added in v0.0.1
func (r *IndexClient) Mapping() mapping.IndexMapping
func (*IndexClient) Name ¶ added in v0.4.0
func (r *IndexClient) Name() string
func (*IndexClient) NewBatch ¶ added in v0.0.1
func (r *IndexClient) NewBatch() *bleve.Batch
func (*IndexClient) Search ¶ added in v0.0.1
func (r *IndexClient) Search(req *bleve.SearchRequest) ( *bleve.SearchResult, error)
func (*IndexClient) SearchInContext ¶ added in v0.4.0
func (r *IndexClient) SearchInContext(ctx context.Context, req *bleve.SearchRequest) (*bleve.SearchResult, error)
func (*IndexClient) SetInternal ¶ added in v0.0.1
func (r *IndexClient) SetInternal(key, val []byte) error
func (*IndexClient) SetName ¶ added in v0.4.0
func (r *IndexClient) SetName(name string)
func (*IndexClient) SetStreamHandler ¶ added in v0.4.0
func (r *IndexClient) SetStreamHandler(s streamHandler)
func (*IndexClient) Stats ¶ added in v0.0.1
func (r *IndexClient) Stats() *bleve.IndexStat
func (*IndexClient) StatsMap ¶ added in v0.4.0
func (r *IndexClient) StatsMap() map[string]interface{}
type IndexControlAuditLog ¶ added in v0.4.0
type JSONStatsWriter ¶ added in v0.0.1
type LowerLevelStoreHolder ¶ added in v0.4.0
type ManagerOptionsExt ¶ added in v0.4.0
type ManagerOptionsExt struct {
// contains filtered or unexported fields
}
ManagerOptionsExt is a REST handler that serves as a wrapper for ManagerOptions - where it sets the manager options, and updates the logLevel upon request.
func NewManagerOptionsExt ¶ added in v0.4.0
func NewManagerOptionsExt(mgr *cbgt.Manager) *ManagerOptionsExt
func (*ManagerOptionsExt) ServeHTTP ¶ added in v0.4.0
func (h *ManagerOptionsExt) ServeHTTP( w http.ResponseWriter, req *http.Request)
type Manifest ¶ added in v0.4.0
func GetBucketManifest ¶ added in v0.4.0
type MissingPIndex ¶ added in v0.4.0
type MissingPIndex struct {
// contains filtered or unexported fields
}
func (*MissingPIndex) Close ¶ added in v0.4.0
func (m *MissingPIndex) Close() error
func (*MissingPIndex) Delete ¶ added in v0.4.0
func (m *MissingPIndex) Delete(id string) error
func (*MissingPIndex) DeleteInternal ¶ added in v0.4.0
func (m *MissingPIndex) DeleteInternal(key []byte) error
func (*MissingPIndex) DocCount ¶ added in v0.4.0
func (m *MissingPIndex) DocCount() (uint64, error)
func (*MissingPIndex) Document ¶ added in v0.4.0
func (m *MissingPIndex) Document(id string) (*document.Document, error)
func (*MissingPIndex) DumpAll ¶ added in v0.4.0
func (m *MissingPIndex) DumpAll() chan interface{}
func (*MissingPIndex) DumpDoc ¶ added in v0.4.0
func (m *MissingPIndex) DumpDoc(id string) chan interface{}
func (*MissingPIndex) DumpFields ¶ added in v0.4.0
func (m *MissingPIndex) DumpFields() chan interface{}
func (*MissingPIndex) FieldDict ¶ added in v0.4.0
func (m *MissingPIndex) FieldDict(field string) (index.FieldDict, error)
func (*MissingPIndex) FieldDictPrefix ¶ added in v0.4.0
func (*MissingPIndex) FieldDictRange ¶ added in v0.4.0
func (*MissingPIndex) Fields ¶ added in v0.4.0
func (m *MissingPIndex) Fields() ([]string, error)
func (*MissingPIndex) GetInternal ¶ added in v0.4.0
func (m *MissingPIndex) GetInternal(key []byte) ([]byte, error)
func (*MissingPIndex) Index ¶ added in v0.4.0
func (m *MissingPIndex) Index(id string, data interface{}) error
func (*MissingPIndex) Mapping ¶ added in v0.4.0
func (m *MissingPIndex) Mapping() mapping.IndexMapping
func (*MissingPIndex) Name ¶ added in v0.4.0
func (m *MissingPIndex) Name() string
func (*MissingPIndex) NewBatch ¶ added in v0.4.0
func (m *MissingPIndex) NewBatch() *bleve.Batch
func (*MissingPIndex) Search ¶ added in v0.4.0
func (m *MissingPIndex) Search(req *bleve.SearchRequest) ( *bleve.SearchResult, error)
func (*MissingPIndex) SearchInContext ¶ added in v0.4.0
func (m *MissingPIndex) SearchInContext(ctx context.Context, req *bleve.SearchRequest) (*bleve.SearchResult, error)
func (*MissingPIndex) SetInternal ¶ added in v0.4.0
func (m *MissingPIndex) SetInternal(key, val []byte) error
func (*MissingPIndex) SetName ¶ added in v0.4.0
func (m *MissingPIndex) SetName(name string)
func (*MissingPIndex) Stats ¶ added in v0.4.0
func (m *MissingPIndex) Stats() *bleve.IndexStat
func (*MissingPIndex) StatsMap ¶ added in v0.4.0
func (m *MissingPIndex) StatsMap() map[string]interface{}
type MossStoreActualHolder ¶ added in v0.4.0
type NSIndexStats ¶ added in v0.3.0
func (NSIndexStats) MarshalJSON ¶ added in v0.3.0
func (n NSIndexStats) MarshalJSON() ([]byte, error)
MarshalJSON formats the index stats using the colon separated convention found in other stats consumed by ns_server
type NodeDefsFetcher ¶ added in v0.4.0
type NodeDefsFetcher struct {
// contains filtered or unexported fields
}
var CurrentNodeDefsFetcher *NodeDefsFetcher
func (*NodeDefsFetcher) Get ¶ added in v0.4.0
func (ndf *NodeDefsFetcher) Get() (*cbgt.NodeDefs, error)
func (*NodeDefsFetcher) GetManager ¶ added in v0.4.0
func (ndf *NodeDefsFetcher) GetManager() *cbgt.Manager
func (*NodeDefsFetcher) SetManager ¶ added in v0.4.0
func (ndf *NodeDefsFetcher) SetManager(mgr *cbgt.Manager)
type NsSearchResultRedirct ¶ added in v0.4.0
type NsSearchResultRedirct struct {
// contains filtered or unexported fields
}
func NsSearchResultRedirctHandler ¶ added in v0.4.0
func NsSearchResultRedirctHandler(mgr *cbgt.Manager) (*NsSearchResultRedirct, error)
func (*NsSearchResultRedirct) ServeHTTP ¶ added in v0.4.0
func (h *NsSearchResultRedirct) ServeHTTP( w http.ResponseWriter, req *http.Request)
type NsStatsHandler ¶ added in v0.3.0
type NsStatsHandler struct {
// contains filtered or unexported fields
}
NsStatsHandler is a REST handler that provides stats/metrics for consumption by ns_server
func NewNsStatsHandler ¶ added in v0.3.0
func NewNsStatsHandler(mgr *cbgt.Manager) *NsStatsHandler
func (*NsStatsHandler) ServeHTTP ¶ added in v0.3.0
func (h *NsStatsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type NsStatusHandler ¶ added in v0.3.0
type NsStatusHandler struct {
// contains filtered or unexported fields
}
NsStatusHandler is a REST handler that provides status for consumption by ns_server
func NewNsStatusHandler ¶ added in v0.3.0
func NewNsStatusHandler(mgr *cbgt.Manager, server string) (*NsStatusHandler, error)
func (*NsStatusHandler) ServeHTTP ¶ added in v0.3.0
func (h *NsStatusHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type PartitionSelectionStrategy ¶ added in v0.4.0
type PartitionSelectionStrategy string
PartitionSelectionStrategy lets clients specify any selection preferences for the query serving index partitions spread across the cluster. PartitionSelectionStrategy recognized options are,
- "" : primary partitions are selected
- local : local partitions are favored, pseudorandom selection from remote
- random : pseudorandom selection from available local and remote
- random_balanced : pseudorandom selection from available local and remote nodes by equally distributing the query load across all nodes.
type PartitionSeqsProvider ¶ added in v0.4.0
type PartitionSeqsProvider interface {
// Returned map is keyed by partition id.
PartitionSeqs() (map[string]cbgt.UUIDSeq, error)
}
PartitionSeqsProvider represents source object that can provide partition seqs, such as some pindex or dest implementations.
type QueryEvent ¶ added in v0.4.0
type QueryEvent struct {
Kind QueryEventKind
Duration time.Duration
}
type QueryEventKind ¶ added in v0.4.0
type QueryEventKind int
QueryEventKind represents an event code for OnEvent() callbacks.
type QueryKiller ¶ added in v0.4.0
type QueryKiller struct{}
func NewQueryKiller ¶ added in v0.4.0
func NewQueryKiller() *QueryKiller
func (*QueryKiller) ServeHTTP ¶ added in v0.4.0
func (qk *QueryKiller) ServeHTTP( w http.ResponseWriter, req *http.Request)
type QueryPIndexes ¶ added in v0.4.0
type QueryPIndexes struct {
// An empty or nil PIndexNames means the query should use all
// the pindexes of the index.
PIndexNames []string `json:"pindexNames,omitempty"`
}
QueryPIndexes defines the part of the JSON query request that allows the client to specify which pindexes the server should consider during query processing.
type QuerySupervisor ¶ added in v0.4.0
type QuerySupervisor struct {
// contains filtered or unexported fields
}
func (*QuerySupervisor) AddEntry ¶ added in v0.4.0
func (qs *QuerySupervisor) AddEntry(qsc *QuerySupervisorContext) uint64
func (*QuerySupervisor) Count ¶ added in v0.4.0
func (qs *QuerySupervisor) Count() uint64
func (*QuerySupervisor) DeleteEntry ¶ added in v0.4.0
func (qs *QuerySupervisor) DeleteEntry(id uint64)
func (*QuerySupervisor) ExecutionTime ¶ added in v0.4.0
func (qs *QuerySupervisor) ExecutionTime(id uint64) (time.Duration, bool)
func (*QuerySupervisor) GetLastAccessTimeForIndex ¶ added in v0.4.0
func (qs *QuerySupervisor) GetLastAccessTimeForIndex(name string) string
func (*QuerySupervisor) KillQuery ¶ added in v0.4.0
func (qs *QuerySupervisor) KillQuery(id uint64) bool
func (*QuerySupervisor) ListLongerThan ¶ added in v0.4.0
func (qs *QuerySupervisor) ListLongerThan(longerThan time.Duration) map[uint64]*RunningQueryDetails
type QuerySupervisorContext ¶ added in v0.4.0
type QuerySupervisorDetails ¶ added in v0.4.0
type QuerySupervisorDetails struct{}
func NewQuerySupervisorDetails ¶ added in v0.4.0
func NewQuerySupervisorDetails() *QuerySupervisorDetails
func (*QuerySupervisorDetails) ServeHTTP ¶ added in v0.4.0
func (qss *QuerySupervisorDetails) ServeHTTP( w http.ResponseWriter, req *http.Request)
type RPCFocusStats ¶ added in v0.4.0
type RPCFocusStats struct {
TotGrpcRequest uint64
TotGrpcRequestTimeNS uint64
TotGrpcRequestErr uint64 `json:"TotGrpcRequestErr,omitempty"`
TotGrpcRequestSlow uint64 `json:"TotGrpcRequestSlow,omitempty"`
TotGrpcRequestTimeout uint64 `json:"TotGrpcRequestTimeout,omitempty"`
TotGrpcResponseBytes uint64 `json:"TotGrpcResponseBytes,omitempty"`
TotGrpcInternalRequest uint64
TotGrpcInternalRequestTimeNS uint64
}
RPCFocusStats represents stats for a targeted or "focused" gRPC endpoint.
type RemoteClient ¶ added in v0.4.0
type RemoteClient interface {
bleve.Index
GetHostPort() string
GetLast() (int, []byte)
SetStreamHandler(streamHandler)
}
RemoteClient represents a generic interface to be implemented by all remote clients like IndexClient/GrpcClient.
type RunningQueryDetails ¶ added in v0.4.0
type Scope ¶ added in v0.4.0
type Scope struct {
Name string `json:"name"`
Uid string `json:"uid"`
Collections []Collection `json:"collections"`
}
type SearchRequest ¶ added in v0.4.0
type SearchRequest struct {
Q json.RawMessage `json:"query"`
Size *int `json:"size"`
From *int `json:"from"`
Highlight *bleve.HighlightRequest `json:"highlight"`
Fields []string `json:"fields"`
Facets bleve.FacetsRequest `json:"facets"`
Explain bool `json:"explain"`
Sort []json.RawMessage `json:"sort"`
IncludeLocations bool `json:"includeLocations"`
Score string `json:"score,omitempty"`
SearchAfter []string `json:"search_after,omitempty"`
SearchBefore []string `json:"search_before,omitempty"`
Limit *int `json:"limit,omitempty"`
Offset *int `json:"offset,omitempty"`
}
func (*SearchRequest) ConvertToBleveSearchRequest ¶ added in v0.4.0
func (sr *SearchRequest) ConvertToBleveSearchRequest() (*bleve.SearchRequest, error)
type SearchService ¶ added in v0.4.0
type SearchService struct {
// contains filtered or unexported fields
}
SearchService is an implementation for the SearchSrvServer gRPC search interface
func (*SearchService) Check ¶ added in v0.4.0
func (s *SearchService) Check(ctx context.Context, in *pb.HealthCheckRequest) (*pb.HealthCheckResponse, error)
func (*SearchService) DocCount ¶ added in v0.4.0
func (s *SearchService) DocCount(ctx context.Context, req *pb.DocCountRequest) (*pb.DocCountResult, error)
func (*SearchService) Search ¶ added in v0.4.0
func (s *SearchService) Search(req *pb.SearchRequest, stream pb.SearchService_SearchServer) (err error)
func (*SearchService) SetManager ¶ added in v0.4.0
func (s *SearchService) SetManager(mgr *cbgt.Manager)
type SourcePartitionSeqs ¶ added in v0.4.0
Source Files
¶
- audit.go
- bindata_assetfs.go
- bleve_metrics.go
- cache.go
- cache_bleve.go
- collection_utils.go
- extras.go
- grpc_auth.go
- grpc_client.go
- grpc_server.go
- grpc_util.go
- manifest.go
- marshal.go
- missing.go
- ns_server.go
- pindex_alias.go
- pindex_bleve.go
- pindex_bleve_delete.go
- pindex_bleve_doc.go
- pindex_bleve_moss_rollback.go
- pindex_bleve_rollback.go
- pindex_bleve_scorch_rollback.go
- pindex_rest_handlers.go
- query_event.go
- query_supervisor.go
- remote.go
- rest.go
- rest_auth.go
- rest_list.go
- rest_options.go
- rest_perm.go
- search.go
- stream.go
- unmarshal.go
- version.go
