ignite3

package
v0.0.0-...-02a0e6f Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNDEFINED_PRECISION = -1
	UNDEFINED_SCALE     = math.MinInt
)
View Source
const (
	OpHeartbeat                = 1
	OpTablesGet                = 3
	OpTableGet                 = 4
	OpSchemaGet                = 5
	OpTupleUpsert              = 10
	OpTupleGet                 = 12
	OpTupleUpsertAll           = 13
	OpTupleGetAll              = 15
	OpTupleGetAndUpsert        = 16
	OpTupleInsert              = 18
	OpTupleInsertAll           = 20
	OpTupleReplace             = 22
	OpTupleReplaceExact        = 24
	OpTupleGetAndReplace       = 26
	OpTupleDelete              = 28
	OpTupleDeleteAll           = 29
	OpTupleDeleteExact         = 30
	OpTupleDeleteAllExact      = 31
	OpTupleGetAndDelete        = 32
	OpTupleContainsKey         = 33
	OpJdbcTableMeta            = 38
	OpJdbcColumnMeta           = 39
	OpJdbcPKMeta               = 41
	OpTxBegin                  = 43
	OpTxCommit                 = 44
	OpTxRollback               = 45
	OpComputeExecute           = 47
	OpClusterGetNodes          = 48
	OpComputeExecuteCollocated = 49
	OpSqlExecute               = 50
	OpSqlCursorNextPage        = 51
	OpSqlCursorClose           = 52
	OpSqlExecuteScript         = 56
	OpSqlQueryMeta             = 57
	OpComputeGetStatus         = 59
	OpComputeCancel            = 60
	OpComputeChangePriority    = 61
	OpSqlExecuteBatch          = 63
	OpSqlCancelExecute         = 70
	OpTablesGetQualified       = 71
	OpTableGetQualified        = 72
)

v3_OK

View Source
const (
	AuthInfoUsernameLabel = "authn-identity"
	AuthInfoPasswordLabel = "authn-secret"
	AuthInfoType          = "authn-type"
)
View Source
const (
	// OperationStatusSuccess means success
	OperationStatusSuccess = 0

	FlagPartitionAssignmentChanged = 1
	FlagError                      = 4
)
View Source
const (
	DEFAULT_SCHEMA = "PUBLIC"
)
View Source
const (
	// HeartbeatStatusSuccess means success
	HeartbeatStatusSuccess = 0
)
View Source
const (
	MIN_HEARTBEAT_INTERVAL_MS = 500
)

Variables

View Source
var (
	// TODO: Are we?
	PartitionAwareness bool

	Debug = false
)
View Source
var (
	ColTypes = ColumnTypes{
		ColumnType{
			SQLTypeName:      "NULL",
			TypeId:           typeNULL,
			GoKind:           reflect.Pointer,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},
		ColumnType{
			SQLTypeName:      "BOOLEAN",
			TypeId:           1,
			GoKind:           typeBOOLEAN,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},
		ColumnType{
			SQLTypeName:      "TINYINT",
			TypeId:           typeTINYINT,
			GoKind:           reflect.Int8,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},
		ColumnType{
			SQLTypeName:      "SMALLINT",
			TypeId:           typeSMALLINT,
			GoKind:           reflect.Int16,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},
		ColumnType{
			SQLTypeName:      "INT",
			TypeId:           typeINT,
			GoKind:           reflect.Int32,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},
		ColumnType{
			SQLTypeName:      "BIGINT",
			TypeId:           typeBIGINT,
			GoKind:           reflect.Int64,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},
		ColumnType{
			SQLTypeName:      "REAL",
			TypeId:           typeREAL,
			GoKind:           reflect.Float32,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},
		ColumnType{
			SQLTypeName:      "DOUBLE",
			TypeId:           typeDOUBLE,
			GoKind:           reflect.Float64,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},

		ColumnType{
			SQLTypeName:      "DECIMAL",
			TypeId:           typeDECIMAL,
			GoKind:           reflect.Struct,
			PrecisionAllowed: true,
			ScaleAllowed:     true,
			LengthAllowed:    false,
		},

		ColumnType{
			SQLTypeName:      "DATE",
			TypeId:           typeDATE,
			GoKind:           reflect.Int,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},

		ColumnType{
			SQLTypeName:      "TIME",
			TypeId:           typeTIME,
			GoKind:           reflect.Int,
			PrecisionAllowed: true,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},

		ColumnType{
			SQLTypeName:      "DATETIME",
			TypeId:           typeDATETIME,
			GoKind:           reflect.Struct,
			PrecisionAllowed: true,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},

		ColumnType{
			SQLTypeName:      "TIMESTAMP",
			TypeId:           typeTIMESTAMP,
			GoKind:           reflect.Struct,
			PrecisionAllowed: true,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},

		ColumnType{
			SQLTypeName:      "UUID",
			TypeId:           typeUUID,
			GoKind:           reflect.Struct,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    false,
		},

		ColumnType{
			SQLTypeName:      "VARCHAR",
			TypeId:           typeVARCHAR,
			GoKind:           reflect.String,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    true,
		},
		ColumnType{
			SQLTypeName:      "VARBINARY",
			TypeId:           typeVARBINARY,
			GoKind:           reflect.Array,
			PrecisionAllowed: false,
			ScaleAllowed:     false,
			LengthAllowed:    true,
		},
	}
)
View Source
var MAGIC_BYTES = []byte{0x49, 0x47, 0x4E, 0x49}

