arrowflight

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WriteAuthSuccess      string = "ArrowFlightWriteSuccessfully"
	WriteAuthTokenSalty   int64  = 1e9
	WriteAuthTokenTimeOut        = 24 * time.Hour
)

Variables

This section is empty.

Functions

func HashAuthToken

func HashAuthToken(token *AuthToken) (string, error)

func NewAuthServer

func NewAuthServer(authEnabled bool) *authServer

func NewWriteServer

func NewWriteServer(logger *logger.Logger) *writeServer

Types

type AuthInfo

type AuthInfo struct {
	UserName string `json:"username"`
	DataBase string `json:"db"`
}

type AuthToken

type AuthToken struct {
	Username  string `json:"username"`
	Timestamp int64  `json:"timestamp"`
	Salty     int64  `json:"salty"`
}

type FlightMetaClient

type FlightMetaClient interface {
	Database(name string) (*meta.DatabaseInfo, error)
	Authenticate(username, password string) (ui meta.User, err error)
	User(username string) (meta.User, error)
	AdminUserExists() bool
	DataNodes() ([]meta.DataNode, error)
	ShowShards() models.Rows
}

type MetaData

type MetaData struct {
	DataBase        string `json:"db"`
	RetentionPolicy string `json:"rp"`
	Measurement     string `json:"mst"`
}

type RecordWriter

type RecordWriter interface {
	RetryWriteRecord(database, retentionPolicy, measurement string, rec array.Record) error
}

type Service

type Service struct {
	Config *config.Config
	Logger *logger.Logger

	StatisticsPusher *statisticsPusher.StatisticsPusher

	MetaClient FlightMetaClient

	RecordWriter interface {
		RetryWriteRecord(database, retentionPolicy, measurement string, rec array.Record) error
	}
	// contains filtered or unexported fields
}

Service is that the protocol of arrow flight must satisfy 4 constraints. Constraint 1: the protocol must ensure data write balancing. Constraint 2: the protocol must ensure that the time of a batch of data is ordered. Constraint 3: the protocol must ensure that a batch of data belongs to the same db/rp/mst. Constraint 4: the protocol must ensure that the time field is in the last column.

func NewService

func NewService(c config.Config) (*Service, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) Err

func (s *Service) Err() <-chan error

func (*Service) GetServer

func (s *Service) GetServer() flight.Server

func (*Service) Open

func (s *Service) Open() error

Jump to

Keyboard shortcuts

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