Documentation ¶
Index ¶
- type MySQLStateBackend
- func (s *MySQLStateBackend) Cleanup()
- func (s *MySQLStateBackend) Get(from string, projection []string, where []string, orderby string, limit int64, ...) (<-chan map[string]interface{}, error)
- func (s *MySQLStateBackend) GetRow(from string, projection []string, where []string, parentSpan opentracing.Span) *sql.Row
- func (s *MySQLStateBackend) Init(database, table, createTable string) error
- func (s *MySQLStateBackend) Insert(table string, row map[string]interface{}, vc map[string]*timestamp.Timestamp) error
- func (s *MySQLStateBackend) LogReceivedUpdateRec(rowIDVal interface{}, vc map[string]*timestamp.Timestamp, tsLocal time.Time)
- func (s *MySQLStateBackend) Update(table string, predicate, newValues map[string]interface{}, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLStateBackend ¶
type MySQLStateBackend struct {
// contains filtered or unexported fields
}
MySQLStateBackend implements the libqpu.QPUState interface using MySQL as a backend store.
func NewStateBackend ¶
func NewStateBackend(conf *libqpu.QPUConfig) (*MySQLStateBackend, error)
NewStateBackend initiated a connection with the MySQL specified in the QPU's configuration, and creates an instance of libqpu.QPUState.
func (*MySQLStateBackend) Cleanup ¶
func (s *MySQLStateBackend) Cleanup()
Cleanup closes the connection to the MySQL instance
func (*MySQLStateBackend) Get ¶
func (s *MySQLStateBackend) Get(from string, projection []string, where []string, orderby string, limit int64, parentSpan opentracing.Span) (<-chan map[string]interface{}, error)
Get retrieves state records based on a given query. It returns a channel that can be used to iteratively return the retrieved records. The channel returns records of type map[<attributeName>]<string_value>.
func (*MySQLStateBackend) GetRow ¶
func (s *MySQLStateBackend) GetRow(from string, projection []string, where []string, parentSpan opentracing.Span) *sql.Row
GetRow ...
func (*MySQLStateBackend) Init ¶
func (s *MySQLStateBackend) Init(database, table, createTable string) error
Init performs the necessary initializations for using the MySQL instance as a store for the QPU's state. In more detail:
- it creates a database if it does not exist, selects it (USE)
- and creates the table to be used for storing the state (it drops the table if it already exists)
func (*MySQLStateBackend) Insert ¶
func (s *MySQLStateBackend) Insert(table string, row map[string]interface{}, vc map[string]*timestamp.Timestamp) error
Insert inserts a record in the state.
func (*MySQLStateBackend) LogReceivedUpdateRec ¶
func (s *MySQLStateBackend) LogReceivedUpdateRec(rowIDVal interface{}, vc map[string]*timestamp.Timestamp, tsLocal time.Time)
LogReceivedUpdateRec ...