Functions

func ReadPackedBool

func ReadPackedBool(r io.Reader) (bool, error)

ReadBool reads "bool" value

func ReadPackedByte

func ReadPackedByte(r io.Reader) (byte, error)

func ReadPackedBytes

func ReadPackedBytes(r io.Reader) ([]byte, error)

func ReadPackedInt

func ReadPackedInt(r io.Reader) (int64, error)

func ReadPackedInt8

func ReadPackedInt8(r io.Reader) (int8, error)

func ReadPackedInt16

func ReadPackedInt16(r io.Reader) (int16, error)

func ReadPackedInt32

func ReadPackedInt32(r io.Reader) (int32, error)

func ReadPackedInt64

func ReadPackedInt64(r io.Reader) (int64, error)

func ReadPackedInt64Array

func ReadPackedInt64Array(r io.Reader) ([]int64, error)

func ReadPackedInt64String

func ReadPackedInt64String(r io.Reader) (int64, string, error)

func ReadPackedString

func ReadPackedString(r io.Reader) (string, error)

func ReadPackedTimestamp

func ReadPackedTimestamp(r io.Reader) (time.Time, error)

ReadTimestamp reads "Timestamp" object value

func ReadPackedUint8

func ReadPackedUint8(r io.Reader) (uint8, error)

func ReadRawByteArray

func ReadRawByteArray(r io.Reader, len int) ([]byte, error)

ReadRawArrayBytes reads len bytes array value

func TryReadError

func TryReadError(r io.Reader) (interface{}, error)

v3_WIP : NOK quand il y a un msg d'erreur (a provoquer en mettant une version incompatible au handshake)

func TryReadPackedIntWithDefault

func TryReadPackedIntWithDefault(r io.Reader, defaultValue int64) (int64, error)

Try to read Int. If Int found, reader is advanced to next message. If not Int, reader is not advanced and defaultValue is returned

func TryReadPackedNil

func TryReadPackedNil(r io.Reader) (bool, error)

Try to read Nil. If Nil, reader is advanced to next message. If not nil, reader is not advanced

func WritePackedByte

func WritePackedByte(w io.Writer, v byte) error

func WritePackedBytes

func WritePackedBytes(w io.Writer, v []byte) error

func WritePackedInt64

func WritePackedInt64(w io.Writer, v int64) error

func WritePackedMap

func WritePackedMap(w io.Writer, code map[string]string) error

WriteMap writes map type code

func WritePackedNull

func WritePackedNull(w io.Writer) error

func WritePackedString

func WritePackedString(w io.Writer, v string) error

WriteString writes "string" value

func WritePackedTimestamp

func WritePackedTimestamp(w io.Writer, ts time.Time) error

