subquery

package
v0.0.0-...-c94801d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2019 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BypassCaches bool

bypass caches

View Source
var DepConfigs []st.DepConfig

global config store

subsystems

Functions

func Check

func Check(err error)

error check alias

func ExecuteSubquery

func ExecuteSubquery(doneDeps chan<- st.Latency, dep string, url []string, cacheable []int8, startTime time.Time)

execute a subquery and handle cache hits

func InitSubSystems

func InitSubSystems(cacheip string)

initialize from depConfigs

func ParseRequest

func ParseRequest(layers QueryLayerSlice, startTime time.Time)

parse a request struct and issue requests following dependency graph

func PingTest

func PingTest(cacheip string)

ping cache and record latency

Types

type BackConn

type BackConn interface {
	Request([]string) (map[string][]byte, error)
	Ping() bool
}

type DepQuery

type DepQuery struct {
	S []int64
	C []int8
	U []string
}

subquery dep layer

type Empty

type Empty struct{}

semaphore alias

type FbBackConn

type FbBackConn struct {
	Conn chan *rpc.Client
	Pars st.FbackParameters
}

fb-type backend connection

func (FbBackConn) Ping

func (fbcon FbBackConn) Ping() (works bool)

func (FbBackConn) Request

func (fbcon FbBackConn) Request(ids []string) (map[string][]byte, error)

type JsonRequest

type JsonRequest struct {
	T int64           `json:"t"`
	D QueryLayerSlice `json:"d"`
}

type MySqlBackConn

type MySqlBackConn struct {
	Conn      *sql.DB
	R         *rand.Rand
	WriteProb float32
}

func (MySqlBackConn) Ping

func (mybc MySqlBackConn) Ping() (works bool)

func (MySqlBackConn) Request

func (mybc MySqlBackConn) Request(ids []string) (map[string][]byte, error)

type Query

type Query struct {
	Id   string
	Size int64
	Dep  string
}

type QueryLayer

type QueryLayer map[string]DepQuery

type QueryLayerSlice

type QueryLayerSlice []QueryLayer

type Semaphore

type Semaphore chan Empty

func NewSemaphore

func NewSemaphore(n int) Semaphore

func (Semaphore) Acquire

func (s Semaphore) Acquire() bool

func (Semaphore) Release

func (s Semaphore) Release()

type SizeGen

type SizeGen struct {
	R       *rand.Rand
	Cutoffs map[float32]int64
	Ordered []float32
}

func NewSizeGen

func NewSizeGen(buckets map[string]float32) (sg SizeGen)

func (SizeGen) Size

func (sg SizeGen) Size() (size int64)

type Subsystem

type Subsystem struct {
	CacheClient      *memcache.Client
	CacheSema        Semaphore
	BackClient       BackConn
	BackSema         Semaphore
	Shadow1, Shadow2 *sq.ShadowCache
}

subsystem types: caches and backend connections

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL