Documentation ¶
Index ¶
- func TestMetaStore_Database(t *testing.T)
- func TestMetaStore_Datastore(t *testing.T)
- func TestMetaStore_StorageNode(t *testing.T)
- type Config
- type HTTPApi
- type HTTPApiConfig
- type MetadataStore
- func (m *MetadataStore) EnsureDoesntExistCollection(ctx context.Context, dbname, collectionname string) error
- func (m *MetadataStore) EnsureDoesntExistCollectionField(ctx context.Context, dbname, collectionname, fieldname string) error
- func (m *MetadataStore) EnsureDoesntExistCollectionIndex(ctx context.Context, dbname, collectionname, indexname string) error
- func (m *MetadataStore) EnsureDoesntExistCollectionKeyspace(ctx context.Context, dbname, collectionname string) error
- func (m *MetadataStore) EnsureDoesntExistCollectionKeyspacePartition(ctx context.Context, dbname, collectionname string, startId uint64) error
- func (m *MetadataStore) EnsureDoesntExistDatabase(ctx context.Context, dbname string) error
- func (m *MetadataStore) EnsureDoesntExistDatabaseDatastore(ctx context.Context, dbname, datastorename string) error
- func (m *MetadataStore) EnsureDoesntExistDatasourceInstance(ctx context.Context, id int64, datasourceinstance string) error
- func (m *MetadataStore) EnsureDoesntExistDatasourceInstanceShardInstance(ctx context.Context, id int64, ...) error
- func (m *MetadataStore) EnsureDoesntExistDatastore(ctx context.Context, datastorename string) error
- func (m *MetadataStore) EnsureDoesntExistDatastoreShard(ctx context.Context, datastorename string, datastoreshardinstance int64) error
- func (m *MetadataStore) EnsureDoesntExistDatastoreShardReplica(ctx context.Context, datastorename string, datastoreshardinstance int64, ...) error
- func (m *MetadataStore) EnsureDoesntExistDatastoreVShard(ctx context.Context, datastorename, vShardName string) error
- func (m *MetadataStore) EnsureDoesntExistDatastoreVShardInstance(ctx context.Context, datastorename, vShardName string, ...) error
- func (m *MetadataStore) EnsureDoesntExistStorageNode(ctx context.Context, id int64) error
- func (m *MetadataStore) EnsureExistsCollection(ctx context.Context, db *metadata.Database, collection *metadata.Collection) error
- func (m *MetadataStore) EnsureExistsCollectionField(ctx context.Context, db *metadata.Database, collection *metadata.Collection, ...) error
- func (m *MetadataStore) EnsureExistsCollectionIndex(ctx context.Context, db *metadata.Database, collection *metadata.Collection, ...) error
- func (m *MetadataStore) EnsureExistsCollectionKeyspace(ctx context.Context, db *metadata.Database, collection *metadata.Collection, ...) error
- func (m *MetadataStore) EnsureExistsCollectionKeyspacePartition(ctx context.Context, db *metadata.Database, collection *metadata.Collection, ...) error
- func (m *MetadataStore) EnsureExistsDatabase(ctx context.Context, db *metadata.Database) error
- func (m *MetadataStore) EnsureExistsDatabaseDatastore(ctx context.Context, db *metadata.Database, ...) error
- func (m *MetadataStore) EnsureExistsDatasourceInstance(ctx context.Context, storageNode *metadata.StorageNode, ...) error
- func (m *MetadataStore) EnsureExistsDatasourceInstanceShardInstance(ctx context.Context, storageNode *metadata.StorageNode, ...) error
- func (m *MetadataStore) EnsureExistsDatastore(ctx context.Context, datastore *metadata.Datastore) error
- func (m *MetadataStore) EnsureExistsDatastoreShard(ctx context.Context, datastore *metadata.Datastore, ...) error
- func (m *MetadataStore) EnsureExistsDatastoreShardReplica(ctx context.Context, datastore *metadata.Datastore, ...) error
- func (m *MetadataStore) EnsureExistsDatastoreVShard(ctx context.Context, datastore *metadata.Datastore, ...) error
- func (m *MetadataStore) EnsureExistsDatastoreVShardInstance(ctx context.Context, datastore *metadata.Datastore, ...) error
- func (m *MetadataStore) EnsureExistsStorageNode(ctx context.Context, storageNode *metadata.StorageNode) error
- func (m *MetadataStore) GetMeta(ctx context.Context) (*metadata.Meta, error)
- func (m *MetadataStore) GetSequence(ctx context.Context, name string) (int64, error)
- type TaskNode
- func (t *TaskNode) EnsureDoesntExistDatabase(ctx context.Context, dbname string) (err error)
- func (t *TaskNode) EnsureExistsDatabase(ctx context.Context, db *metadata.Database) (err error)
- func (t *TaskNode) FetchMeta() error
- func (t *TaskNode) GetMeta() *metadata.Meta
- func (t *TaskNode) Start() error
- func (t *TaskNode) Sync() error
- type TaskNodeMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestMetaStore_Database ¶
func TestMetaStore_Datastore ¶
Types ¶
type Config ¶
type Config struct { // Config for accessing metadata store MetaStoreType datasource.StorageType `yaml:"metastore_type"` MetaStoreConfig map[string]interface{} `yaml:"metastore_config"` HTTP HTTPApiConfig `yaml:"http_api"` }
Common configuration for all storage nodes
func (*Config) GetMetaStore ¶
func (c *Config) GetMetaStore(metaFunc metadata.MetaFunc) (datasource.DataInterface, error)
type HTTPApi ¶
type HTTPApi struct {
// contains filtered or unexported fields
}
func NewHTTPApi ¶
func (*HTTPApi) Start ¶
func (h *HTTPApi) Start(router *httprouter.Router)
Register any endpoints to the router
type MetadataStore ¶
type MetadataStore struct {
Store datasource.DataInterface
}
func NewMetadataStore ¶
func NewMetadataStore(config *storagenode.DatasourceInstanceConfig) (*MetadataStore, error)
func (*MetadataStore) EnsureDoesntExistCollection ¶
func (m *MetadataStore) EnsureDoesntExistCollection(ctx context.Context, dbname, collectionname string) error
TODO: to change
func (*MetadataStore) EnsureDoesntExistCollectionField ¶
func (m *MetadataStore) EnsureDoesntExistCollectionField(ctx context.Context, dbname, collectionname, fieldname string) error
func (*MetadataStore) EnsureDoesntExistCollectionIndex ¶
func (m *MetadataStore) EnsureDoesntExistCollectionIndex(ctx context.Context, dbname, collectionname, indexname string) error
func (*MetadataStore) EnsureDoesntExistCollectionKeyspace ¶
func (m *MetadataStore) EnsureDoesntExistCollectionKeyspace(ctx context.Context, dbname, collectionname string) error
TODO: change once we support more keyspaces
func (*MetadataStore) EnsureDoesntExistCollectionKeyspacePartition ¶
func (m *MetadataStore) EnsureDoesntExistCollectionKeyspacePartition(ctx context.Context, dbname, collectionname string, startId uint64) error
TODO: change once we support more partitions
func (*MetadataStore) EnsureDoesntExistDatabase ¶
func (m *MetadataStore) EnsureDoesntExistDatabase(ctx context.Context, dbname string) error
func (*MetadataStore) EnsureDoesntExistDatabaseDatastore ¶
func (m *MetadataStore) EnsureDoesntExistDatabaseDatastore(ctx context.Context, dbname, datastorename string) error
func (*MetadataStore) EnsureDoesntExistDatasourceInstance ¶
func (*MetadataStore) EnsureDoesntExistDatasourceInstanceShardInstance ¶
func (*MetadataStore) EnsureDoesntExistDatastore ¶
func (m *MetadataStore) EnsureDoesntExistDatastore(ctx context.Context, datastorename string) error
func (*MetadataStore) EnsureDoesntExistDatastoreShard ¶
func (*MetadataStore) EnsureDoesntExistDatastoreShardReplica ¶
func (*MetadataStore) EnsureDoesntExistDatastoreVShard ¶
func (m *MetadataStore) EnsureDoesntExistDatastoreVShard(ctx context.Context, datastorename, vShardName string) error
func (*MetadataStore) EnsureDoesntExistDatastoreVShardInstance ¶
func (*MetadataStore) EnsureDoesntExistStorageNode ¶
func (m *MetadataStore) EnsureDoesntExistStorageNode(ctx context.Context, id int64) error
func (*MetadataStore) EnsureExistsCollection ¶
func (m *MetadataStore) EnsureExistsCollection(ctx context.Context, db *metadata.Database, collection *metadata.Collection) error
Collection Changes
func (*MetadataStore) EnsureExistsCollectionField ¶
func (m *MetadataStore) EnsureExistsCollectionField(ctx context.Context, db *metadata.Database, collection *metadata.Collection, field, parentField *storagenodemetadata.CollectionField) error
func (*MetadataStore) EnsureExistsCollectionIndex ¶
func (m *MetadataStore) EnsureExistsCollectionIndex(ctx context.Context, db *metadata.Database, collection *metadata.Collection, index *storagenodemetadata.CollectionIndex) error
Index changes
func (*MetadataStore) EnsureExistsCollectionKeyspace ¶
func (m *MetadataStore) EnsureExistsCollectionKeyspace(ctx context.Context, db *metadata.Database, collection *metadata.Collection, collectionKeyspace *metadata.CollectionKeyspace) error
func (*MetadataStore) EnsureExistsCollectionKeyspacePartition ¶
func (m *MetadataStore) EnsureExistsCollectionKeyspacePartition(ctx context.Context, db *metadata.Database, collection *metadata.Collection, collectionKeyspace *metadata.CollectionKeyspace, collectionKeyspacePartition *metadata.CollectionKeyspacePartition) error
func (*MetadataStore) EnsureExistsDatabase ¶
func (*MetadataStore) EnsureExistsDatabaseDatastore ¶
func (m *MetadataStore) EnsureExistsDatabaseDatastore(ctx context.Context, db *metadata.Database, databaseDatastore *metadata.DatabaseDatastore) error
func (*MetadataStore) EnsureExistsDatasourceInstance ¶
func (m *MetadataStore) EnsureExistsDatasourceInstance(ctx context.Context, storageNode *metadata.StorageNode, datasourceInstance *metadata.DatasourceInstance) error
func (*MetadataStore) EnsureExistsDatasourceInstanceShardInstance ¶
func (m *MetadataStore) EnsureExistsDatasourceInstanceShardInstance(ctx context.Context, storageNode *metadata.StorageNode, datasourceInstance *metadata.DatasourceInstance, datasourceInstanceShardInstance *metadata.DatasourceInstanceShardInstance) error
TODO this one is a bit odd since it needs to check the existence of vshards etc. we'll pick this back up after database / schema manipulation is in
func (*MetadataStore) EnsureExistsDatastore ¶
func (*MetadataStore) EnsureExistsDatastoreShard ¶
func (m *MetadataStore) EnsureExistsDatastoreShard(ctx context.Context, datastore *metadata.Datastore, datastoreShard *metadata.DatastoreShard) error
func (*MetadataStore) EnsureExistsDatastoreShardReplica ¶
func (m *MetadataStore) EnsureExistsDatastoreShardReplica(ctx context.Context, datastore *metadata.Datastore, datastoreShard *metadata.DatastoreShard, datastoreShardReplica *metadata.DatastoreShardReplica) error
func (*MetadataStore) EnsureExistsDatastoreVShard ¶
func (m *MetadataStore) EnsureExistsDatastoreVShard(ctx context.Context, datastore *metadata.Datastore, vShard *metadata.DatastoreVShard) error
One for the top-level, and one for the instances as well! func (m *MetadataStore) EnsureExistsDatastoreVShard(datastore *metadata.Datastore, datastoreVShard *metadata.DatabaseVShard) error {
func (*MetadataStore) EnsureExistsDatastoreVShardInstance ¶
func (m *MetadataStore) EnsureExistsDatastoreVShardInstance(ctx context.Context, datastore *metadata.Datastore, vShard *metadata.DatastoreVShard, vShardInstance *metadata.DatastoreVShardInstance) error
func (*MetadataStore) EnsureExistsStorageNode ¶
func (m *MetadataStore) EnsureExistsStorageNode(ctx context.Context, storageNode *metadata.StorageNode) error
func (*MetadataStore) GetMeta ¶
TODO: this should ideally load exactly *one* of any given record into a struct. This will require some work to do so, and we really should probably have something to codegen the record -> struct transition TODO: split into get/list for each item? TODO: have error?
func (*MetadataStore) GetSequence ¶
TODO: change to use an increment operator instead of the filter + (insert/update) thing Take (name, count) return (id, error)
type TaskNode ¶
type TaskNode struct { Config *Config MetaStore *MetadataStore // contains filtered or unexported fields }
This node is responsible for routing requests to the appropriate storage node This is also responsible for maintaining schema, indexes, etc. from the metadata store
func NewTaskNode ¶
func (*TaskNode) EnsureDoesntExistDatabase ¶
func (*TaskNode) EnsureExistsDatabase ¶
type TaskNodeMetrics ¶
type TaskNodeMetrics struct { MetaLastSync *metrics.ObserveArray MetaLastDuration *metrics.ObserveArray DatabaseQueryTime *metrics.ObserveArray }
func NewTaskNodeMetrics ¶
func NewTaskNodeMetrics(r metrics.Registry) TaskNodeMetrics