Documentation
¶
Index ¶
- func RegisterTypedObjectResource(mux srpc.Mux, le *logrus.Entry, b bus.Bus, ws world.WorldState, ...)
- type EngineResource
- func (r *EngineResource) AccessTypedObject(ctx context.Context, req *s4wave_world.AccessTypedObjectRequest) (*s4wave_world.AccessTypedObjectResponse, error)
- func (r *EngineResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
- func (r *EngineResource) BuildStorageCursor(ctx context.Context, req *s4wave_world.BuildStorageCursorRequest) (*s4wave_world.BuildStorageCursorResponse, error)
- func (r *EngineResource) GetEngineInfo(ctx context.Context, req *s4wave_world.GetEngineInfoRequest) (*s4wave_world.GetEngineInfoResponse, error)
- func (r *EngineResource) GetMux() srpc.Invoker
- func (r *EngineResource) GetSeqno(ctx context.Context, req *s4wave_world.GetSeqnoRequest) (*s4wave_world.GetSeqnoResponse, error)
- func (r *EngineResource) GetWorldRootSnapshot(ctx context.Context, req *s4wave_world.GetWorldRootSnapshotRequest) (*s4wave_world.WorldRootSnapshot, error)
- func (r *EngineResource) NewTransaction(ctx context.Context, req *s4wave_world.NewTransactionRequest) (*s4wave_world.NewTransactionResponse, error)
- func (r *EngineResource) Sync(ctx context.Context, req *s4wave_world.SyncRequest) (*s4wave_world.SyncResponse, error)
- func (r *EngineResource) WaitSeqno(ctx context.Context, req *s4wave_world.WaitSeqnoRequest) (*s4wave_world.WaitSeqnoResponse, error)
- func (r *EngineResource) WatchWorldRootSnapshots(req *s4wave_world.WatchWorldRootSnapshotsRequest, ...) error
- func (r *EngineResource) WatchWorldState(req *s4wave_world.WatchWorldStateRequest, ...) error
- type GraphPathQueryResource
- func (r *GraphPathQueryResource) Close(ctx context.Context, req *s4wave_world.CloseGraphPathQueryRequest) (*s4wave_world.CloseGraphPathQueryResponse, error)
- func (r *GraphPathQueryResource) GetMux() srpc.Invoker
- func (r *GraphPathQueryResource) Next(ctx context.Context, req *s4wave_world.NextGraphPathQueryRequest) (*s4wave_world.NextGraphPathQueryResponse, error)
- type ObjectIteratorResource
- func (r *ObjectIteratorResource) Close(ctx context.Context, req *s4wave_world.CloseRequest) (*s4wave_world.CloseResponse, error)
- func (r *ObjectIteratorResource) Err(ctx context.Context, req *s4wave_world.ErrRequest) (*s4wave_world.ErrResponse, error)
- func (r *ObjectIteratorResource) GetMux() srpc.Invoker
- func (r *ObjectIteratorResource) Key(ctx context.Context, req *s4wave_world.KeyRequest) (*s4wave_world.KeyResponse, error)
- func (r *ObjectIteratorResource) Next(ctx context.Context, req *s4wave_world.NextRequest) (*s4wave_world.NextResponse, error)
- func (r *ObjectIteratorResource) Seek(ctx context.Context, req *s4wave_world.SeekRequest) (*s4wave_world.SeekResponse, error)
- func (r *ObjectIteratorResource) Valid(ctx context.Context, req *s4wave_world.ValidRequest) (*s4wave_world.ValidResponse, error)
- type ObjectStateResource
- func (r *ObjectStateResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
- func (r *ObjectStateResource) ApplyObjectOp(ctx context.Context, req *s4wave_world.ApplyObjectOpRequest) (*s4wave_world.ApplyObjectOpResponse, error)
- func (r *ObjectStateResource) GetKey(ctx context.Context, req *s4wave_world.GetKeyRequest) (*s4wave_world.GetKeyResponse, error)
- func (r *ObjectStateResource) GetMux() srpc.Invoker
- func (r *ObjectStateResource) GetRootRef(ctx context.Context, req *s4wave_world.GetRootRefRequest) (*s4wave_world.GetRootRefResponse, error)
- func (r *ObjectStateResource) IncrementRev(ctx context.Context, req *s4wave_world.IncrementRevRequest) (*s4wave_world.IncrementRevResponse, error)
- func (r *ObjectStateResource) SetRootRef(ctx context.Context, req *s4wave_world.SetRootRefRequest) (*s4wave_world.SetRootRefResponse, error)
- func (r *ObjectStateResource) WaitRev(ctx context.Context, req *s4wave_world.WaitRevRequest) (*s4wave_world.WaitRevResponse, error)
- type TrackedWorldState
- func (t *TrackedWorldState) AccessCayleyGraph(ctx context.Context, write bool, ...) error
- func (t *TrackedWorldState) AccessWorldState(ctx context.Context, ref *bucket.ObjectRef, ...) error
- func (t *TrackedWorldState) ApplyWorldOp(ctx context.Context, op world.Operation, opSender peer.ID) (uint64, bool, error)
- func (t *TrackedWorldState) BuildStorageCursor(ctx context.Context) (*bucket_lookup.Cursor, error)
- func (t *TrackedWorldState) Close()
- func (t *TrackedWorldState) CreateObject(ctx context.Context, key string, rootRef *bucket.ObjectRef) (world.ObjectState, error)
- func (t *TrackedWorldState) DeleteGraphObject(ctx context.Context, objKey string) error
- func (t *TrackedWorldState) DeleteGraphQuad(ctx context.Context, q world.GraphQuad) error
- func (t *TrackedWorldState) DeleteObject(ctx context.Context, key string) (bool, error)
- func (t *TrackedWorldState) GetObject(ctx context.Context, key string) (world.ObjectState, bool, error)
- func (t *TrackedWorldState) GetReadOnly() bool
- func (t *TrackedWorldState) GetSeqno(ctx context.Context) (uint64, error)
- func (t *TrackedWorldState) IterateObjects(ctx context.Context, prefix string, reversed bool) world.ObjectIterator
- func (t *TrackedWorldState) LookupGraphQuads(ctx context.Context, filter world.GraphQuad, limit uint32) ([]world.GraphQuad, error)
- func (t *TrackedWorldState) LookupGraphQuadsBatch(ctx context.Context, filters []world.GraphQuad, limitPerFilter uint32) ([][]world.GraphQuad, error)
- func (t *TrackedWorldState) QueryGraphPath(ctx context.Context, query *world.GraphPathQuery) (*world.GraphPathQueryResult, error)
- func (t *TrackedWorldState) RenameObject(ctx context.Context, oldKey, newKey string, descendants bool) (world.ObjectState, error)
- func (t *TrackedWorldState) SetGraphQuad(ctx context.Context, q world.GraphQuad) error
- func (t *TrackedWorldState) Sync(ctx context.Context) (bool, error)
- func (t *TrackedWorldState) WaitForChanges(ctx context.Context) error
- func (t *TrackedWorldState) WaitSeqno(ctx context.Context, seqno uint64) (uint64, error)
- type TxResource
- type TypedObjectResource
- type WorldStateOperationObserver
- type WorldStateOperationRecord
- type WorldStateResource
- func (r *WorldStateResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
- func (r *WorldStateResource) ApplyWorldOp(ctx context.Context, req *s4wave_world.ApplyWorldOpRequest) (*s4wave_world.ApplyWorldOpResponse, error)
- func (r *WorldStateResource) BuildStorageCursor(ctx context.Context, req *s4wave_world.BuildStorageCursorRequest) (*s4wave_world.BuildStorageCursorResponse, error)
- func (r *WorldStateResource) CreateObject(ctx context.Context, req *s4wave_world.CreateObjectRequest) (*s4wave_world.CreateObjectResponse, error)
- func (r *WorldStateResource) DeleteGraphObject(ctx context.Context, req *s4wave_world.DeleteGraphObjectRequest) (*s4wave_world.DeleteGraphObjectResponse, error)
- func (r *WorldStateResource) DeleteGraphQuad(ctx context.Context, req *s4wave_world.DeleteGraphQuadRequest) (*s4wave_world.DeleteGraphQuadResponse, error)
- func (r *WorldStateResource) DeleteObject(ctx context.Context, req *s4wave_world.DeleteObjectRequest) (*s4wave_world.DeleteObjectResponse, error)
- func (r *WorldStateResource) GetMux() srpc.Invoker
- func (r *WorldStateResource) GetObject(ctx context.Context, req *s4wave_world.GetObjectRequest) (*s4wave_world.GetObjectResponse, error)
- func (r *WorldStateResource) GetObjectMetadataBatch(ctx context.Context, req *s4wave_world.GetObjectMetadataBatchRequest) (*s4wave_world.GetObjectMetadataBatchResponse, error)
- func (r *WorldStateResource) GetObjectRootRefsBatch(ctx context.Context, req *s4wave_world.GetObjectRootRefsBatchRequest) (*s4wave_world.GetObjectRootRefsBatchResponse, error)
- func (r *WorldStateResource) GetReadOnly(ctx context.Context, req *s4wave_world.GetReadOnlyRequest) (*s4wave_world.GetReadOnlyResponse, error)
- func (r *WorldStateResource) GetSeqno(ctx context.Context, req *s4wave_world.GetSeqnoRequest) (*s4wave_world.GetSeqnoResponse, error)
- func (r *WorldStateResource) IterateObjects(ctx context.Context, req *s4wave_world.IterateObjectsRequest) (*s4wave_world.IterateObjectsResponse, error)
- func (r *WorldStateResource) ListGraphEdgeBuckets(ctx context.Context, req *s4wave_world.ListGraphEdgeBucketsRequest) (*s4wave_world.ListGraphEdgeBucketsResponse, error)
- func (r *WorldStateResource) ListObjectsWithType(ctx context.Context, req *s4wave_world.ListObjectsWithTypeRequest) (*s4wave_world.ListObjectsWithTypeResponse, error)
- func (r *WorldStateResource) LookupGraphQuads(ctx context.Context, req *s4wave_world.LookupGraphQuadsRequest) (*s4wave_world.LookupGraphQuadsResponse, error)
- func (r *WorldStateResource) LookupGraphQuadsBatch(ctx context.Context, req *s4wave_world.LookupGraphQuadsBatchRequest) (*s4wave_world.LookupGraphQuadsBatchResponse, error)
- func (r *WorldStateResource) QueryGraphPath(ctx context.Context, req *s4wave_world.QueryGraphPathRequest) (*s4wave_world.QueryGraphPathResponse, error)
- func (r *WorldStateResource) RenameObject(ctx context.Context, req *s4wave_world.RenameObjectRequest) (*s4wave_world.RenameObjectResponse, error)
- func (r *WorldStateResource) SetGraphQuad(ctx context.Context, req *s4wave_world.SetGraphQuadRequest) (*s4wave_world.SetGraphQuadResponse, error)
- func (r *WorldStateResource) Sync(ctx context.Context, req *s4wave_world.SyncRequest) (*s4wave_world.SyncResponse, error)
- func (r *WorldStateResource) WaitSeqno(ctx context.Context, req *s4wave_world.WaitSeqnoRequest) (*s4wave_world.WaitSeqnoResponse, error)
- type WorldStateResourceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EngineResource ¶
type EngineResource struct {
// contains filtered or unexported fields
}
EngineResource wraps an Engine for resource access.
func NewEngineResource ¶
func NewEngineResource( le *logrus.Entry, b bus.Bus, w world.Engine, lookupOp world.LookupOp, engineInfo *s4wave_world.EngineInfo, opts ...WorldStateResourceOption, ) *EngineResource
NewEngineResource creates a new EngineResource.
func (*EngineResource) AccessTypedObject ¶
func (r *EngineResource) AccessTypedObject(ctx context.Context, req *s4wave_world.AccessTypedObjectRequest) (*s4wave_world.AccessTypedObjectResponse, error)
AccessTypedObject looks up an object, determines its type, and returns a typed resource.
func (*EngineResource) AccessWorldState ¶
func (r *EngineResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
AccessWorldState builds a bucket lookup cursor with an optional ref.
func (*EngineResource) BuildStorageCursor ¶
func (r *EngineResource) BuildStorageCursor(ctx context.Context, req *s4wave_world.BuildStorageCursorRequest) (*s4wave_world.BuildStorageCursorResponse, error)
BuildStorageCursor builds a cursor to the world storage with an empty ref.
func (*EngineResource) GetEngineInfo ¶
func (r *EngineResource) GetEngineInfo(ctx context.Context, req *s4wave_world.GetEngineInfoRequest) (*s4wave_world.GetEngineInfoResponse, error)
GetEngineInfo returns information about the world engine.
func (*EngineResource) GetMux ¶
func (r *EngineResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*EngineResource) GetSeqno ¶
func (r *EngineResource) GetSeqno(ctx context.Context, req *s4wave_world.GetSeqnoRequest) (*s4wave_world.GetSeqnoResponse, error)
GetSeqno returns the current seqno of the world state.
func (*EngineResource) GetWorldRootSnapshot ¶ added in v0.51.7
func (r *EngineResource) GetWorldRootSnapshot(ctx context.Context, req *s4wave_world.GetWorldRootSnapshotRequest) (*s4wave_world.WorldRootSnapshot, error)
GetWorldRootSnapshot returns the current committed World root.
func (*EngineResource) NewTransaction ¶
func (r *EngineResource) NewTransaction(ctx context.Context, req *s4wave_world.NewTransactionRequest) (*s4wave_world.NewTransactionResponse, error)
NewTransaction creates a new transaction against the world state.
func (*EngineResource) Sync ¶ added in v0.52.0
func (r *EngineResource) Sync(ctx context.Context, req *s4wave_world.SyncRequest) (*s4wave_world.SyncResponse, error)
Sync fences durable storage and advances the durable head via the engine.
func (*EngineResource) WaitSeqno ¶
func (r *EngineResource) WaitSeqno(ctx context.Context, req *s4wave_world.WaitSeqnoRequest) (*s4wave_world.WaitSeqnoResponse, error)
WaitSeqno waits for the seqno of the world state to be >= value.
func (*EngineResource) WatchWorldRootSnapshots ¶ added in v0.51.7
func (r *EngineResource) WatchWorldRootSnapshots( req *s4wave_world.WatchWorldRootSnapshotsRequest, stream s4wave_world.SRPCEngineResourceService_WatchWorldRootSnapshotsStream, ) error
WatchWorldRootSnapshots streams committed World root snapshots.
func (*EngineResource) WatchWorldState ¶
func (r *EngineResource) WatchWorldState( req *s4wave_world.WatchWorldStateRequest, stream s4wave_world.SRPCWatchWorldStateResourceService_WatchWorldStateStream, ) error
WatchWorldState implements the streaming watch RPC. Change detection starts immediately as client accesses resources.
type GraphPathQueryResource ¶ added in v0.51.6
type GraphPathQueryResource struct {
// contains filtered or unexported fields
}
GraphPathQueryResource wraps bounded graph path query results.
func NewGraphPathQueryResource ¶ added in v0.51.6
func NewGraphPathQueryResource( le *logrus.Entry, b bus.Bus, result *world.GraphPathQueryResult, pageSize uint32, ) *GraphPathQueryResource
NewGraphPathQueryResource creates a graph path query resource.
func (*GraphPathQueryResource) Close ¶ added in v0.51.6
func (r *GraphPathQueryResource) Close(ctx context.Context, req *s4wave_world.CloseGraphPathQueryRequest) (*s4wave_world.CloseGraphPathQueryResponse, error)
Close closes the graph path query resource.
func (*GraphPathQueryResource) GetMux ¶ added in v0.51.6
func (r *GraphPathQueryResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*GraphPathQueryResource) Next ¶ added in v0.51.6
func (r *GraphPathQueryResource) Next(ctx context.Context, req *s4wave_world.NextGraphPathQueryRequest) (*s4wave_world.NextGraphPathQueryResponse, error)
Next returns the next page of path query results.
type ObjectIteratorResource ¶
type ObjectIteratorResource struct {
// contains filtered or unexported fields
}
ObjectIteratorResource wraps an ObjectIterator for resource access.
func NewObjectIteratorResource ¶
func NewObjectIteratorResource(le *logrus.Entry, b bus.Bus, iter world.ObjectIterator) *ObjectIteratorResource
NewObjectIteratorResource creates a new ObjectIteratorResource.
func (*ObjectIteratorResource) Close ¶
func (r *ObjectIteratorResource) Close(ctx context.Context, req *s4wave_world.CloseRequest) (*s4wave_world.CloseResponse, error)
Close closes the iterator.
func (*ObjectIteratorResource) Err ¶
func (r *ObjectIteratorResource) Err(ctx context.Context, req *s4wave_world.ErrRequest) (*s4wave_world.ErrResponse, error)
Err returns any error that has closed the iterator.
func (*ObjectIteratorResource) GetMux ¶
func (r *ObjectIteratorResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*ObjectIteratorResource) Key ¶
func (r *ObjectIteratorResource) Key(ctx context.Context, req *s4wave_world.KeyRequest) (*s4wave_world.KeyResponse, error)
Key returns the current entry key, or empty if not valid.
func (*ObjectIteratorResource) Next ¶
func (r *ObjectIteratorResource) Next(ctx context.Context, req *s4wave_world.NextRequest) (*s4wave_world.NextResponse, error)
Next advances to the next entry and returns Valid.
func (*ObjectIteratorResource) Seek ¶
func (r *ObjectIteratorResource) Seek(ctx context.Context, req *s4wave_world.SeekRequest) (*s4wave_world.SeekResponse, error)
Seek moves the iterator to the first key >= the provided key (or <= in reverse mode).
func (*ObjectIteratorResource) Valid ¶
func (r *ObjectIteratorResource) Valid(ctx context.Context, req *s4wave_world.ValidRequest) (*s4wave_world.ValidResponse, error)
Valid returns if the iterator points to a valid entry.
type ObjectStateResource ¶
type ObjectStateResource struct {
// contains filtered or unexported fields
}
ObjectStateResource wraps an ObjectState for resource access.
func NewObjectStateResource ¶
func NewObjectStateResource(le *logrus.Entry, b bus.Bus, obj world.ObjectState, lookupOp world.LookupOp) *ObjectStateResource
NewObjectStateResource creates a new ObjectStateResource.
lookupOp may be nil
func (*ObjectStateResource) AccessWorldState ¶
func (r *ObjectStateResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
AccessWorldState builds a bucket lookup cursor with an optional ref.
func (*ObjectStateResource) ApplyObjectOp ¶
func (r *ObjectStateResource) ApplyObjectOp(ctx context.Context, req *s4wave_world.ApplyObjectOpRequest) (*s4wave_world.ApplyObjectOpResponse, error)
ApplyObjectOp applies a batch operation at the object level.
func (*ObjectStateResource) GetKey ¶
func (r *ObjectStateResource) GetKey(ctx context.Context, req *s4wave_world.GetKeyRequest) (*s4wave_world.GetKeyResponse, error)
GetKey returns the key identifier of the object.
func (*ObjectStateResource) GetMux ¶
func (r *ObjectStateResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*ObjectStateResource) GetRootRef ¶
func (r *ObjectStateResource) GetRootRef(ctx context.Context, req *s4wave_world.GetRootRefRequest) (*s4wave_world.GetRootRefResponse, error)
GetRootRef returns the root reference of the object.
func (*ObjectStateResource) IncrementRev ¶
func (r *ObjectStateResource) IncrementRev(ctx context.Context, req *s4wave_world.IncrementRevRequest) (*s4wave_world.IncrementRevResponse, error)
IncrementRev increments the revision of the object.
func (*ObjectStateResource) SetRootRef ¶
func (r *ObjectStateResource) SetRootRef(ctx context.Context, req *s4wave_world.SetRootRefRequest) (*s4wave_world.SetRootRefResponse, error)
SetRootRef updates the root reference of the object.
func (*ObjectStateResource) WaitRev ¶
func (r *ObjectStateResource) WaitRev(ctx context.Context, req *s4wave_world.WaitRevRequest) (*s4wave_world.WaitRevResponse, error)
WaitRev waits until the object rev is >= the specified revision.
type TrackedWorldState ¶
type TrackedWorldState struct {
// contains filtered or unexported fields
}
TrackedWorldState wraps a WorldState and records all access patterns. Immediately starts change detection as accesses are recorded.
func NewTrackedWorldState ¶
func NewTrackedWorldState(ws world.WorldState, watchWs world.WorldState, initialSeqno uint64, ctx context.Context) *TrackedWorldState
NewTrackedWorldState creates a new TrackedWorldState.
func (*TrackedWorldState) AccessCayleyGraph ¶
func (t *TrackedWorldState) AccessCayleyGraph(ctx context.Context, write bool, cb func(ctx context.Context, h world.CayleyHandle) error) error
func (*TrackedWorldState) AccessWorldState ¶
func (t *TrackedWorldState) AccessWorldState(ctx context.Context, ref *bucket.ObjectRef, cb func(*bucket_lookup.Cursor) error) error
func (*TrackedWorldState) ApplyWorldOp ¶
func (*TrackedWorldState) BuildStorageCursor ¶
func (t *TrackedWorldState) BuildStorageCursor(ctx context.Context) (*bucket_lookup.Cursor, error)
func (*TrackedWorldState) Close ¶
func (t *TrackedWorldState) Close()
Close stops the change detection routine.
func (*TrackedWorldState) CreateObject ¶
func (t *TrackedWorldState) CreateObject(ctx context.Context, key string, rootRef *bucket.ObjectRef) (world.ObjectState, error)
func (*TrackedWorldState) DeleteGraphObject ¶
func (t *TrackedWorldState) DeleteGraphObject(ctx context.Context, objKey string) error
func (*TrackedWorldState) DeleteGraphQuad ¶
func (*TrackedWorldState) DeleteObject ¶
func (*TrackedWorldState) GetObject ¶
func (t *TrackedWorldState) GetObject(ctx context.Context, key string) (world.ObjectState, bool, error)
func (*TrackedWorldState) GetReadOnly ¶
func (t *TrackedWorldState) GetReadOnly() bool
func (*TrackedWorldState) GetSeqno ¶
func (t *TrackedWorldState) GetSeqno(ctx context.Context) (uint64, error)
func (*TrackedWorldState) IterateObjects ¶
func (t *TrackedWorldState) IterateObjects(ctx context.Context, prefix string, reversed bool) world.ObjectIterator
func (*TrackedWorldState) LookupGraphQuads ¶
func (*TrackedWorldState) LookupGraphQuadsBatch ¶ added in v0.51.7
func (*TrackedWorldState) QueryGraphPath ¶ added in v0.51.6
func (t *TrackedWorldState) QueryGraphPath(ctx context.Context, query *world.GraphPathQuery) (*world.GraphPathQueryResult, error)
func (*TrackedWorldState) RenameObject ¶
func (t *TrackedWorldState) RenameObject(ctx context.Context, oldKey, newKey string, descendants bool) (world.ObjectState, error)
func (*TrackedWorldState) SetGraphQuad ¶
func (*TrackedWorldState) Sync ¶ added in v0.52.0
func (t *TrackedWorldState) Sync(ctx context.Context) (bool, error)
Sync fences the block writes made through the tracked world state durable.
func (*TrackedWorldState) WaitForChanges ¶
func (t *TrackedWorldState) WaitForChanges(ctx context.Context) error
WaitForChanges waits until any tracked resource changes. Returns nil when changes detected, error on failure or context cancel.
type TxResource ¶
type TxResource struct {
*WorldStateResource
// contains filtered or unexported fields
}
TxResource wraps a Tx for resource access. It embeds WorldStateResource and adds Commit/Discard operations.
func NewTxResource ¶
func NewTxResource( le *logrus.Entry, b bus.Bus, tx world.Tx, lookupOp world.LookupOp, engine world.Engine, opts ...WorldStateResourceOption, ) *TxResource
NewTxResource creates a new TxResource.
engine is optional - if provided, TypedObjectResourceService is registered on the mux.
func (*TxResource) Commit ¶
func (r *TxResource) Commit(ctx context.Context, req *s4wave_world.CommitRequest) (*s4wave_world.CommitResponse, error)
Commit commits the transaction.
func (*TxResource) Discard ¶
func (r *TxResource) Discard(ctx context.Context, req *s4wave_world.DiscardRequest) (*s4wave_world.DiscardResponse, error)
Discard discards the transaction without committing changes.
func (*TxResource) Release ¶ added in v0.51.7
func (r *TxResource) Release()
Release discards the underlying transaction exactly once.
type TypedObjectResource ¶
type TypedObjectResource struct {
// contains filtered or unexported fields
}
TypedObjectResource implements TypedObjectResourceService. It provides access to typed resources from world objects.
func NewTypedObjectResource ¶
func NewTypedObjectResource(le *logrus.Entry, b bus.Bus, ws world.WorldState, engine world.Engine) *TypedObjectResource
NewTypedObjectResource creates a new TypedObjectResource.
func NewTypedObjectResourceWithContext ¶ added in v0.52.0
func NewTypedObjectResourceWithContext( ctx context.Context, le *logrus.Entry, b bus.Bus, ws world.WorldState, engine world.Engine, ) *TypedObjectResource
NewTypedObjectResourceWithContext creates a TypedObjectResource with a parent lifecycle context.
func (*TypedObjectResource) AccessTypedObject ¶
func (r *TypedObjectResource) AccessTypedObject(ctx context.Context, req *s4wave_world.AccessTypedObjectRequest) (*s4wave_world.AccessTypedObjectResponse, error)
AccessTypedObject looks up an object, determines its type, and returns a typed resource. Handles special prefixes:
- plugin-dist/{plugin-id}: accesses the plugin's distribution filesystem
- plugin-assets/{plugin-id}: accesses the plugin's assets filesystem
func (*TypedObjectResource) Close ¶ added in v0.52.0
func (r *TypedObjectResource) Close()
Close releases shared typed object handles owned by this resource mount.
type WorldStateOperationObserver ¶ added in v0.51.7
type WorldStateOperationObserver func(WorldStateOperationRecord)
WorldStateOperationObserver observes WorldStateResource operation records.
type WorldStateOperationRecord ¶ added in v0.51.7
type WorldStateOperationRecord struct {
// Name is the WorldStateResource method name.
Name string
// Duration is the elapsed wall-clock duration.
Duration time.Duration
// Error is set when the operation returned an error.
Error string
// FilterCount is the number of graph filters in the request.
FilterCount int
// Limit is the relevant request limit.
Limit int
// ResultSetCount is the number of result groups returned.
ResultSetCount int
// ResultQuadCount is the total number of graph quads returned.
ResultQuadCount int
// StartKeyCount is the number of graph path start keys.
StartKeyCount int
// StepCount is the number of graph path steps.
StepCount int
// PageSize is the requested page size for resource-backed operations.
PageSize int
// ResultObjectCount is the number of object keys returned by the operation.
ResultObjectCount int
// ResourceCreated indicates that the operation attached a resource.
ResourceCreated bool
// BlockReadCount is the number of block cursor fetches issued by the operation.
BlockReadCount uint64
// BlockReadBytes is the number of block bytes returned to block cursors.
BlockReadBytes uint64
// BlockReadMissCount is the number of block cursor fetches that missed.
BlockReadMissCount uint64
// ResourceGetBlockCount is the number of Resource SDK GetBlock calls.
ResourceGetBlockCount uint64
// ResourceGetBlockRefCount is the number of non-empty refs passed to Resource SDK GetBlock.
ResourceGetBlockRefCount uint64
// ResourceGetBlockBytes is the number of bytes returned by found Resource SDK GetBlock calls.
ResourceGetBlockBytes uint64
// ResourceGetBlockMissCount is the number of Resource SDK GetBlock calls that missed.
ResourceGetBlockMissCount uint64
// DecodedBlockUnmarshalCount is the number of decoded block unmarshals.
DecodedBlockUnmarshalCount uint64
// DecodedBlockUnmarshalBytes is the number of bytes passed to decoded block unmarshalling.
DecodedBlockUnmarshalBytes uint64
// DecodedBlockCacheAttemptCount is the number of decoded-block cache lookup attempts.
DecodedBlockCacheAttemptCount uint64
// DecodedBlockCacheHitCount is the number of decoded-block cache hits.
DecodedBlockCacheHitCount uint64
// DecodedBlockCacheMissCount is the number of decoded-block cache misses.
DecodedBlockCacheMissCount uint64
// DecodedBlockCloneCount is the number of clone-on-hit decoded block returns.
DecodedBlockCloneCount uint64
// DecodedBlockUncloneableCount is the number of cache candidates that could not be cloned.
DecodedBlockUncloneableCount uint64
// DecodedBlockUncacheableCount is the number of decoded-block cache bypasses for missing exact keys.
DecodedBlockUncacheableCount uint64
}
WorldStateOperationRecord describes one WorldStateResource operation.
type WorldStateResource ¶
type WorldStateResource struct {
// contains filtered or unexported fields
}
WorldStateResource wraps a WorldState for resource access.
func NewEngineWorldStateResource ¶ added in v0.51.2
func NewEngineWorldStateResource( le *logrus.Entry, b bus.Bus, ws world.WorldState, lookupOp world.LookupOp, engine world.Engine, opts ...WorldStateResourceOption, ) *WorldStateResource
NewEngineWorldStateResource creates a WorldStateResource with typed object access.
func NewWorldStateResource ¶
func NewWorldStateResource( le *logrus.Entry, b bus.Bus, ws world.WorldState, lookupOp world.LookupOp, opts ...WorldStateResourceOption, ) *WorldStateResource
NewWorldStateResource creates a new WorldStateResource.
lookupOp may be nil
func (*WorldStateResource) AccessWorldState ¶
func (r *WorldStateResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
AccessWorldState builds a bucket lookup cursor with an optional ref.
func (*WorldStateResource) ApplyWorldOp ¶
func (r *WorldStateResource) ApplyWorldOp(ctx context.Context, req *s4wave_world.ApplyWorldOpRequest) (*s4wave_world.ApplyWorldOpResponse, error)
ApplyWorldOp applies a batch operation at the world level.
func (*WorldStateResource) BuildStorageCursor ¶
func (r *WorldStateResource) BuildStorageCursor(ctx context.Context, req *s4wave_world.BuildStorageCursorRequest) (*s4wave_world.BuildStorageCursorResponse, error)
BuildStorageCursor builds a cursor to the world storage with an empty ref.
func (*WorldStateResource) CreateObject ¶
func (r *WorldStateResource) CreateObject(ctx context.Context, req *s4wave_world.CreateObjectRequest) (*s4wave_world.CreateObjectResponse, error)
CreateObject creates an object with a key and initial root ref.
func (*WorldStateResource) DeleteGraphObject ¶
func (r *WorldStateResource) DeleteGraphObject(ctx context.Context, req *s4wave_world.DeleteGraphObjectRequest) (*s4wave_world.DeleteGraphObjectResponse, error)
DeleteGraphObject deletes all quads with Subject or Object set to value.
func (*WorldStateResource) DeleteGraphQuad ¶
func (r *WorldStateResource) DeleteGraphQuad(ctx context.Context, req *s4wave_world.DeleteGraphQuadRequest) (*s4wave_world.DeleteGraphQuadResponse, error)
DeleteGraphQuad deletes a quad from the graph store.
func (*WorldStateResource) DeleteObject ¶
func (r *WorldStateResource) DeleteObject(ctx context.Context, req *s4wave_world.DeleteObjectRequest) (*s4wave_world.DeleteObjectResponse, error)
DeleteObject deletes an object and associated graph quads by ID.
func (*WorldStateResource) GetMux ¶
func (r *WorldStateResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*WorldStateResource) GetObject ¶
func (r *WorldStateResource) GetObject(ctx context.Context, req *s4wave_world.GetObjectRequest) (*s4wave_world.GetObjectResponse, error)
GetObject looks up an object by key.
func (*WorldStateResource) GetObjectMetadataBatch ¶ added in v0.51.6
func (r *WorldStateResource) GetObjectMetadataBatch(ctx context.Context, req *s4wave_world.GetObjectMetadataBatchRequest) (*s4wave_world.GetObjectMetadataBatchResponse, error)
GetObjectMetadataBatch returns graph metadata for object keys.
func (*WorldStateResource) GetObjectRootRefsBatch ¶ added in v0.51.7
func (r *WorldStateResource) GetObjectRootRefsBatch(ctx context.Context, req *s4wave_world.GetObjectRootRefsBatchRequest) (*s4wave_world.GetObjectRootRefsBatchResponse, error)
GetObjectRootRefsBatch returns root references for object keys.
func (*WorldStateResource) GetReadOnly ¶
func (r *WorldStateResource) GetReadOnly(ctx context.Context, req *s4wave_world.GetReadOnlyRequest) (*s4wave_world.GetReadOnlyResponse, error)
GetReadOnly returns if the world state is read-only.
func (*WorldStateResource) GetSeqno ¶
func (r *WorldStateResource) GetSeqno(ctx context.Context, req *s4wave_world.GetSeqnoRequest) (*s4wave_world.GetSeqnoResponse, error)
GetSeqno returns the current seqno of the world state.
func (*WorldStateResource) IterateObjects ¶
func (r *WorldStateResource) IterateObjects(ctx context.Context, req *s4wave_world.IterateObjectsRequest) (*s4wave_world.IterateObjectsResponse, error)
IterateObjects returns an iterator with the given object key prefix.
func (*WorldStateResource) ListGraphEdgeBuckets ¶ added in v0.51.7
func (r *WorldStateResource) ListGraphEdgeBuckets(ctx context.Context, req *s4wave_world.ListGraphEdgeBucketsRequest) (*s4wave_world.ListGraphEdgeBucketsResponse, error)
ListGraphEdgeBuckets lists grouped inbound/outbound graph edge buckets.
func (*WorldStateResource) ListObjectsWithType ¶
func (r *WorldStateResource) ListObjectsWithType(ctx context.Context, req *s4wave_world.ListObjectsWithTypeRequest) (*s4wave_world.ListObjectsWithTypeResponse, error)
ListObjectsWithType lists object keys with the given type identifier.
func (*WorldStateResource) LookupGraphQuads ¶
func (r *WorldStateResource) LookupGraphQuads(ctx context.Context, req *s4wave_world.LookupGraphQuadsRequest) (*s4wave_world.LookupGraphQuadsResponse, error)
LookupGraphQuads searches for graph quads in the store.
func (*WorldStateResource) LookupGraphQuadsBatch ¶ added in v0.51.6
func (r *WorldStateResource) LookupGraphQuadsBatch(ctx context.Context, req *s4wave_world.LookupGraphQuadsBatchRequest) (*s4wave_world.LookupGraphQuadsBatchResponse, error)
LookupGraphQuadsBatch searches for graph quads using bounded indexed filters.
func (*WorldStateResource) QueryGraphPath ¶ added in v0.51.6
func (r *WorldStateResource) QueryGraphPath(ctx context.Context, req *s4wave_world.QueryGraphPathRequest) (*s4wave_world.QueryGraphPathResponse, error)
QueryGraphPath creates a resource for a bounded graph path query.
func (*WorldStateResource) RenameObject ¶
func (r *WorldStateResource) RenameObject(ctx context.Context, req *s4wave_world.RenameObjectRequest) (*s4wave_world.RenameObjectResponse, error)
RenameObject renames an object key and associated graph quads.
func (*WorldStateResource) SetGraphQuad ¶
func (r *WorldStateResource) SetGraphQuad(ctx context.Context, req *s4wave_world.SetGraphQuadRequest) (*s4wave_world.SetGraphQuadResponse, error)
SetGraphQuad sets a quad in the graph store.
func (*WorldStateResource) Sync ¶ added in v0.52.0
func (r *WorldStateResource) Sync(ctx context.Context, req *s4wave_world.SyncRequest) (*s4wave_world.SyncResponse, error)
Sync fences the block writes made through this world state durable.
func (*WorldStateResource) WaitSeqno ¶
func (r *WorldStateResource) WaitSeqno(ctx context.Context, req *s4wave_world.WaitSeqnoRequest) (*s4wave_world.WaitSeqnoResponse, error)
WaitSeqno waits for the seqno of the world state to be >= value.
type WorldStateResourceOption ¶ added in v0.51.7
type WorldStateResourceOption func(*WorldStateResource)
WorldStateResourceOption configures a WorldStateResource.
func WithWorldStateOperationObserver ¶ added in v0.51.7
func WithWorldStateOperationObserver(observer WorldStateOperationObserver) WorldStateResourceOption
WithWorldStateOperationObserver configures WorldStateResource operation accounting.