http

package
v3.35.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package http provides the http implementation of the Director interface.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New(errors.ErrUncoded, "not implemented")

Functions

func Handler

func Handler(c *controller.Controller) http.Handler

Types

type AddressManager

type AddressManager struct {
	// contains filtered or unexported fields
}

AddressManager is an http implementation of the AddressManager interface.

func NewAddressManager

func NewAddressManager(mdsAddress dax.Address) *AddressManager

func (*AddressManager) AddAddresses

func (m *AddressManager) AddAddresses(ctx context.Context, addr ...dax.Address) error

func (*AddressManager) RemoveAddresses

func (m *AddressManager) RemoveAddresses(ctx context.Context, addrs ...dax.Address) error

type ComputeNodesRequest

type ComputeNodesRequest struct {
	Table   dax.QualifiedTableID `json:"table"`
	Shards  dax.ShardNums        `json:"shards"`
	IsWrite bool                 `json:"is-write"`
}

ComputeNodesRequest is used to specify the table/shards to consider in the ComputeNodes method call. If IsWrite is true, shards which are not currently being managed by the underlying Controller will be added to (registered with) the Controller and, if adequate compute is available, will be associated with a compute node.

type ComputeNodesResponse

type ComputeNodesResponse struct {
	ComputeNodes []dax.ComputeNode `json:"compute-nodes"`
}

ComputeNodesResponse contains the list of compute nodes returned based on the table/shards specified in the ComputeNodeRequest. It's possible that shards provided are not included in this response. That might happen if there are currently no active compute nodes.

type CreateFieldRequest

type CreateFieldRequest struct {
	TableKey dax.TableKey `json:"table-key"`
	Field    *dax.Field   `json:"field"`
}

type DatabaseByNameRequest

type DatabaseByNameRequest struct {
	OrganizationID dax.OrganizationID `json:"org-id"`
	Name           dax.DatabaseName   `json:"name"`
}

type DatabaseOptionRequest added in v3.32.0

type DatabaseOptionRequest struct {
	QualifiedDatabaseID dax.QualifiedDatabaseID `json:"qdbid"`
	Option              string                  `json:"option"`
	Value               string                  `json:"value"`
}

DatabaseOptionRequest represents a change to a database option. The thinking is to only support changing one database option at a time to keep the implementation sane. At time of writing, only WorkersMin is supported.

type DatabasesRequest

type DatabasesRequest struct {
	OrganizationID dax.OrganizationID `json:"org-id"`
	DatabaseIDs    dax.DatabaseIDs    `json:"database-ids"`
}

type DeregisterNodesRequest

type DeregisterNodesRequest struct {
	Addresses []dax.Address `json:"addresses"`
}

type Director

type Director struct {
	// contains filtered or unexported fields
}

Director is an http implementation of the Director interface.

func NewDirector

func NewDirector(cfg DirectorConfig) *Director

func (*Director) SendDirective

func (d *Director) SendDirective(ctx context.Context, dir *dax.Directive) error

func (*Director) SendSnapshotFieldKeysRequest

func (d *Director) SendSnapshotFieldKeysRequest(ctx context.Context, req *dax.SnapshotFieldKeysRequest) error

func (*Director) SendSnapshotShardDataRequest

func (d *Director) SendSnapshotShardDataRequest(ctx context.Context, req *dax.SnapshotShardDataRequest) error

func (*Director) SendSnapshotTableKeysRequest

func (d *Director) SendSnapshotTableKeysRequest(ctx context.Context, req *dax.SnapshotTableKeysRequest) error

type DirectorConfig

type DirectorConfig struct {
	DirectivePath       string
	SnapshotRequestPath string
	Logger              logger.Logger
}

type DropFieldRequest

type DropFieldRequest struct {
	Table dax.QualifiedTableID `json:"table"`
	Field dax.FieldName        `json:"fields"`
}

type IngestPartitionRequest

type IngestPartitionRequest struct {
	Table     dax.QualifiedTableID `json:"table"`
	Partition dax.PartitionNum     `json:"partition"`
}

type IngestPartitionResponse

type IngestPartitionResponse struct {
	Address dax.Address `json:"address"`
}

type IngestShardRequest

type IngestShardRequest struct {
	Table dax.QualifiedTableID `json:"table"`
	Shard dax.ShardNum         `json:"shard"`
}

type IngestShardResponse

type IngestShardResponse struct {
	Address dax.Address `json:"address"`
}

type RegisterNodesRequest

type RegisterNodesRequest struct {
	Nodes []*dax.Node `json:"nodes"`
}

type SnapshotFieldKeysRequest

type SnapshotFieldKeysRequest struct {
	Table dax.QualifiedTableID `json:"table"`
	Field dax.FieldName        `json:"field"`
}

SnapshotFieldKeysRequest is used to specify the field/keys to snapshot.

type SnapshotShardRequest

type SnapshotShardRequest struct {
	Table dax.QualifiedTableID `json:"table"`
	Shard dax.ShardNum         `json:"shard"`
}

SnapshotShardRequest is used to specify the table/shard to snapshot.

type SnapshotTableKeysRequest

type SnapshotTableKeysRequest struct {
	Table     dax.QualifiedTableID `json:"table"`
	Partition dax.PartitionNum     `json:"partition"`
}

SnapshotTableKeysRequest is used to specify the table/partition/keys to snapshot.

type TablesRequest

type TablesRequest struct {
	OrganizationID dax.OrganizationID `json:"org-id"`
	DatabaseID     dax.DatabaseID     `json:"db-id"`
	TableIDs       dax.TableIDs       `json:"table-ids"`
	TableNames     dax.TableNames     `json:"table-names"`
}

type TranslateNodesRequest

type TranslateNodesRequest struct {
	Table      dax.QualifiedTableID `json:"table"`
	Partitions dax.PartitionNums    `json:"partitions"`
	IsWrite    bool                 `json:"is-write"`
}

TranslateNodesRequest is used to specify the table/partitions to consider in the TranslateNodes method call.

type TranslateNodesResponse

type TranslateNodesResponse struct {
	TranslateNodes []dax.TranslateNode `json:"translate-nodes"`
}

TranslateNodesResponse contains the list of translate nodes returned based on the table/partitions specified in the TranslateNodeRequest. It's possible that partitions provided are not included in this response. That might happen if there are currently no active translate nodes.

Jump to

Keyboard shortcuts

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