Documentation ¶
Index ¶
- Variables
- type Event
- type EventIterator
- type Historian
- func (historian *Historian) ForwardIndex() uint64
- func (historian *Historian) LogEvent(event *Event) error
- func (historian *Historian) LogSerial() uint64
- func (historian *Historian) LogSize() uint64
- func (historian *Historian) Purge(query *HistoryQuery) error
- func (historian *Historian) Query(query *HistoryQuery) (*EventIterator, error)
- func (historian *Historian) RotateLog() error
- func (historian *Historian) SetForwardIndex(i uint64) error
- func (historian *Historian) SetLogSerial(s uint64) error
- type HistoryQuery
Constants ¶
This section is empty.
Variables ¶
var ( BY_TIME_PREFIX = []byte{0} BY_SOURCE_AND_TIME_PREFIX = []byte{1} BY_DATA_SOURCE_AND_TIME_PREFIX = []byte{2} BY_SERIAL_NUMBER_PREFIX = []byte{3} SEQUENTIAL_COUNTER_PREFIX = []byte{4} CURRENT_SIZE_COUNTER_PREFIX = []byte{5} HIGHEST_FORWARDED_INDEX_PREFIX = []byte{6} DELIMETER = []byte(".") )
Functions ¶
This section is empty.
Types ¶
type EventIterator ¶
type EventIterator struct {
// contains filtered or unexported fields
}
func NewEventIterator ¶
func NewEventIterator(iterator StorageIterator, limit int) *EventIterator
func (*EventIterator) Error ¶
func (ei *EventIterator) Error() error
func (*EventIterator) Event ¶
func (ei *EventIterator) Event() *Event
func (*EventIterator) Next ¶
func (ei *EventIterator) Next() bool
func (*EventIterator) Release ¶
func (ei *EventIterator) Release()
type Historian ¶
type Historian struct {
// contains filtered or unexported fields
}
func NewHistorian ¶
func (*Historian) ForwardIndex ¶
func (*Historian) Purge ¶
func (historian *Historian) Purge(query *HistoryQuery) error
func (*Historian) Query ¶
func (historian *Historian) Query(query *HistoryQuery) (*EventIterator, error)
func (*Historian) RotateLog ¶
The behavior of log rotation is determined by the relationship between eventLimit, eventFloor, and purgeBatchSize. Log rotation occurs when the log contains eventLimit events. Log rotation will delete old events until there are eventFloor events remaining in the log. Configuring these two values can adjust the performance characteristics of the history log and how aggressively disk space is conserved.
Here are some example configurations and their performance characteristics:
eventLimit = 100000 eventFloor = 99999
In this case the most events ever stored on disk will be 100000. However, after there are at least 99999 events written to the log every new log entry will require a log rotation operation to occur in order to keep the log size under the limit.
eventLimit = 200000 eventFloor = 100000
In this case a purge operation only occurs once every 100000 writes instead of on every write.
if eventFloor is greater than or equal to eventLimit then eventFloor is ignored and eventLimit is used as the event floor