datatransfers

package
v0.0.0-...-06f73d7 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: PostgreSQL Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(path string) error

LoadConfig loads the configuration from the specified path or the localConfigDir directory.

Parameters: - path (string): the path to the configuration file.

Returns: - error: an error if the configuration cannot be loaded.

func MoveKeys

func MoveKeys(ctx context.Context, fromId, toId string, krg *kr.KeyRange, ds *distributions.Distribution, db qdb.XQDB, cr coordinator.Coordinator) error

MoveKeys performs physical key-range move from one datashard to another.

It is assumed that the passed key range is already locked on every online spqr-router. The function performs the following steps:

  • Create a postgres_fdw on the receiving shard.
  • Copy data from the sending shard to the receiving shard via fdw.
  • Delete data from the sending shard.

Parameters:

  • ctx (context.Context): The context for the function.
  • fromId (string): the ID of the sending shard.
  • toId (string): the ID of the receiving shard.
  • krg (*kr.KeyRange): the KeyRange object representing the key range being moved.
  • ds (*distributions.Distribution): the Distributions object representing the distribution of data.
  • db (qdb.XQDB): the XQDB object for interacting with the database.
  • cr (coordinator.Coordinator): the Coordinator object for coordinating the move.

Returns:

  • error: an error if the move fails.

Types

type MoveTableRes

type MoveTableRes struct {
	TableSchema string `db:"table_schema"`
	TableName   string `db:"table_name"`
}

type ProxyW

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

func (*ProxyW) Write

func (p *ProxyW) Write(bt []byte) (int, error)

Write writes the given byte slice to the underlying io.WriteCloser.

Parameters: - bt ([]byte): a byte slice to be written.

Returns: - int: the number of bytes written. - error: an error, if any, that occurred during the

type Tx

type Tx interface {
	pgx.Tx
}

Jump to

Keyboard shortcuts

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