_id
stringlengths
2
7
text
stringlengths
6
2.61k
title
stringclasses
1 value
c174900
// NewURLsMapFromStringMap takes a map of strings and returns a URLsMap. The // string values in the map can be multiple values separated by the sep string.
c174901
// String turns URLsMap into discovery-formatted name-to-URLs sorted by name.
c174902
// URLs returns a list of all URLs. // The returned list is sorted in ascending lexicographical order.
c174903
// parse parses the given string and returns a map listing the values specified for each key.
c174904
// NewClientHandler generates a muxed http.Handler with the given parameters to serve etcd client requests.
c174905
// writeKeyEvent trims the prefix of key path in a single Event under // StoreKeysPrefix, serializes it and writes the resulting JSON to the given // ResponseWriter, along with the appropriate headers.
c174906
// writeKeyError logs and writes the given Error to the ResponseWriter. // If Error is not an etcdErr, the error will be converted to an etcd error.
c174907
// getUint64 extracts a uint64 by the given key from a Form. If the key does // not exist in the form, 0 is returned. If the key exists but the value is // badly formed, an error is returned. If multiple values are present only the // first is considered.
c174908
// getBool extracts a bool by the given key from a Form. If the key does not // exist in the form, false is returned. If the key exists but the value is // badly formed, an error is returned. If multiple values are present only the // first is considered.
c174909
// waitDeletes efficiently waits until all keys matching the prefix and no greater // than the create revision.
c174910
// AddOutputPaths adds output paths to the existing output paths, resolving conflicts.
c174911
// NewConfig creates a new Config populated with default values.
c174912
// PeerURLsMapAndToken sets up an initial peer URLsMap and cluster token for bootstrap or discovery.
c174913
// GetDNSClusterNames uses DNS SRV records to get a list of initial nodes for cluster bootstrapping.
c174914
// checkBindURLs returns an error if any URL uses a domain name.
c174915
// GetCluster gets the cluster information via DNS discovery. // Also sees each entry as a separate instance.
c174916
// GetClient looks up the client endpoints for a service and domain.
c174917
// GetSRVService generates a SRV service including an optional suffix.
c174918
// compact keyspace history to a provided revision
c174919
// defrag a given endpoint
c174920
// NewUserCommand returns the cobra command for "user".
c174921
// userAddCommandFunc executes the "user add" command.
c174922
// userGetCommandFunc executes the "user get" command.
c174923
// userChangePasswordCommandFunc executes the "user passwd" command.
c174924
// addEvent function adds event into the eventHistory
c174925
// scan enumerates events from the index history and stops at the first point // where the key matches.
c174926
// clone will be protected by a stop-world lock // do not need to obtain internal lock
c174927
// openSnapshotBackend renames a snapshot db to the current etcd db and opens it.
c174928
// openBackend returns a backend using the current etcd db.
c174929
// recoverBackendSnapshot recovers the DB from a snapshot in case etcd crashes // before updating the backend db after persisting raft snapshot to disk, // violating the invariant snapshot.Metadata.Index < db.consistentIndex. In this // case, replace the db with the snapshot db sent by the leader.
c174930
// NewUpdateCommand returns the CLI command for "update".
c174931
// updateCommandFunc executes the "update" command.
c174932
// FrontAndBack gets the front and back elements in the queue // We must grab front and back together with the protection of the lock
c174933
// Insert function insert a RequestStats into the queue and update the records
c174934
// Rate function returns the package rate and byte rate
c174935
// Clear function clear up the statsQueue
c174936
// UniqueStrings returns a slice of randomly generated unique strings.
c174937
// RandomStrings returns a slice of randomly generated strings.
c174938
// IsKeyNotFound returns true if the error code is ErrorCodeKeyNotFound.
c174939
// IsRoleNotFound returns true if the error means role not found of v2 API.
c174940
// IsUserNotFound returns true if the error means user not found of v2 API.
c174941
// JoinCluster will connect to the discovery service at the given url, and // register the server represented by the given id and config to the cluster
c174942
// GetCluster will connect to the discovery service at the given url and // retrieve a string describing the cluster
c174943
// newProxyFunc builds a proxy function from the given string, which should // represent a URL that can be used as a proxy. It performs basic // sanitization of the URL and returns any error encountered.
c174944
// isSafeRetry returns "true", if request is safe for retry with the given error.
c174945
// withRetryPolicy sets the retry policy of this call.
c174946
// withAuthRetry sets enables authentication retries.
c174947
// withMax sets the maximum number of retries on this call, or this interceptor.
c174948
// WithBackoff sets the `BackoffFunc `used to control time between retries.
c174949
// RecvAppendReq updates the ServerStats in response to an AppendRequest // from the given leader being received
c174950
// SendAppendReq updates the ServerStats in response to an AppendRequest // being sent by this server
c174951
// merge merges data from bb into bbsrc.
c174952
// deleteRevKey deletes a key by revision, returning false if key is missing
c174953
// isMemberBootstrapped tries to check if the given member has been bootstrapped // in the given cluster.
c174954
// GetClusterFromRemotePeers takes a set of URLs representing etcd peers, and // attempts to construct a Cluster by accessing the members endpoint on one of // these URLs. The first URL to provide a response is used. If no URLs provide // a response, or a Cluster cannot be successfully created from a received // respon...
c174955
// If logerr is true, it prints out more error messages.
c174956
// getRemotePeerURLs returns peer urls of remote members in the cluster. The // returned list is sorted in ascending lexicographical order.
c174957
// getVersions returns the versions of the members in the given cluster. // The key of the returned map is the member's ID. The value of the returned map // is the semver versions string, including server and cluster. // If it fails to get the version of a member, the key will be nil.
c174958
// decideClusterVersion decides the cluster version based on the versions map. // The returned version is the min server version in the map, or nil if the min // version in unknown.
c174959
// getVersion returns the Versions of the given member via its // peerURLs. Returns the last error if it fails to get the version.
c174960
// NewTimeoutDetector creates the TimeoutDetector.
c174961
// Reset resets the NewTimeoutDetector.
c174962
// Observe observes an event for given id. It returns false and exceeded duration // if the interval is longer than the expectation.
c174963
// NewPeerHandler generates an http.Handler to handle etcd peer requests.
c174964
// put puts a revision to the keyIndex.
c174965
// tombstone puts a revision, pointing to a tombstone, to the keyIndex. // It also creates a new empty generation in the keyIndex. // It returns ErrRevisionNotFound when tombstone on an empty generation.
c174966
// get gets the modified, created revision and version of the key that satisfies the given atRev. // Rev must be higher than or equal to the given atRev.
c174967
// since returns revisions since the given rev. Only the revision with the // largest sub revision will be returned if multiple revisions have the same // main revision.
c174968
// keep finds the revision to be kept if compact is called at given atRev.
c174969
// findGeneration finds out the generation of the keyIndex that the // given rev belongs to. If the given rev is at the gap of two generations, // which means that the key does not exist at the given rev, it returns nil.
c174970
// cancelWatcher removes references of the watcher from the watchableStore
c174971
// syncWatchersLoop syncs the watcher in the unsynced map every 100ms.
c174972
// syncVictimsLoop tries to write precomputed watcher responses to // watchers that had a blocked watcher channel
c174973
// moveVictims tries to update watches with already pending event data
c174974
// kvsToEvents gets all events for the watchers from all key-value pairs
c174975
// notify notifies the fact that given event at the given rev just happened to // watchers that watch on the key of the event.
c174976
// Check if the provided function is being called in the op options.
c174977
// UnsafePut must be called holding the lock on the tx.
c174978
// UnsafeSeqPut must be called holding the lock on the tx.
c174979
// UnsafeRange must be called holding the lock on the tx.
c174980
// UnsafeDelete must be called holding the lock on the tx.
c174981
// UnsafeForEach must be called holding the lock on the tx.
c174982
// Commit commits a previous tx and begins a new writable one.
c174983
// CommitAndStop commits the previous tx and does not create a new one.
c174984
// Renew renews an existing lease. If the given lease does not exist or // has expired, an error will be returned.
c174985
// Attach attaches items to the lease with given ID. When the lease // expires, the attached items will be automatically removed. // If the given lease does not exist, an error will be returned.
c174986
// revokeExpiredLeases finds all leases past their expiry and sends them to epxired channel for // to be revoked.
c174987
// checkpointScheduledLeases finds all scheduled lease checkpoints that are due and // submits them to the checkpointer to persist them to the consensus log.
c174988
// expireExists returns true if expiry items exist. // It pops only when expiry item exists. // "next" is true, to indicate that it may exist in next attempt.
c174989
// findExpiredLeases loops leases in the leaseMap until reaching expired limit // and returns the expired leases that needed to be revoked.
c174990
// refresh refreshes the expiry of the lease.
c174991
// forever sets the expiry of lease to be forever.
c174992
// Keys returns all the keys attached to the lease.
c174993
// Remaining returns the remaining time of the lease.
c174994
// NewCompactionCommand returns the cobra command for "compaction".
c174995
// compactionCommandFunc executes the "compaction" command.
c174996
// NewPutCommand returns the cobra command for "put".
c174997
// putCommandFunc executes the "put" command.
c174998
// NewHandler creates a new HTTP handler, listening on the given transport, // which will proxy requests to an etcd cluster. // The handler will periodically update its view of the cluster.
c174999
// NewReadonlyHandler wraps the given HTTP handler to allow only GET requests