Documentation
¶
Index ¶
- Constants
- Variables
- func ValidateExecuteRequest(req ExecuteRequest) error
- type CommitUnknownError
- type DecisionsResponse
- type ExecuteRequest
- type ExecuteResponse
- type GraphExecuteResponse
- type GraphQueryRequest
- type GraphStreamOffsetRequest
- type GraphStreamOffsetResponse
- type GraphStreamReadRequest
- type GraphStreamReadResponse
- type GraphStreamTrimRequest
- type KVGetRequest
- type KVGetResponse
- type KVMutationRequest
- type KVMutationResponse
- type PeerServer
- type QueryRequest
- type QueryResponse
- type RequestStatusRequest
- type RequestStatusResponse
- type Server
- func (s *Server) Close()
- func (s *Server) Execute(ctx context.Context, req ExecuteRequest) (ExecuteResponse, error)
- func (s *Server) GraphChanges(ctx context.Context, request GraphStreamReadRequest) (GraphStreamReadResponse, error)
- func (s *Server) GraphExecute(ctx context.Context, command types.GraphCommand) (GraphExecuteResponse, error)
- func (s *Server) GraphQuery(ctx context.Context, request GraphQueryRequest) (types.GraphCommandResult, error)
- func (s *Server) GraphStreamOffset(ctx context.Context, request GraphStreamOffsetRequest) (GraphStreamOffsetResponse, error)
- func (s *Server) GraphStreamRead(ctx context.Context, request GraphStreamReadRequest) (GraphStreamReadResponse, error)
- func (s *Server) KVCAS(ctx context.Context, req KVMutationRequest) (KVMutationResponse, error)
- func (s *Server) KVDelete(ctx context.Context, req KVMutationRequest) (KVMutationResponse, error)
- func (s *Server) KVGet(ctx context.Context, req KVGetRequest) (KVGetResponse, error)
- func (s *Server) KVMutate(ctx context.Context, operation string, req KVMutationRequest) (KVMutationResponse, error)
- func (s *Server) KVPut(ctx context.Context, req KVMutationRequest) (KVMutationResponse, error)
- func (s *Server) NotificationDrops() uint64
- func (s *Server) NotifyPublish(ctx context.Context, req types.NotifyCommand) (types.MutationReceipt, error)
- func (s *Server) NotifySubscribe(topic string) (<-chan []byte, func(), error)
- func (s *Server) ProposeControl(ctx context.Context, value []byte) (quepaxa.Slot, error)
- func (s *Server) Query(ctx context.Context, req QueryRequest) (QueryResponse, error)
- func (s *Server) Quiesce(ctx context.Context) (func(), error)
- func (s *Server) RequestStatus(ctx context.Context, req RequestStatusRequest) (RequestStatusResponse, error)
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) SetCheckpointPrepare(prepare func(context.Context, quepaxa.NodeID, quepaxa.CheckpointSeal) error)
- func (s *Server) SetCompactedHandler(handler func())
- func (s *Server) SetDurabilityBarrier(barrier func(context.Context, quepaxa.Slot) error)
- func (s *Server) SetGraphStreamOffset(ctx context.Context, request GraphStreamOffsetRequest) error
- func (s *Server) SetObjectStoreStats(stats func() (map[string]uint64, bool))
- func (s *Server) TrimGraphStream(ctx context.Context, request GraphStreamTrimRequest) error
- type Transport
- func (t *Transport) Close() error
- func (t *Transport) FetchDecisions(ctx context.Context, source quepaxa.NodeID, from quepaxa.Slot, limit int) (DecisionsResponse, error)
- func (t *Transport) FetchValue(ctx context.Context, from quepaxa.NodeID, hash quepaxa.ValueHash) ([]byte, error)
- func (t *Transport) PrepareCheckpoint(ctx context.Context, seal quepaxa.CheckpointSeal) error
- func (t *Transport) Propose(ctx context.Context, to quepaxa.NodeID, value []byte) (quepaxa.DecidedValue, error)
- func (t *Transport) ReadTip(ctx context.Context, to quepaxa.NodeID) (quepaxa.Slot, error)
- func (t *Transport) SendDecision(ctx context.Context, decision quepaxa.Decision) error
- func (t *Transport) SendRecord(ctx context.Context, to quepaxa.NodeID, request quepaxa.RecordRequest) (quepaxa.Summary, error)
- func (t *Transport) StageValue(ctx context.Context, to quepaxa.NodeID, hash quepaxa.ValueHash, value []byte) error
Constants ¶
const MaxRequestBodyBytes = 1 << 20
MaxRequestBodyBytes is the HTTP adapter's JSON decoding limit. Replicated mutations have the smaller quepaxa.MaxReplicatedValueBytes consensus limit.
Variables ¶
Functions ¶
func ValidateExecuteRequest ¶ added in v0.8.1
func ValidateExecuteRequest(req ExecuteRequest) error
ValidateExecuteRequest applies the same mutation contract and encoded-size check as Execute without submitting the command.
Types ¶
type CommitUnknownError ¶
type CommitUnknownError struct {
Slot quepaxa.Slot
RequestID string
RetryThroughSlot uint64
Cause error
}
CommitUnknownError means a mutation may commit despite the failed call. Retrying the same request ID resolves the outcome without duplicating it.
func (*CommitUnknownError) Error ¶
func (e *CommitUnknownError) Error() string
func (*CommitUnknownError) Unwrap ¶
func (e *CommitUnknownError) Unwrap() []error
type DecisionsResponse ¶
type ExecuteRequest ¶
type ExecuteRequest struct {
RequestID string `json:"request_id"`
SQL string `json:"sql,omitempty"`
Args []any `json:"args,omitempty"`
// WantRows is unsupported for replicated mutations; use Query after Execute.
WantRows bool `json:"want_rows,omitempty"`
Statements []types.SQLStatement `json:"statements,omitempty"`
}
ExecuteRequest is the request body for execute.
type ExecuteResponse ¶
type ExecuteResponse struct {
types.MutationReceipt
}
ExecuteResponse contains the bounded aggregate receipt retained for retries. Replicated statement rows are not returned; use Query after Execute.
type GraphExecuteResponse ¶
type GraphExecuteResponse struct {
types.MutationReceipt
}
type GraphQueryRequest ¶
type GraphStreamReadRequest ¶
type GraphStreamReadResponse ¶
type GraphStreamReadResponse struct {
Records []types.GraphStreamRecord `json:"records"`
AppliedSlot uint64 `json:"applied_slot"`
ConsensusTip uint64 `json:"consensus_tip"`
}
type GraphStreamTrimRequest ¶
type KVGetRequest ¶
type KVGetRequest struct{ Key, Consistency string }
type KVGetResponse ¶
type KVMutationRequest ¶
type KVMutationResponse ¶
type KVMutationResponse struct {
types.MutationReceipt
}
type PeerServer ¶
type PeerServer struct {
// contains filtered or unexported fields
}
PeerServer owns the private QUIC listener. Public HTTP remains a separate adapter.
func StartPeerServer ¶
func (*PeerServer) Addr ¶
func (s *PeerServer) Addr() string
func (*PeerServer) Close ¶
func (s *PeerServer) Close() error
type QueryRequest ¶
type QueryRequest struct {
SQL string `json:"sql"`
Args []any `json:"args,omitempty"`
Consistency string `json:"consistency,omitempty"`
}
QueryRequest is the request body for query.
type QueryResponse ¶
type QueryResponse struct {
Columns []string `json:"columns"`
Rows [][]interface{} `json:"rows"`
AppliedSlot uint64 `json:"applied_slot"`
ConsensusTip uint64 `json:"consensus_tip"`
}
QueryResponse is the response body for query.
type RequestStatusRequest ¶
type RequestStatusResponse ¶
type RequestStatusResponse struct {
State string `json:"state"`
Tip uint64 `json:"tip"`
Receipt *types.MutationReceipt `json:"receipt,omitempty"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP server for client API.
func NewServer ¶
func NewServer(core *quepaxa.Core, material *materializer.Materializer, cluster types.ClusterID, writable bool, transport *Transport, members []quepaxa.Member, hedgeDelay time.Duration, ready ...func() bool) *Server
NewServer creates a new HTTP server.
func (*Server) Execute ¶
func (s *Server) Execute(ctx context.Context, req ExecuteRequest) (ExecuteResponse, error)
Execute applies one SQL statement or an atomic statements transaction.
func (*Server) GraphChanges ¶
func (s *Server) GraphChanges(ctx context.Context, request GraphStreamReadRequest) (GraphStreamReadResponse, error)
func (*Server) GraphExecute ¶
func (s *Server) GraphExecute(ctx context.Context, command types.GraphCommand) (GraphExecuteResponse, error)
func (*Server) GraphQuery ¶
func (s *Server) GraphQuery(ctx context.Context, request GraphQueryRequest) (types.GraphCommandResult, error)
func (*Server) GraphStreamOffset ¶
func (s *Server) GraphStreamOffset(ctx context.Context, request GraphStreamOffsetRequest) (GraphStreamOffsetResponse, error)
func (*Server) GraphStreamRead ¶
func (s *Server) GraphStreamRead(ctx context.Context, request GraphStreamReadRequest) (GraphStreamReadResponse, error)
func (*Server) KVCAS ¶
func (s *Server) KVCAS(ctx context.Context, req KVMutationRequest) (KVMutationResponse, error)
func (*Server) KVDelete ¶
func (s *Server) KVDelete(ctx context.Context, req KVMutationRequest) (KVMutationResponse, error)
func (*Server) KVGet ¶
func (s *Server) KVGet(ctx context.Context, req KVGetRequest) (KVGetResponse, error)
func (*Server) KVMutate ¶
func (s *Server) KVMutate(ctx context.Context, operation string, req KVMutationRequest) (KVMutationResponse, error)
func (*Server) KVPut ¶
func (s *Server) KVPut(ctx context.Context, req KVMutationRequest) (KVMutationResponse, error)
func (*Server) NotificationDrops ¶
func (*Server) NotifyPublish ¶
func (s *Server) NotifyPublish(ctx context.Context, req types.NotifyCommand) (types.MutationReceipt, error)
func (*Server) NotifySubscribe ¶
func (*Server) ProposeControl ¶
ProposeControl commits an internal read barrier through the normal bounded proposal lifecycle.
func (*Server) Query ¶
func (s *Server) Query(ctx context.Context, req QueryRequest) (QueryResponse, error)
Query reads SQL locally or after a linearizable consensus barrier.
func (*Server) Quiesce ¶
Quiesce drains proposals and excludes decision application while a certified checkpoint replaces local consensus and materialized state.
func (*Server) RequestStatus ¶
func (s *Server) RequestStatus(ctx context.Context, req RequestStatusRequest) (RequestStatusResponse, error)
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler.
func (*Server) SetCheckpointPrepare ¶
func (*Server) SetCompactedHandler ¶
func (s *Server) SetCompactedHandler(handler func())
SetCompactedHandler installs the recovery trigger used when a peer has compacted history this node still needs.
func (*Server) SetDurabilityBarrier ¶
SetDurabilityBarrier installs the mutation ACK barrier before the server is exposed.
func (*Server) SetGraphStreamOffset ¶
func (s *Server) SetGraphStreamOffset(ctx context.Context, request GraphStreamOffsetRequest) error
func (*Server) SetObjectStoreStats ¶
func (*Server) TrimGraphStream ¶
func (s *Server) TrimGraphStream(ctx context.Context, request GraphStreamTrimRequest) error
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport sends private peer RPCs over persistent raw QUIC connections.
func NewTransport ¶
func (*Transport) FetchDecisions ¶
func (*Transport) FetchValue ¶
func (*Transport) PrepareCheckpoint ¶
PrepareCheckpoint waits for a durable verified quorum before the small seal value enters normal consensus.