func WritePackedUUID

func WritePackedUUID(w io.Writer, v Uuid) error

WriteOUUID writes "UUID" object value as msgpack ext 3

func WriteRawByte

func WriteRawByte(w io.Writer, v byte) error

WriteByte writes "byte" value

func WriteRawBytes

func WriteRawBytes(w io.Writer, v []byte) error

WriteBytes writes byte slice raw, not encoded

func WriteRawInt8

func WriteRawInt8(w io.Writer, v int8) error

func WriteRawInt32

func WriteRawInt32(w io.Writer, v int32) error

Write 32 bit raw (no msgpack), typically used for sending payload length

Types

type Char

type Char rune

Char is Apache Ignite "char" type

type Client

type Client interface {
	// Connected return true if connection to the cluster is active
	Connected() bool

	// Do sends request and receives response
	Do(req Request, res Response) error

	// Close closes connection.
	// Returns:
	// nil in case of success.
	// error object in case of error.
	Close() error

	SendHeartbeat() error

	GetTables() (map[int64]string, error)

	GetTable(table string) error

	// CacheCreateWithName Creates a cache with a given name.
	// Cache template can be applied if there is a '*' in the cache name.
	// https://apacheignite.readme.io/docs/binary-client-protocol-cache-configuration-operations#section-op_cache_create_with_name
	CacheCreateWithName(cache string) error

	// CacheGetOrCreateWithName creates a cache with a given name.
	// Cache template can be applied if there is a '*' in the cache name.
	// Does nothing if the cache exists.
	// https://apacheignite.readme.io/docs/binary-client-protocol-cache-configuration-operations#section-op_cache_get_or_create_with_name
	CacheGetOrCreateWithName(cache string) error

	// CacheGetNames returns existing cache names.
	// https://apacheignite.readme.io/docs/binary-client-protocol-cache-configuration-operations#section-op_cache_get_names
	CacheGetNames() ([]string, error)

	// CacheDestroy destroys cache with a given name.
	// https://apacheignite.readme.io/docs/binary-client-protocol-cache-configuration-operations#section-op_cache_destroy
	CacheDestroy(cache string) error

	// CacheGet retrieves a value from cache by key.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get
	CacheGet(cache string, binary bool, key interface{}) (interface{}, error)

	// CacheGetAll retrieves multiple key-value pairs from cache.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_all
	CacheGetAll(cache string, binary bool, keys []interface{}) (map[interface{}]interface{}, error)

	// CachePut puts a value with a given key to cache (overwriting existing value if any).
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_put
	CachePut(cache string, binary bool, key interface{}, value interface{}) error

	// CachePutAll puts a value with a given key to cache (overwriting existing value if any).
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_put_all
	CachePutAll(cache string, binary bool, data map[interface{}]interface{}) error

	// CacheContainsKey returns a value indicating whether given key is present in cache.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_contains_key
	CacheContainsKey(cache string, binary bool, key interface{}) (bool, error)

	// CacheContainsKeys returns a value indicating whether all given keys are present in cache.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_contains_keys
	CacheContainsKeys(cache string, binary bool, keys []interface{}) (bool, error)

	// CacheGetAndPut puts a value with a given key to cache, and returns the previous value for that key.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_and_put
	CacheGetAndPut(cache string, binary bool, key interface{}, value interface{}) (interface{}, error)

	// CacheGetAndReplace puts a value with a given key to cache, returning previous value for that key,
	// if and only if there is a value currently mapped for that key.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_and_replace
	CacheGetAndReplace(cache string, binary bool, key interface{}, value interface{}) (interface{}, error)

	// CacheGetAndRemove removes the cache entry with specified key, returning the value.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_and_remove
	CacheGetAndRemove(cache string, binary bool, key interface{}) (interface{}, error)

	// CachePutIfAbsent puts a value with a given key to cache only if the key does not already exist.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_put_if_absent
	CachePutIfAbsent(cache string, binary bool, key interface{}, value interface{}) (bool, error)

	// CacheGetAndPutIfAbsent puts a value with a given key to cache only if the key does not already exist.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_and_put_if_absent
	CacheGetAndPutIfAbsent(cache string, binary bool, key interface{}, value interface{}) (interface{}, error)

	// CacheReplace puts a value with a given key to cache only if the key already exists.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_replace
	CacheReplace(cache string, binary bool, key interface{}, value interface{}) (bool, error)

	// CacheReplaceIfEquals puts a value with a given key to cache only if
	// the key already exists and value equals provided value.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_replace_if_equals
	CacheReplaceIfEquals(cache string, binary bool, key interface{}, valueCompare interface{}, valueNew interface{}) (bool, error)

	// CacheClear clears the cache without notifying listeners or cache writers.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_clear
	CacheClear(cache string, binary bool) error

	// CacheClearKey clears the cache key without notifying listeners or cache writers.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_clear_key
	CacheClearKey(cache string, binary bool, key interface{}) error

	// CacheClearKeys clears the cache keys without notifying listeners or cache writers.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_clear_keys
	CacheClearKeys(cache string, binary bool, keys []interface{}) error

	// CacheRemoveKey removes an entry with a given key, notifying listeners and cache writers.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_remove_key
	CacheRemoveKey(cache string, binary bool, key interface{}) (bool, error)

	// CacheRemoveIfEquals removes an entry with a given key if provided value is equal to actual value,
	// notifying listeners and cache writers.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_remove_if_equals
	CacheRemoveIfEquals(cache string, binary bool, key interface{}, value interface{}) (bool, error)

	// CacheGetSize gets the number of entries in cache.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_size
	CacheGetSize(cache string, binary bool, modes []byte) (int64, error)

	// CacheRemoveKeys removes entries with given keys, notifying listeners and cache writers.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_remove_keys
	CacheRemoveKeys(cache string, binary bool, keys []interface{}) error

	// CacheRemoveAll destroys cache with a given name.
	// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_remove_all
	CacheRemoveAll(cache string, binary bool) error

	// QuerySQL executes an SQL query over data stored in the cluster. The query returns the whole record (key and value).
	QuerySQL(data QuerySQLData) (QuerySQLResult, error)

	// QuerySQLCursorGetPage retrieves the next SQL query cursor page by cursor id from QuerySQL.
	// It needs the schema (we find it embedded in the metadata of original query)
	QuerySQLCursorGetPage(id int64, metadata *ResultSetMetadata) (QuerySQLResult, error)

	// QuerySQLFieldsRaw is equal to QuerySQLFields but return raw Response object.
	// Used for SQL driver to reduce memory allocations.
	QuerySQLFieldsRaw(data QuerySQLFieldsData) (*ResponseOperation, error)

	// QuerySQLFields performs SQL fields query.
	// https://apacheignite.readme.io/docs/binary-client-protocol-sql-operations#section-op_query_sql_fields
	QuerySQLFields(data QuerySQLFieldsData) (QuerySQLResult, error)

	// QuerySQLFieldsCursorGetPageRaw is equal to QuerySQLFieldsCursorGetPage but return raw Response object.
	// Used for SQL driver to reduce memory allocations.
	QuerySQLFieldsCursorGetPageRaw(id int64) (*ResponseOperation, error)

	// ResourceClose closes a resource, such as query cursor.
	// https://apacheignite.readme.io/docs/binary-client-protocol-sql-operations#section-op_resource_close
	ResourceClose(id int64) error
}

