Documentation ¶
Index ¶
- type Clock
- func (c *Clock) Init() error
- func (c *Clock) MungeEvents(events []*clientv3.Event) (int64, []*mvccpb.Event, bool)
- func (c *Clock) MungeRangeResp(resp *etcdserverpb.RangeResponse)
- func (c *Clock) MungeTxn(metaRev int64, req *etcdserverpb.TxnRequest)
- func (c *Clock) MungeTxnResp(metaRev int64, resp *etcdserverpb.TxnResponse)
- func (c *Clock) Now(ctx context.Context) (int64, error)
- func (c *Clock) Reset(ctx context.Context) error
- func (c *Clock) ResolveMetaToMember(ctx context.Context, client *membership.ClientSet, metaRev int64) (int64, error)
- func (c *Clock) ResolveMetaToMemberTxn(ctx context.Context, client *membership.ClientSet, key []byte, metaRev int64, ...) (int64, *etcdserverpb.TxnResponse, error)
- func (c *Clock) Tick(ctx context.Context) (int64, error)
- func (c *Clock) ValidateTxn(req *etcdserverpb.TxnRequest) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock struct { Coordinator *membership.CoordinatorClientSet Members *membership.Pool }
Clock implements the meta cluster's logic clock. It allows the meta cluster to preserve Happens-Before semantics between keys that span two etcd clusters.
func (*Clock) MungeEvents ¶
func (*Clock) MungeRangeResp ¶
func (c *Clock) MungeRangeResp(resp *etcdserverpb.RangeResponse)
func (*Clock) MungeTxn ¶
func (c *Clock) MungeTxn(metaRev int64, req *etcdserverpb.TxnRequest)
func (*Clock) MungeTxnResp ¶
func (c *Clock) MungeTxnResp(metaRev int64, resp *etcdserverpb.TxnResponse)
func (*Clock) ResolveMetaToMember ¶
func (c *Clock) ResolveMetaToMember(ctx context.Context, client *membership.ClientSet, metaRev int64) (int64, error)
ResolveMetaToMember finds at least the corresponding member revision for a given meta revision.
func (*Clock) ResolveMetaToMemberTxn ¶
func (c *Clock) ResolveMetaToMemberTxn(ctx context.Context, client *membership.ClientSet, key []byte, metaRev int64, req *etcdserverpb.TxnRequest) (int64, *etcdserverpb.TxnResponse, error)
ResolveMetaToMemberTxn returns the member revision that corresponds with a given transaction operation. If the given meta revision doesn't match a value's current revision, an error response is returned instead. If the transaction includes a get operation for the same key, a conforming response is returned. This implements an odd but essential set of behaviors that make Kubernetes's etcd store work.
func (*Clock) ValidateTxn ¶
func (c *Clock) ValidateTxn(req *etcdserverpb.TxnRequest) ([]byte, error)