_id
stringlengths
2
7
text
stringlengths
6
2.61k
title
stringclasses
1 value
c178200
// initFromOpenTracing initializes injectableSpan fields from an OpenTracing Span, // assuming the tracing implementation supports Zipkin-style span IDs.
c178201
// startOutboundSpan creates a new tracing span to represent the outbound RPC call. // If the context already contains a span, it will be used as a parent, otherwise // a new root span is created. // // If the tracer supports Zipkin-style trace IDs, then call.callReq.Tracing is // initialized with those IDs. Otherwise ...
c178202
// intToIP4 converts an integer IP representation into a 4-byte net.IP struct
c178203
// servicePeerToHostPort converts a Hyperbahn ServicePeer into a hostPort string.
c178204
// NewStatsdReporter returns a StatsReporter that reports to statsd on the given addr.
c178205
// UnmarshalText implements TextUnMarshaler from encoding
c178206
// Push implements heap Push interface
c178207
// Pop implements heap Pop interface
c178208
// updatePeer updates the score for the given peer.
c178209
// removePeer remove peer at specific index.
c178210
// pushPeer pushes the new peer into the heap.
c178211
// AddPeer adds a peer to the peer heap.
c178212
// NewClient returns a Client that makes calls over the given tchannel to the given Hyperbahn service.
c178213
// Add adds a peer to the root peer list if it does not exist, or return // an existing peer if it exists.
c178214
// Get returns a peer for the given hostPort if it exists.
c178215
// WithTimeout sets the timeout to use for each call.
c178216
// Methods returns the methods on this service, not including methods from inherited services.
c178217
// InheritedMethods returns names for inherited methods on this service.
c178218
// Arguments returns the argument declarations for this method.
c178219
// ArgList returns the argument list for the function.
c178220
// CallList creates the call to a function satisfying Interface from an Args struct.
c178221
// RetType returns the go return type of the method.
c178222
// WrapResult wraps the result variable before being used in the result struct.
c178223
// ReturnWith takes the result name and the error name, and generates the return expression.
c178224
// Declaration returns the declaration for this field.
c178225
// startIdleSweep starts a poller that checks for idle connections at given // intervals.
c178226
// Start runs the goroutine responsible for checking idle connections.
c178227
// Stop kills the poller checking for idle connections.
c178228
// ResolveWithGoPath will resolve the filename relative to GOPATH and returns // the first file that exists, or an error otherwise.
c178229
// setExtends will set the ExtendsService for all services. // It is done after all files are parsed, as services may extend those // found in an included file.
c178230
// Registers a handler
c178231
// NewClient returns a new Client that can make calls to a benchmark server.
c178232
// ListenIP returns the IP to bind to in Listen. It tries to find an IP that can be used // by other machines to reach this machine.
c178233
// Close closes the listener. // Any blocked Accept operations will be unblocked and return errors.
c178234
// ReadArgsV2 reads arg2 and arg3 from a reader.
c178235
// WriteArgs writes the given arguments to the call, and returns the response args.
c178236
// Call makes a call to the given hostPort with the given arguments and returns the response args.
c178237
// CallSC makes a call using the given subcahnnel
c178238
// CallV2 makes a call and does not attempt any retries.
c178239
// NewRealRelay creates a TChannel relay.
c178240
// NewServer returns a server that can serve thrift services over TChannel.
c178241
// RegisterHealthHandler uses the user-specified function f for the Health endpoint.
c178242
// Handle handles an incoming TChannel call and forwards it to the correct handler.
c178243
// MetricsKey is a string representation of the error code that's suitable for // inclusion in metrics tags.
c178244
// NewSystemError defines a new SystemError with a code and message
c178245
// NewWrappedSystemError defines a new SystemError wrapping an existing error
c178246
// Error returns the code and message, conforming to the error interface
c178247
// GetContextError converts the context error to a tchannel error.
c178248
// GetSystemErrorCode returns the code to report for the given error. If the error is a // SystemError, we can get the code directly. Otherwise treat it as an unexpected error
c178249
// ping sends a ping message and waits for a ping response.
c178250
// handlePingRes calls registered ping handlers.
c178251
// handlePingReq responds to the pingReq message with a pingRes.
c178252
// SendSystemError sends an error frame for the given system error.
c178253
// connectionError handles a connection level error
c178254
// withStateLock performs an action with the connection state mutex locked
c178255
// withStateRLock performs an action with the connection state mutex rlocked.
c178256
// readFrames is the loop that reads frames from the network connection and // dispatches to the appropriate handler. Run within its own goroutine to // prevent overlapping reads on the socket. Most handlers simply send the // incoming frame to a channel; the init handlers are a notable exception, // since we cannot p...
c178257
// writeFrames is the main loop that pulls frames from the send channel and // writes them to the connection.
c178258
// hasPendingCalls returns whether there's any pending inbound or outbound calls on this connection.
c178259
// checkExchanges is called whenever an exchange is removed, and when Close is called.
c178260
// closeNetwork closes the network connection and all network-related channels. // This should only be done in response to a fatal connection or protocol // error, or after all pending frames have been sent.
c178261
// getLastActivityTime returns the timestamp of the last frame read or written, // excluding pings. If no frames were transmitted yet, it will return the time // this connection was created.
c178262
// Validate validates that the given spec is supported by thrift-gen.
c178263
// logFailedRegistrationRetry logs either a warning or info depending on the number of // consecutiveFailures. If consecutiveFailures > maxAdvertiseFailures, then we log a warning.
c178264
// initialAdvertise will do the initial Advertise call to Hyperbahn with additional // retries on top of the built-in TChannel retries. It will use exponential backoff // between each of the call attempts.
c178265
// Service returns the name of the destination service for this callReq.
c178266
// TTL returns the time to live for this callReq.
c178267
// SetTTL overwrites the frame's TTL.
c178268
// finishesCall checks whether this frame is the last one we should expect for // this RPC req-res.
c178269
// Flat returns all the strings in the set, sorted and de-duplicated.
c178270
// Map applies a function that processes individual strings to the strings // in "ps" and returns a new PlatformStrings with the result. Empty strings // returned by the function are dropped.
c178271
// MapSlice applies a function that processes slices of strings to the strings // in "ps" and returns a new PlatformStrings with the results.
c178272
// GetProtoConfig returns the proto language configuration. If the proto // extension was not run, it will return nil.
c178273
// MapExprStrings applies a function to string sub-expressions within e. // An expression containing the results with the same structure as e is // returned.
c178274
// FlattenExpr takes an expression that may have been generated from // PlatformStrings and returns its values in a flat, sorted, de-duplicated // list. Comments are accumulated and de-duplicated across duplicate // expressions. If the expression could not have been generted by // PlatformStrings, the expression will b...
c178275
// makePlatformStringsExpr constructs a single expression from the // sub-expressions in ps.
c178276
// String returns OS, Arch, or "OS_Arch" if both are set. This must match // the names of config_setting rules in @io_bazel_rules_go//go/platform.
c178277
// Find searches from the given dir and up for the WORKSPACE file // returning the directory containing it, or an error if none found in the tree.
c178278
// runGazelle invokes gazelle with "bazel run". In fullMode, gazelle will // run in the entire repository. In fastMode, gazelle will only run // in the given directories.
c178279
// restoreBuildFilesInRepo copies BUILD.in and BUILD.bazel.in files and // copies them to BUILD and BUILD.bazel.
c178280
// FixLoads removes loads of unused go rules and adds loads of newly used rules. // This should be called after FixFile and MergeFile, since symbols // may be introduced that aren't loaded. // // This function calls File.Sync before processing loads.
c178281
// fixLoad updates a load statement with the given symbols. If load is nil, // a new load may be created and returned. Symbols in kinds will be added // to the load if they're not already present. Known symbols not in kinds // will be removed if present. Other symbols will be preserved. If load is // empty, nil is retu...
c178282
// newLoadIndex returns the index in stmts where a new load statement should // be inserted. after is a list of function names that the load should not // be inserted before.
c178283
// removeLegacyGoRepository removes loads of go_repository from // @io_bazel_rules_go. FixLoads should be called after this; it will load from // @bazel_gazelle.
c178284
// Compare returns an integer comparing two versions lexicographically.
c178285
// ParseVersion parses a version of the form "12.34.56-abcd". Non-negative // integer components are separated by dots. An arbitrary suffix may appear // after '-', which is ignored.
c178286
// EmptyFile creates a File wrapped around an empty syntax tree.
c178287
// LoadWorkspaceFile is similar to LoadFile but parses the file as a WORKSPACE // file.
c178288
// LoadMacroFile loads a bzl file from disk, parses it, then scans for the load // statements and the rules called from the given Starlark function. If there is // no matching function name, then a new function with that name will be created. // The function's syntax tree will be returned within File and can be modifie...
c178289
// EmptyMacroFile creates a bzl file at the given path and within the file creates // a Starlark function with the provided name. The function can then be modified // by Sync and Save calls.
c178290
// LoadData parses a build file from a byte slice and scans it for rules and // load statements. The syntax tree within the returned File will be modified // by editing methods.
c178291
// LoadWorkspaceData is similar to LoadData but parses the data as a // WORKSPACE file.
c178292
// LoadMacroData parses a bzl file from a byte slice and scans for the load // statements and the rules called from the given Starlark function. If there is // no matching function name, then a new function will be created, and added to the // File the next time Sync is called. The function's syntax tree will be return...
c178293
// ScanAST creates a File wrapped around the given syntax tree. This tree // will be modified by editing methods.
c178294
// ScanASTBody creates a File wrapped around the given syntax tree. It will also // scan the AST for a function matching the given defName, and if the function // does not exist it will create a new one and mark it to be added to the File // the next time Sync is called.
c178295
// MatchBuildFileName looks for a file in files that has a name from names. // If there is at least one matching file, a path will be returned by joining // dir and the first matching name. If there are no matching files, the // empty string is returned.
c178296
// SyncMacroFile syncs the file's syntax tree with another file's. This is // useful for keeping multiple macro definitions from the same .bzl file in sync.
c178297
// MacroName returns the name of the macro function that this file is editing, // or an empty string if a macro function is not being edited.
c178298
// Sync writes all changes back to the wrapped syntax tree. This should be // called after editing operations, before reading the syntax tree again.
c178299
// Format formats the build file in a form that can be written to disk. // This method calls Sync internally.