Client is interface to communicate with Apache Ignite cluster. Client is thread safe.

func Connect

func Connect(ci ConnInfo) (Client, error)

Connect connects to the Apache Ignite cluster Returns: client

type ClientDirectTxMode

type ClientDirectTxMode uint8
const (
	ClientDirectTxModeNotSupported ClientDirectTxMode = iota
	ClientDirectTxModeSupported
	ClientDirectTxModeSupportedTrackingRequired
)

func NewClientDirectTxModeFromByte

func NewClientDirectTxModeFromByte(val uint8) ClientDirectTxMode

type ClientPartitionAwarenessMetadata

type ClientPartitionAwarenessMetadata struct {
	TableId      int
	Indexes      []int
	Hash         []int
	DirectTxMode ClientDirectTxMode
}

func NewClientPartitionAwarenessMetadataFromReader

func NewClientPartitionAwarenessMetadataFromReader(r io.Reader, sqlDirectMappingSupported bool) (*ClientPartitionAwarenessMetadata, error)

func ReadPartitionAwareness

func ReadPartitionAwareness(response *ResponseOperation, partAwareness bool, sqlDMSupported bool) (*ClientPartitionAwarenessMetadata, error)

type Column

type Column struct {
	Name string
}

Schema minimal : ordre des colonnes (+ types si nécessaire)

