Documentation ¶
Index ¶
- func ByteArrayToHex(bytes []byte) string
- func GetQualifiedSeriesName(domain string, sf string, distributionId uint16, id ident.ID) string
- func GetQualifiers(qualifiedSeriesName string) (string, string, int, string)
- func GetSeriesName(qualifiedSeriesName string) string
- func GetSymbolTableName(qualifiedSeriesName string) string
- func SingleStreamSymbolTableStreamNameResolver(qualifiedSeriesId ident.ID) string
- type AttributeEncoding
- type AttributeTable
- type M3DBSymStreamReader
- func (sr *M3DBSymStreamReader) Next() (uint16, uint32, TableInstruction, error)
- func (sr *M3DBSymStreamReader) ReadAttributeInstruction() (string, AttributeEncoding, []uint64, error)
- func (sr *M3DBSymStreamReader) ReadInitInstruction() ([]string, error)
- func (sr *M3DBSymStreamReader) ReadUpdateInstruction() ([]string, error)
- func (sr *M3DBSymStreamReader) Seek(startTime xtime.UnixNano, endTime xtime.UnixNano) error
- type M3DBSymStreamWriter
- func (su *M3DBSymStreamWriter) Wait(timeout time.Duration) error
- func (su *M3DBSymStreamWriter) WriteAttributeInstruction(version uint16, sequenceNum uint32, attributeName string, ...) error
- func (su *M3DBSymStreamWriter) WriteEndInstruction(version uint16, sequenceNum uint32, completionFn WriteCompletionFn) error
- func (su *M3DBSymStreamWriter) WriteInitInstruction(version uint16, attributeValues []string, completionFn WriteCompletionFn) error
- func (su *M3DBSymStreamWriter) WriteUpdateInstruction(version uint16, sequenceNum uint32, attributeValues []string, ...) error
- type SeriesFamily
- type SymStreamReader
- type SymStreamWriter
- type SymTable
- func (sym *SymTable) AttributeValueExists(value string) bool
- func (sym *SymTable) Finalize()
- func (sym *SymTable) FindAttributeIndex(name string, value string) int
- func (sym *SymTable) FindAttributeValue(name string, index uint64) string
- func (sym *SymTable) GetAttributesFromIndexedHeader(header []int) map[string]string
- func (sym *SymTable) GetIndexedHeader(attributes map[string]string) ([]int, bool)
- func (sym *SymTable) InsertAttributeIndices(name string, indices []uint64, writeCompleteFn WriteCompletionFn) error
- func (sym *SymTable) InsertAttributeValue(name string, value string, writeCompleteFn WriteCompletionFn) error
- func (sym *SymTable) IsSame(other *SymTable) bool
- func (sym *SymTable) Name() string
- func (sym *SymTable) NumAttributes() int
- func (sym *SymTable) NumSymbols() int
- func (sym *SymTable) UpdateDictionary(attributeValues []string, writeCompleteFn WriteCompletionFn) error
- func (sym *SymTable) Version() uint16
- func (sym *SymTable) Wait(timeout time.Duration)
- type SymbolTableStreamNameResolver
- type TableInstruction
- type WriteCompletionFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteArrayToHex ¶
Byte array to hex convert helper (used for easy printing)
func GetQualifiedSeriesName ¶
Return the fully qualified data series name from the series id
func GetQualifiers ¶
Return the qualifiers from the qualified series name
func GetSeriesName ¶
Return the series name from the qualified name
func GetSymbolTableName ¶
Return the symbol table name from the qualified series name
Types ¶
type AttributeEncoding ¶
type AttributeEncoding int
Supported attribute encodings
const ( // Values are encoded as raw unsigned values UnsignedNumericValue AttributeEncoding = iota // Dictionary encoding. AttributeTable will index into to a dictionary. DictionaryEncodedValue )
type AttributeTable ¶
type AttributeTable struct {
// contains filtered or unexported fields
}
All symbols part of an attribute are indexed seperately.
type M3DBSymStreamReader ¶
type M3DBSymStreamReader struct {
// contains filtered or unexported fields
}
Implements the SymStreamReader to read the symbol table to an m3db time series
func NewM3DBSymStreamReader ¶
func (*M3DBSymStreamReader) Next ¶
func (sr *M3DBSymStreamReader) Next() (uint16, uint32, TableInstruction, error)
Read the next instruction from the stream and return the version, sequence number and the instruction. If End of stream is reached, returns NOPInstruction. Otherwise, return error.
func (*M3DBSymStreamReader) ReadAttributeInstruction ¶
func (sr *M3DBSymStreamReader) ReadAttributeInstruction() (string, AttributeEncoding, []uint64, error)
Read AddAttribute instruction parameter from the current position in the stream. If the current instruction is not AddAttribute, return error.
func (*M3DBSymStreamReader) ReadInitInstruction ¶
func (sr *M3DBSymStreamReader) ReadInitInstruction() ([]string, error)
Read InitSymTable instruction parameter from the current position in the stream. If the current instruction is not InitSymTable, return error.
func (*M3DBSymStreamReader) ReadUpdateInstruction ¶
func (sr *M3DBSymStreamReader) ReadUpdateInstruction() ([]string, error)
Read UpdateSymTable instruction parameter from the current position in the stream. If the current instruction is not UpdateSymTable, return error.
type M3DBSymStreamWriter ¶
type M3DBSymStreamWriter struct {
// contains filtered or unexported fields
}
Implements the SymStreamWriter to write the symbol table to an m3db time series
func NewM3DBSymStreamWriter ¶
func (*M3DBSymStreamWriter) Wait ¶
func (su *M3DBSymStreamWriter) Wait(timeout time.Duration) error
Wait for all pending write operations to complete or until the specified timeout is reached. If timeout is 0, wait indefinitely until all pending writes are completed.
func (*M3DBSymStreamWriter) WriteAttributeInstruction ¶
func (su *M3DBSymStreamWriter) WriteAttributeInstruction( version uint16, sequenceNum uint32, attributeName string, encodingType AttributeEncoding, indexValues []uint64, completionFn WriteCompletionFn) error
func (*M3DBSymStreamWriter) WriteEndInstruction ¶
func (su *M3DBSymStreamWriter) WriteEndInstruction( version uint16, sequenceNum uint32, completionFn WriteCompletionFn) error
func (*M3DBSymStreamWriter) WriteInitInstruction ¶
func (su *M3DBSymStreamWriter) WriteInitInstruction( version uint16, attributeValues []string, completionFn WriteCompletionFn) error
func (*M3DBSymStreamWriter) WriteUpdateInstruction ¶
func (su *M3DBSymStreamWriter) WriteUpdateInstruction( version uint16, sequenceNum uint32, attributeValues []string, completionFn WriteCompletionFn) error
type SeriesFamily ¶
type SeriesFamily interface { // Name of the table Name() string // Namespace of the table Namespace() ident.ID // Write a float64 value into the table having the specified attributes. Write( id ident.ID, attributes ident.TagIterator, time xtime.UnixNano, value float64, unit xtime.Unit, completionFn WriteCompletionFn) error // Write a float64 value into the table having the specified tags and // attributes. WriteTagged( id ident.ID, tags ident.TagIterator, attributes ident.TagIterator, time xtime.UnixNano, value float64, unit xtime.Unit, completionFn WriteCompletionFn) error }
Defines a series family to be used for Transactional & Analytical Processing use case. A series family is a collection of series that shares certain attributes.
type SymStreamReader ¶
type SymStreamReader interface { // Seek to first entry between the specified start and end time in the // underlying stream. Seek(startTime xtime.UnixNano, endTime xtime.UnixNano) error // Read the next instruction from the stream and return the version, // sequence number and the instruction. If End of stream is reached, // returns NOPInstruction. Otherwise, return error. Next() (uint16, uint32, TableInstruction, error) // Read InitSymTable instruction parameter from the current position in the // stream. If the current instruction is not InitSymTable, return error. ReadInitInstruction() ([]string, error) // Read UpdateSymTable instruction parameter from the current position in // the stream. If the current instruction is not UpdateSymTable, return // error. ReadUpdateInstruction() ([]string, error) // Read AddAttribute instruction parameter from the current position in // the stream. If the current instruction is not AddAttribute, return // error. ReadAttributeInstruction() (string, AttributeEncoding, []uint64, error) // Read the EndSymTable instruction from the stream at the current // location of the underlying stream. Return error if the instruction // could not be read. ReadEndInstruction() (string, []uint64, error) }
A Symbol Table Stream Reader provides the interface to read the symbol table operations encoded in the stream.
type SymStreamWriter ¶
type SymStreamWriter interface { // Write the InitSymTable instruction with the specified version and // attribute values. WriteInitInstruction( version uint16, attributeValues []string, completionFn WriteCompletionFn) error // Write the UpdateSymTable instruction with the specified version, // sequence number and attribute values. WriteUpdateInstruction( version uint16, sequenceNum uint32, attributeValues []string, completionFn WriteCompletionFn) error // Write the AddAttribute instruction with the specified version, // sequence number, attribute name, encoding type and index values. WriteAttributeInstruction( version uint16, sequenceNum uint32, atributeName string, encodingType AttributeEncoding, indexValues []uint64, completionFn WriteCompletionFn) error // Write the EndSymTable instruction with the specified version and // sequence number. WriteEndInstruction( version uint16, sequenceNum uint32, completionFc WriteCompletionFn) error // Wait for all pending write operations to complete or until the specified // timeout is reached. If timeout is 0, wait indefinitely wait for all // pending writes to complete. Wait(timeout time.Duration) error }
Symbol Stream Writer provides the interface for encoding and writing the symbol table elements into a stream.
type SymTable ¶
type SymTable struct {
// contains filtered or unexported fields
}
Symbol Table implementation
func NewSymTable ¶
func NewSymTable(name string, version uint16, streamWriter SymStreamWriter) *SymTable
func (*SymTable) AttributeValueExists ¶
Returns true if the given attribute value already exists in the symbol table
func (*SymTable) Finalize ¶
func (sym *SymTable) Finalize()
Finalize the symbol table. Once finalized, no more updates can be made
func (*SymTable) FindAttributeIndex ¶
Find the index of the given attribute value. If the attribute having the specified name or the given value doesn't exist, return -1
func (*SymTable) FindAttributeValue ¶
Find the attribute value for the given index. If the attribute having the specified name doesn't exist or the index is out of bounds, return an empty
func (*SymTable) GetAttributesFromIndexedHeader ¶
Return the attribute name and value map for the given indexed header
func (*SymTable) GetIndexedHeader ¶
Return the index header for the given set of attributes. If input refers to an attribute that does exist or a value that is not in the symbol table, the corresponding index is set to -1 and will return false
func (*SymTable) InsertAttributeIndices ¶
func (sym *SymTable) InsertAttributeIndices( name string, indices []uint64, writeCompleteFn WriteCompletionFn) error
Insert the attribute values denoted by the given attribute indices into the attribute having the specified name. If the attribute indices are not valid (i.e. they don't exist in the symbol table), this is an error.
func (*SymTable) InsertAttributeValue ¶
func (sym *SymTable) InsertAttributeValue( name string, value string, writeCompleteFn WriteCompletionFn) error
Inserts the given attribute value into the attribute having the specified name. If the attribute name doesn't exist, a new attribute is created in the SymTable. If the value already exists, this is a NOP
func (*SymTable) IsSame ¶
Return true if the specified other symbol table is the same as this one Two symbol tables are the same if they encode the same symbols and attribute values
func (*SymTable) NumAttributes ¶
Returns the number of attributes in the symbol table
func (*SymTable) NumSymbols ¶
Returns the number of symbols in the symbol table
func (*SymTable) UpdateDictionary ¶
func (sym *SymTable) UpdateDictionary( attributeValues []string, writeCompleteFn WriteCompletionFn) error
Update the dictionary with the given attribute values. If the attribute values already exists in the dictionary, this is an error
type SymbolTableStreamNameResolver ¶
Resolves the name of the symbol table stream for the given series id
type TableInstruction ¶
type TableInstruction int
Symbol Table Instructions supported by the boost implementation
const ( // Initiatize the table InitSymTable TableInstruction = iota // Update the table UpdateSymTable // Add a new attribute to the table AddAttribute // End Dictionary EndSymTable // NOP NOPInstruction )
type WriteCompletionFn ¶
type WriteCompletionFn func(err error)