Documentation ¶
Index ¶
- func RegisterRemoteInterfaceFactory(protocol string, factory RemoteInterfaceFactory)
- func TimeSpansOverlap(t1 TimeSpan, t2 TimeSpan) bool
- type AUID
- type AvailabilitySpan
- type BasicAvailability
- type BasicChannel
- type ChannelAndAvailability
- type ChannelHandler
- type ChannelListHash
- type ChannelPredicate
- type ChannelView
- func (db *ChannelView) ApplyToChannelsIf(handler ChannelHandler, pred ChannelPredicate, span common.TimeSpan)
- func (db *ChannelView) ApplyToChannelsIfConstrained(handler ChannelHandler, pred ChannelPredicate, epoch common.TimeSpan)
- func (db *ChannelView) ResolveChannel(reference common.BasicChannel, epoch common.TimeSpan) (*ChannelAndAvailability, bool)
- type FrameExistence
- type FrameType
- type FrameTypeRegistrar
- type FrameView
- func (fv *FrameView) Copy() FrameView
- func (fv *FrameView) FrameExistance(frameIndex int) []TimeSpan
- func (fv *FrameView) FrameExistsAt(frameIndex int, second common.GpsSecond) bool
- func (fv *FrameView) FrameIndex(frameType string) int
- func (fv *FrameView) GetFrameType(index int) (string, bool)
- func (fv *FrameView) GetTransactionalSpan(index int) (*TransactionalSpan, string, bool)
- type GpsSecond
- type InternalJSONDB
- type JsonDBFrameInfo
- type MetaDataStore
- func LoadDatabaseFromChannelLists(channelLists []string, frameServer common.FrameServer) *MetaDataStore
- func LoadDatabaseFromFrames(framePath, jsonPath string) (*MetaDataStore, error)
- func LoadDatabaseFromJsonDB(path string) (*MetaDataStore, error)
- func LoadDatabaseFromReplicationStream(reader io.Reader) (*MetaDataStore, error)
- func (db *MetaDataStore) AddRemote(remote RemoteDataStore) error
- func (db *MetaDataStore) DebugDump(dest io.Writer, maxDump int)
- func (db *MetaDataStore) FrameFileIntervals(frameType string, span common.TimeSpan) []common.TimeSpan
- func (db *MetaDataStore) FrameFilePaths(frameType string, span common.TimeSpan) []string
- func (mds *MetaDataStore) FrameView() *FrameView
- func (db *MetaDataStore) GetChannelView(requiredPrefix string) ChannelView
- func (mds *MetaDataStore) GetRemoteProxy(prefix string) (RemoteProxyInterface, error)
- func (db *MetaDataStore) GetReplicationSummary() ReplicationHeader
- func (db *MetaDataStore) ReplicationStream(dest io.Writer, summaryRequest SummaryRequest) error
- func (db *MetaDataStore) SetExternalFrameServer(server common.FrameServer)
- func (db *MetaDataStore) UpdateRemotes() error
- type RemoteDataStore
- type RemoteInterface
- type RemoteInterfaceFactory
- type RemoteProxyInterface
- type ReplicationHeader
- type ResolveChanEvaluator
- type SummaryRequest
- type TimeSpan
- func (ts *TimeSpan) Contains(second common.GpsSecond) bool
- func (ts *TimeSpan) Empty() bool
- func (ts *TimeSpan) End() GpsSecond
- func (ts *TimeSpan) Extend(new_end GpsSecond)
- func (ts *TimeSpan) MarshalJSON() ([]byte, error)
- func (ts *TimeSpan) Start() GpsSecond
- func (ts *TimeSpan) ToCommon() common.TimeSpan
- func (ts *TimeSpan) UnmarshalJSON(data []byte) error
- type TransactionalSpan
- type WriteOperation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRemoteInterfaceFactory ¶
func RegisterRemoteInterfaceFactory(protocol string, factory RemoteInterfaceFactory)
Types ¶
type AvailabilitySpan ¶
type BasicAvailability ¶
type BasicAvailability struct { Existence TimeSpan Availability []AvailabilitySpan }
func (*BasicAvailability) MarshalJSON ¶
func (ba *BasicAvailability) MarshalJSON() ([]byte, error)
func (*BasicAvailability) UnmarshalJSON ¶
func (ba *BasicAvailability) UnmarshalJSON(data []byte) error
type BasicChannel ¶
type BasicChannel = common.BasicChannel
type ChannelAndAvailability ¶
type ChannelAndAvailability struct { Channel BasicChannel `json:"c"` Avail BasicAvailability `json:"a"` Local bool `json:"-"` }
func (*ChannelAndAvailability) ExistsDuring ¶
func (c *ChannelAndAvailability) ExistsDuring(span common.TimeSpan) bool
type ChannelHandler ¶
type ChannelHandler = func(availability *ChannelAndAvailability)
type ChannelPredicate ¶
type ChannelPredicate interface {
Matches(channel *BasicChannel) bool
}
type ChannelView ¶
type ChannelView struct {
// contains filtered or unexported fields
}
A view into a list of channels
This is commonly used with the meta data store to view the channels or a subset of the channels. This acts as a read only view of a channel list.
func (*ChannelView) ApplyToChannelsIf ¶
func (db *ChannelView) ApplyToChannelsIf(handler ChannelHandler, pred ChannelPredicate, span common.TimeSpan)
func (*ChannelView) ApplyToChannelsIfConstrained ¶
func (db *ChannelView) ApplyToChannelsIfConstrained(handler ChannelHandler, pred ChannelPredicate, epoch common.TimeSpan)
func (*ChannelView) ResolveChannel ¶
func (db *ChannelView) ResolveChannel(reference common.BasicChannel, epoch common.TimeSpan) (*ChannelAndAvailability, bool)
Given a reference channel find the best match in the channel database. The name must match, and any concretely specified attributes (rate, class, data type) must match. If the attributes are specified as masks (ie unknown) they match the attribute based on a bitwise check
type FrameType ¶
type FrameType struct { // Label, non-empty for frames from an external server FrameLabel string // base name of the frame type FrameName string // A combination of the label and frame type PrintName string }
Describe a frame type
type FrameTypeRegistrar ¶
type FrameTypeRegistrar struct {
// contains filtered or unexported fields
}
func CreateFrameTypeRegistrar ¶
func CreateFrameTypeRegistrar() *FrameTypeRegistrar
func (*FrameTypeRegistrar) AddChannelListFile ¶
func (fr *FrameTypeRegistrar) AddChannelListFile(fname string)
func (*FrameTypeRegistrar) AddChannelListFromReader ¶
func (fr *FrameTypeRegistrar) AddChannelListFromReader(input io.Reader)
type FrameView ¶
type FrameView struct {
// contains filtered or unexported fields
}
Get a view onto the frame database
func (*FrameView) Copy ¶
Create a deepish copy of the FrameView It keeps the same transactional spans
func (*FrameView) FrameExistsAt ¶
type InternalJSONDB ¶
type InternalJSONDB struct { Channels []ChannelAndAvailability `json:"channels"` FrameTypes map[string]int Frames [][]JsonDBFrameInfo FrameSource string }
type JsonDBFrameInfo ¶
type MetaDataStore ¶
type MetaDataStore struct {
// contains filtered or unexported fields
}
to handle remote servers and combining channel lists we need a few things
- a list of remote servers
- Each server has a unique label that is added as a prefix to the frame type any channels available through a 'marked' frame type are thus marked as from an external server
func LoadDatabaseFromChannelLists ¶
func LoadDatabaseFromChannelLists(channelLists []string, frameServer common.FrameServer) *MetaDataStore
func LoadDatabaseFromFrames ¶
func LoadDatabaseFromFrames(framePath, jsonPath string) (*MetaDataStore, error)
func LoadDatabaseFromJsonDB ¶
func LoadDatabaseFromJsonDB(path string) (*MetaDataStore, error)
func LoadDatabaseFromReplicationStream ¶
func LoadDatabaseFromReplicationStream(reader io.Reader) (*MetaDataStore, error)
func (*MetaDataStore) AddRemote ¶
func (db *MetaDataStore) AddRemote(remote RemoteDataStore) error
Add a remote server to data store. Remote servers have their channel lists combined with the local server
func (*MetaDataStore) DebugDump ¶
func (db *MetaDataStore) DebugDump(dest io.Writer, maxDump int)
func (*MetaDataStore) FrameFileIntervals ¶
func (*MetaDataStore) FrameFilePaths ¶
func (db *MetaDataStore) FrameFilePaths(frameType string, span common.TimeSpan) []string
func (*MetaDataStore) FrameView ¶
func (mds *MetaDataStore) FrameView() *FrameView
func (*MetaDataStore) GetChannelView ¶
func (db *MetaDataStore) GetChannelView(requiredPrefix string) ChannelView
func (*MetaDataStore) GetRemoteProxy ¶
func (mds *MetaDataStore) GetRemoteProxy(prefix string) (RemoteProxyInterface, error)
func (*MetaDataStore) GetReplicationSummary ¶
func (db *MetaDataStore) GetReplicationSummary() ReplicationHeader
func (*MetaDataStore) ReplicationStream ¶
func (db *MetaDataStore) ReplicationStream(dest io.Writer, summaryRequest SummaryRequest) error
func (*MetaDataStore) SetExternalFrameServer ¶
func (db *MetaDataStore) SetExternalFrameServer(server common.FrameServer)
func (*MetaDataStore) UpdateRemotes ¶
func (db *MetaDataStore) UpdateRemotes() error
Query each registered remote server for updates and modify the channel/frame list as needed.
Currently errors stop progress ¶
Note this process may take signifigant time and generate a fair amount of garbage for the GC.
This can (and should) be called periodically to keep the lists updated.
type RemoteDataStore ¶
Describes a remote endpoint that the metadata store pools data with This is to allow the metadata server to consume and distribute metadata with a network of servers serving a global multi site set of data.
Note this is distinct from replication which is to simply mirror a server.
type RemoteInterface ¶
type RemoteInterface interface { ReplicationSummary() (ReplicationHeader, error) ReplicationStream(summary SummaryRequest) (io.ReadCloser, error) RemoteProxyInterface }
func GetRemoteInterface ¶
func GetRemoteInterface(connStr string) (RemoteInterface, error)
type RemoteInterfaceFactory ¶
type RemoteInterfaceFactory func(string) (RemoteInterface, error)
type RemoteProxyInterface ¶
type ReplicationHeader ¶
type ResolveChanEvaluator ¶
type ResolveChanEvaluator struct {
// contains filtered or unexported fields
}
func CreateResolveChanEvaluator ¶
func CreateResolveChanEvaluator(reference common.BasicChannel, timespan common.TimeSpan) *ResolveChanEvaluator
func (*ResolveChanEvaluator) Match ¶
func (rc *ResolveChanEvaluator) Match() (*ChannelAndAvailability, bool)
func (*ResolveChanEvaluator) Process ¶
func (rc *ResolveChanEvaluator) Process(chanAndAvail *ChannelAndAvailability)
type SummaryRequest ¶
type SummaryRequest struct { ChannelConfigHash string `json:"channel_config"` FrameState map[string]common.GpsSecond `json:"frame_state"` }
Information used to make an optimized replication dumps. An unconfigured/empty struct denotes that everything should be dumped If the ChannelConfigHash is set, the channels are omitted if the metadata store channel config matches the given hash if the FrameState is specified, only updates passed those frame ranges are sent
type TimeSpan ¶
type TimeSpan struct {
// contains filtered or unexported fields
}
type TransactionalSpan ¶
type TransactionalSpan struct {
// contains filtered or unexported fields
}
func CreateTransactionalSpan ¶
func CreateTransactionalSpan(input []common.TimeSpan) *TransactionalSpan
func (*TransactionalSpan) Read ¶
func (ts *TransactionalSpan) Read() FrameExistence
func (*TransactionalSpan) Write ¶
func (ts *TransactionalSpan) Write(updater WriteOperation)
type WriteOperation ¶
type WriteOperation func(FrameExistence) FrameExistence