type ColumnMetadata

type ColumnMetadata struct {
	Name     string
	Nullable bool
	//Class<?> valueClass();
	Type      *ColumnType // See columnType.java
	Precision int
	Scale     int
	Index     int
	Origin    *ColumnOrigin
}

func (*ColumnMetadata) ToJsonString

func (c *ColumnMetadata) ToJsonString() string

type ColumnOrigin

type ColumnOrigin struct {
	Schema string
	Table  string
	Column string
}

*

  • Represents a column origin. *
  • <p>Example:
  • <pre>
  • SELECT SUM(price), category as cat, subcategory AS subcategory
  • FROM Goods
  • WHERE [condition]
  • GROUP BY cat, subcategory
  • </pre> *
  • <p>Column origins:
  • <ul>
  • <li>SUM(price): null</li>
  • <li>cat: {"PUBLIC", "Goods", "category"}</li>
  • <li>subcategory: {"PUBLIC", "Goods", "subcategory"}</li>
  • </ul>

func (*ColumnOrigin) ToJsonString

func (c *ColumnOrigin) ToJsonString() string

type ColumnType

type ColumnType struct {
	SQLTypeName      string       // Type name in SQL
	TypeId           int          // Type ID in Ignite3
	GoKind           reflect.Kind // Kind name in Golang
	PrecisionAllowed bool
	ScaleAllowed     bool
	LengthAllowed    bool
}

type ColumnTypes

type ColumnTypes []ColumnType

func (ColumnTypes) GetColumnTypeById

func (c ColumnTypes) GetColumnTypeById(id int) (*ColumnType, error)

func (ColumnTypes) GetKindById

func (c ColumnTypes) GetKindById(id int) (reflect.Kind, error)

func (ColumnTypes) GetKindByName

func (c ColumnTypes) GetKindByName(name string) (reflect.Kind, error)

func (ColumnTypes) GetNameById

func (c ColumnTypes) GetNameById(id int) (string, error)

func (ColumnTypes) GetTypeIdByGoKind

func (c ColumnTypes) GetTypeIdByGoKind(name string) (int, error)

func (ColumnTypes) GetTypeIdBySQLName

func (c ColumnTypes) GetTypeIdBySQLName(name string) (int, error)

type ConnInfo

type ConnInfo struct {
	Network, Host       string
	Port                int
	Major, Minor, Patch int
	Username, Password  string
	Dialer              net.Dialer
	TLSConfig           *tls.Config
}

ConnInfo contains connections parameters

type Date

type Date struct{ Time time.Time }

Ignite type to use in sql driver

func (*Date) FromTime

func (d *Date) FromTime(t time.Time)

type DateTime

type DateTime struct{ Time time.Time }

func (*DateTime) FromTime

func (d *DateTime) FromTime(t time.Time)

type Decimal

type Decimal struct {
	Unscaled *big.Int // number without dot, Ex.: 31415926535
	Scale    int      // number of decimal places, Ex.: 10. So with Unscaled, we got 3.1415926535
}

func (Decimal) BigRat

func (d Decimal) BigRat() *big.Rat

func (Decimal) String

func (d Decimal) String() string

type QuerySQLData

type QuerySQLData struct {
	// Schema for the query
	Schema string

	// SQL query string.
	Query string

	// Query arguments.
	QueryArgs []interface{}

	// Cursor page size.
	PageSize int

	// Timeout(milliseconds) value should be non-negative. Zero value disables timeout.
	Timeout int64
}

