Documentation ¶
Index ¶
- Constants
- func CurrentMaxShard(ctx context.Context) (int, error)
- func InclusionKey(including, included ID) spanner.Key
- func QueryRealms(ctx context.Context, ids IDSet) (realms map[ID]string, err error)
- func Read(ctx context.Context, id ID) (*pb.Invocation, error)
- func ReadBatch(ctx context.Context, ids IDSet) (map[ID]*pb.Invocation, error)
- func ReadColumns(ctx context.Context, id ID, ptrMap map[string]any) error
- func ReadRealm(ctx context.Context, id ID) (string, error)
- func ReadRealms(ctx context.Context, ids IDSet) (realms map[ID]string, err error)
- func ReadState(ctx context.Context, id ID) (pb.Invocation_State, error)
- func ReadStateBatch(ctx context.Context, ids IDSet) (map[ID]pb.Invocation_State, error)
- func ReadSubmitted(ctx context.Context, id ID) (bool, error)
- func TokenToMap(token string, dest map[string]any, keys ...string) error
- type ExportInfo
- type FinalizedNotificationInfo
- type ID
- type IDSet
- func (s IDSet) Add(id ID)
- func (s IDSet) Batch(batchSize int) []IDSet
- func (s *IDSet) FromSpanner(b *spanutil.Buffer) error
- func (s IDSet) Has(id ID) bool
- func (s IDSet) Intersect(other IDSet) IDSet
- func (s IDSet) Keys(suffix ...any) spanner.KeySet
- func (s IDSet) Names() []string
- func (s IDSet) Remove(id ID)
- func (s IDSet) RemoveAll(other IDSet)
- func (s IDSet) SortByRowID() []ID
- func (s *IDSet) SpannerPtr(b *spanutil.Buffer) any
- func (s IDSet) String() string
- func (s IDSet) ToSpanner() any
- func (s IDSet) Union(other IDSet)
Constants ¶
const Shards = 100
Shards is the sharding level for the Invocations table. Column Invocations.ShardId is a value in range [0, Shards).
Variables ¶
This section is empty.
Functions ¶
func CurrentMaxShard ¶
CurrentMaxShard reads the highest shard id in the Invocations table. This may differ from the constant above when it has changed recently.
func InclusionKey ¶
InclusionKey returns a spanner key for an Inclusion row.
func QueryRealms ¶
QueryRealms returns the invocations' realms where available from the Invocations table. Makes a single RPC.
func Read ¶
Read reads one invocation from Spanner. If the invocation does not exist, the returned error is annotated with NotFound GRPC code.
func ReadBatch ¶
ReadBatch reads multiple invocations from Spanner. If any of them are not found, returns an error.
func ReadColumns ¶
ReadColumns reads the specified columns from an invocation Spanner row. If the invocation does not exist, the returned error is annotated with NotFound GRPC code. For ptrMap see ReadRow comment in span/util.go.
func ReadRealms ¶
ReadRealms returns the invocations' realms. Returns a NotFound error if unable to get the realm for any of the requested invocations. Makes a single RPC.
func ReadStateBatch ¶
ReadStateBatch reads the states of multiple invocations.
func ReadSubmitted ¶
ReadSubmitted returns the invocation's submitted status.
func TokenToMap ¶
TokenToMap parses a page token to a map. The first component of the token is expected to be an invocation ID. Convenient to initialize Spanner statement parameters. Expects the token to be either empty or have len(keys) components. If the token is empty, sets map values to "".
Types ¶
type ExportInfo ¶
type ExportInfo struct { // Whether the invocation is in FINALIZED or FINALIZING state. IsInvocationFinal bool // The realm of the invocation. Realm string // IsSourcesSpecFinalEffective whether the source information is immutable. // This is true if either IsSourceSpecFinal is set on the invocation, or // the invocation is in FINALIZING or FINALIZED state. IsSourceSpecFinalEffective bool // IsInheritingSources contains whether the invocation is inheriting sources // from its parent (including) invocation. IsInheritingSources bool // Sources are the concrete sources specific on the invocation (if any). Sources *pb.Sources }
ExportInfo captures information pertinent to exporting an invocation and propogating export roots.
func ReadExportInfo ¶
func ReadExportInfo(ctx context.Context, invID ID) (ExportInfo, error)
ReadExportInfo reads information pertinent to exporting an invocation.
type FinalizedNotificationInfo ¶
type FinalizedNotificationInfo struct { // The realm of the invocation. Realm string // Whether this invocation is a root of the invocation graph for export purposes. IsExportRoot bool // When the invocation was created. CreateTime *timestamppb.Timestamp }
FinalizedNotificationInfo captures information for sending an invocation finalized notification.
func ReadFinalizedNotificationInfo ¶
func ReadFinalizedNotificationInfo(ctx context.Context, invID ID) (FinalizedNotificationInfo, error)
ReadFinalizedNotificationInfo reads information for sending an invocation finalized notification.
type ID ¶
type ID string
ID can convert an invocation id to various formats.
func IDFromRowID ¶
IDFromRowID converts a Spanner-level row ID to an ID.
func MustParseName ¶
MustParseName converts an invocation name to an ID. Panics if the name is invalid. Useful for situations when name was already validated.
func (*ID) FromSpanner ¶
FromSpanner implements span.Ptr.
func (*ID) SpannerPtr ¶
SpannerPtr implements span.Ptr.
type IDSet ¶
type IDSet map[ID]struct{}
IDSet is an unordered set of invocation ids.
func MustParseNames ¶
MustParseNames converts invocation names to IDSet. Panics if a name is invalid. Useful for situations when names were already validated.
func ParseNames ¶
ParseNames converts invocation names to IDSet.
func ReadIncluded ¶
ReadIncluded reads ids of (directly) included invocations.
func (*IDSet) FromSpanner ¶
FromSpanner implements span.Ptr.
func (IDSet) SortByRowID ¶
SortByRowID returns IDs in the set sorted by row id.
func (*IDSet) SpannerPtr ¶
SpannerPtr implements span.Ptr.
Directories ¶
Path | Synopsis |
---|---|
Package graph contains methods to explore reachable invocations.
|
Package graph contains methods to explore reachable invocations. |