QuerySQLData input parameter for QuerySQL func

type QuerySQLFieldsData

type QuerySQLFieldsData struct {
	// Schema for the query; can be empty, in which case default PUBLIC schema will be used.
	Schema string

	// Query cursor page size.
	PageSize int

	// SQL query string.
	Query string

	// Query arguments.
	QueryArgs []interface{}

	// Timeout(milliseconds) value should be non-negative. Zero value disables timeout.
	Timeout int64
}

QuerySQLFieldsData input parameter for QuerySQLFields func

type QuerySQLPage

type QuerySQLPage struct {
	// Key -> Values
	Rows map[int]interface{}

	// Indicates whether more results are available to be fetched with QuerySQLCursorGetPage.
	// When false, query cursor is closed automatically.
	HasMore bool
}

QuerySQLPage is query result page

type QuerySQLResult

type QuerySQLResult struct {
	// Cursor id. Can be closed with ResourceClose func.
	ResponseId int64
	ResourceId int64
	Metadata   *ResultSetMetadata

	HasRowSet bool

	AffectedRows int64
	// Query result first page
	QuerySQLPage
	// contains filtered or unexported fields
}

QuerySQLResult output from QuerySQL func

func ReadQuerySQLResponseHeader

func ReadQuerySQLResponseHeader(result QuerySQLResult, response *ResponseOperation) (QuerySQLResult, error)

type QueryScanData

type QueryScanData struct {
	// Cursor page size.
	PageSize int

	// Number of partitions to query (negative to query entire cache).
	Partitions int

	// Local flag - whether this query should be executed on local node only.
	LocalQuery bool
}

QueryScanData input parameter for QueryScan func

type Request

type Request interface {
	// WriteTo is function to write request data to io.Writer.
	// Returns written bytes.
	WriteTo(w io.Writer) (int64, error)
}

Request is interface of base message request functionality

type RequestHandshake

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

RequestHandshake is struct handshake request

func NewRequestHandshake

func NewRequestHandshake(major, minor, patch int, username, password string) *RequestHandshake

NewRequestHandshake creates new handshake request object Only basic authentication supported

func (*RequestHandshake) Write

func (r *RequestHandshake) Write(p []byte) (n int, err error)

Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n < len(p). Write must not modify the slice data, even temporarily.

Implementations must not retain p.

func (*RequestHandshake) WriteTo

func (r *RequestHandshake) WriteTo(w io.Writer) (int64, error)

WriteTo is function to write handshake request data to io.Writer. Returns written bytes.

type RequestHeartbeat

type RequestHeartbeat struct {
	Code int8
	UID  int64
	// contains filtered or unexported fields
}

RequestHandshake is struct handshake request

func NewRequestHeartbeat

func NewRequestHeartbeat(id int64) *RequestHeartbeat

NewRequestHeartbeat creates new heartbeat request object

func (*RequestHeartbeat) Write

func (r *RequestHeartbeat) Write(p []byte) (n int, err error)

Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n < len(p). Write must not modify the slice data, even temporarily.

Implementations must not retain p.

func (*RequestHeartbeat) WriteTo

func (r *RequestHeartbeat) WriteTo(w io.Writer) (int64, error)

WriteTo is function to write handshake request data to io.Writer. Returns written bytes.

type RequestOperation

type RequestOperation struct {
	Code         int16
	RequestId    int64
	SpecificData []byte
	// contains filtered or unexported fields
}

RequestOperation is struct to store operation request

func NewRequestOperation

func NewRequestOperation(code int16, requestId int64, payload []byte) *RequestOperation

NewRequestOperation creates new handshake request object

func (*RequestOperation) Write

func (r *RequestOperation) Write(p []byte) (n int, err error)

Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n < len(p). Write must not modify the slice data, even temporarily.

Implementations must not retain p.

func (*RequestOperation) WriteTo

func (r *RequestOperation) WriteTo(w io.Writer) (int64, error)

WriteTo is function to write operation request data to io.Writer. Returns written bytes.

type Response

type Response interface {
	// ReadFrom is function to read request data from io.Reader.
	// Returns read bytes.
	ReadFrom(r *bufio.Reader) (int64, error)
}

Response is interface of base message response functionality

type ResponseHandshake

type ResponseHandshake struct {
	// Success flag
	Success bool
	// Server version major, minor, patch
	Major, Minor, Patch int
	ErrorUuid           Uuid
	ErrorMessage        string
	ErrorStackTrace     string
	ErrorDetails        string

	ClientType         int8
	IdleTimeout        int64
	ClusterNodeId      Uuid
	ClusterNodeName    string
	ClusterIdsCount    uint8
	ClusterIds         []Uuid
	ClusterName        string
	ObservableTS       int64
	DBMSVerMajor       uint8
	DBMSVerMinor       uint8
	DBMSVerMaintenance uint8
	DBMSVerPatch       string
	DBMSVerPreRelease  string
	Features           []byte // FIXME
	// contains filtered or unexported fields
}

ResponseHandshake is struct handshake response. It is the only response to have MAGIC_BYTES header

func (*ResponseHandshake) Peek

func (r *ResponseHandshake) Peek(n int) (p []byte, err error)

func (*ResponseHandshake) Read

func (r *ResponseHandshake) Read(p []byte) (n int, err error)

Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Even if Read returns n < len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more.

func (*ResponseHandshake) ReadFrom

func (r *ResponseHandshake) ReadFrom(rr *bufio.Reader) (int64, error)

v3_OK ReadFrom is function to read request data from io.Reader. Returns read bytes.

type ResponseHeartbeat

type ResponseHeartbeat struct {
	// Request id
	UID int64
	// Status code (0 for success, otherwise error code)
	Status int32
	// What is this data?
	UnknownData int64
	// contains filtered or unexported fields
}

ResponseOperation is struct operation response

func NewResponseHeartbeat

func NewResponseHeartbeat(uid int64) *ResponseHeartbeat

NewResponseOperation is ResponseHeartbeat constructor

func (*ResponseHeartbeat) CheckStatus

func (r *ResponseHeartbeat) CheckStatus() error

CheckStatus checks status of operation execution. Returns: nil in case of success. error object in case of operation failed.

func (*ResponseHeartbeat) Peek

func (r *ResponseHeartbeat) Peek(n int) (p []byte, err error)

func (*ResponseHeartbeat) Read

func (r *ResponseHeartbeat) Read(p []byte) (n int, err error)

Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Even if Read returns n < len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more.

func (*ResponseHeartbeat) ReadFrom

func (r *ResponseHeartbeat) ReadFrom(rr *bufio.Reader) (int64, error)

ReadFrom is function to read request data from io.Reader. Returns read bytes. heartbeat request : 00000002 01 04 heartbeat response : 0000000b 04 00 d3 00 00 00 00 00 00 00

type ResponseOperation

type ResponseOperation struct {
	// Request id
	RequestId int64
	// Status code (0 for success, otherwise error code)
	Flags int32
	// Observable Timestamp (causality token)
	ObsTs time.Time
	// Error message (present only when status is not 0)
	Code    int64
	Uuid    Uuid
	Message string
	Details string

	// Copie des données restantes, pour comprendre pourquoi j'ai un EOF :
	// ping failed: failed to execute ping query: failed to read result set column metadata: failed to read result set column property count: EOF
	Data bytes.Buffer
	// contains filtered or unexported fields
}

ResponseOperation is struct operation response

func NewResponseOperation

func NewResponseOperation(uid int64) *ResponseOperation

NewResponseOperation is ResponseOperation constructor

func (*ResponseOperation) CheckStatus

func (r *ResponseOperation) CheckStatus() error

CheckStatus checks status of operation execution. Returns: nil in case of success. error object in case of operation failed.

func (*ResponseOperation) GetMessage

func (r *ResponseOperation) GetMessage() io.Reader

GRUIIKKK TODO: REMOVE ME

func (*ResponseOperation) Peek

func (r *ResponseOperation) Peek(n int) (p []byte, err error)

func (*ResponseOperation) Read

func (r *ResponseOperation) Read(p []byte) (n int, err error)

Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Even if Read returns n < len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more.

func (*ResponseOperation) ReadFrom

func (r *ResponseOperation) ReadFrom(rr *bufio.Reader) (int64, error)

ReadFrom is function to read request data from io.Reader. Returns read bytes.

type ResultSetMetadata

type ResultSetMetadata struct {
	Columns []ColumnMetadata
}

func NewResultSetMetadataFromReader

func NewResultSetMetadataFromReader(r io.Reader) (*ResultSetMetadata, error)

func (*ResultSetMetadata) GetColumnOriginNameById

func (r *ResultSetMetadata) GetColumnOriginNameById(index int) (string, error)

func (*ResultSetMetadata) GetColumnPrecisionById

func (r *ResultSetMetadata) GetColumnPrecisionById(index int) (int, error)

func (*ResultSetMetadata) GetColumnScaleById

func (r *ResultSetMetadata) GetColumnScaleById(index int) (int, error)

func (*ResultSetMetadata) GetColumnTypeById

func (r *ResultSetMetadata) GetColumnTypeById(index int) (*ColumnType, error)

func (*ResultSetMetadata) GetSchemaOriginNameById

func (r *ResultSetMetadata) GetSchemaOriginNameById(index int) (string, error)

func (*ResultSetMetadata) GetTableOriginNameById

func (r *ResultSetMetadata) GetTableOriginNameById(index int) (string, error)

func (*ResultSetMetadata) IndexOf

func (r *ResultSetMetadata) IndexOf(column string) int

func (*ResultSetMetadata) NewColumnMetadataFromReader

func (rs *ResultSetMetadata) NewColumnMetadataFromReader(r io.Reader, index int) error

func (*ResultSetMetadata) NewColumnOriginFromReaderWithDefault

func (rs *ResultSetMetadata) NewColumnOriginFromReaderWithDefault(r io.Reader, columnName string) (*ColumnOrigin, error)

type Schema

type Schema struct {
	Columns []Column
	// contains filtered or unexported fields
}

func NewSchema

func NewSchema(cols []string) *Schema

type Time

type Time struct{ Time time.Time }

func (*Time) FromTime

func (d *Time) FromTime(t time.Time)

type Timestamp

type Timestamp struct{ Time time.Time }

func (*Timestamp) FromTime

func (ts *Timestamp) FromTime(t time.Time)

func (*Timestamp) Scan

func (t *Timestamp) Scan(src any) error

type Tuple

type Tuple struct {
	BinaryTuple *bytes.Buffer
	// contains filtered or unexported fields
}

Ref modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleBuilder.java

func NewTuple

func NewTuple() *Tuple

func NewTupleFromByteArrayWithMetadata

func NewTupleFromByteArrayWithMetadata(meta *ResultSetMetadata, bufr []byte) (*Tuple, error)

func (*Tuple) AddValue

func (t *Tuple) AddValue(v interface{}) error

Build a tsv and append to tuple

func (*Tuple) Bytes

func (t *Tuple) Bytes() ([]byte, error)

func (*Tuple) GetLength

func (t *Tuple) GetLength() int

func (*Tuple) GetValue

func (t *Tuple) GetValue(index int, valType int) (interface{}, error)

type Uuid

type Uuid struct {
	uuid.UUID
}

func ReadPackedUUID

func ReadPackedUUID(r io.Reader) (Uuid, error)

ReadUUID reads "UUID" object value

func (*Uuid) Flip

func (u *Uuid) Flip()

func (*Uuid) FromString

func (u *Uuid) FromString(uid string)

func (*Uuid) FromUUID

func (u *Uuid) FromUUID(uid uuid.UUID)

func (*Uuid) MarshalMsgpack

func (u *Uuid) MarshalMsgpack() ([]byte, error)

func (*Uuid) New

func (u *Uuid) New()

func (*Uuid) UnmarshalMsgpack

func (u *Uuid) UnmarshalMsgpack(b []byte) error

Prend en entree les donnees brutes, sans l'entete msgpack

Jump to

Keyboard shortcuts

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