repo stringlengths 5 67 | path stringlengths 4 218 | func_name stringlengths 0 151 | original_string stringlengths 52 373k | language stringclasses 6
values | code stringlengths 52 373k | code_tokens listlengths 10 512 | docstring stringlengths 3 47.2k | docstring_tokens listlengths 3 234 | sha stringlengths 40 40 | url stringlengths 85 339 | partition stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
pachyderm/pachyderm | src/plugin/vault/pachyderm/renew.go | renewUserCredentials | func renewUserCredentials(ctx context.Context, pachdAddress string, adminToken string, userToken string, ttl time.Duration) error {
// Setup a single use client w the given admin token / address
client, err := pclient.NewFromAddress(pachdAddress)
if err != nil {
return err
}
defer client.Close() // avoid leaking... | go | func renewUserCredentials(ctx context.Context, pachdAddress string, adminToken string, userToken string, ttl time.Duration) error {
// Setup a single use client w the given admin token / address
client, err := pclient.NewFromAddress(pachdAddress)
if err != nil {
return err
}
defer client.Close() // avoid leaking... | [
"func",
"renewUserCredentials",
"(",
"ctx",
"context",
".",
"Context",
",",
"pachdAddress",
"string",
",",
"adminToken",
"string",
",",
"userToken",
"string",
",",
"ttl",
"time",
".",
"Duration",
")",
"error",
"{",
"client",
",",
"err",
":=",
"pclient",
".",... | // renewUserCredentials extends the TTL of the Pachyderm authentication token
// 'userToken', using the vault plugin's Admin credentials. 'userToken' belongs
// to the user who is calling vault, and would like to extend their Pachyderm
// session. | [
"renewUserCredentials",
"extends",
"the",
"TTL",
"of",
"the",
"Pachyderm",
"authentication",
"token",
"userToken",
"using",
"the",
"vault",
"plugin",
"s",
"Admin",
"credentials",
".",
"userToken",
"belongs",
"to",
"the",
"user",
"who",
"is",
"calling",
"vault",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/plugin/vault/pachyderm/renew.go#L71-L92 | test |
pachyderm/pachyderm | src/server/pkg/obj/local_client.go | NewLocalClient | func NewLocalClient(root string) (Client, error) {
if err := os.MkdirAll(root, 0755); err != nil {
return nil, err
}
return &localClient{root}, nil
} | go | func NewLocalClient(root string) (Client, error) {
if err := os.MkdirAll(root, 0755); err != nil {
return nil, err
}
return &localClient{root}, nil
} | [
"func",
"NewLocalClient",
"(",
"root",
"string",
")",
"(",
"Client",
",",
"error",
")",
"{",
"if",
"err",
":=",
"os",
".",
"MkdirAll",
"(",
"root",
",",
"0755",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"ret... | // NewLocalClient returns a Client that stores data on the local file system | [
"NewLocalClient",
"returns",
"a",
"Client",
"that",
"stores",
"data",
"on",
"the",
"local",
"file",
"system"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/local_client.go#L12-L17 | test |
pachyderm/pachyderm | src/client/pkg/tracing/tracing.go | AddSpanToAnyExisting | func AddSpanToAnyExisting(ctx context.Context, operation string, kvs ...interface{}) (opentracing.Span, context.Context) {
if parentSpan := opentracing.SpanFromContext(ctx); parentSpan != nil {
span := opentracing.StartSpan(operation, opentracing.ChildOf(parentSpan.Context()))
tagSpan(span, kvs)
return span, ope... | go | func AddSpanToAnyExisting(ctx context.Context, operation string, kvs ...interface{}) (opentracing.Span, context.Context) {
if parentSpan := opentracing.SpanFromContext(ctx); parentSpan != nil {
span := opentracing.StartSpan(operation, opentracing.ChildOf(parentSpan.Context()))
tagSpan(span, kvs)
return span, ope... | [
"func",
"AddSpanToAnyExisting",
"(",
"ctx",
"context",
".",
"Context",
",",
"operation",
"string",
",",
"kvs",
"...",
"interface",
"{",
"}",
")",
"(",
"opentracing",
".",
"Span",
",",
"context",
".",
"Context",
")",
"{",
"if",
"parentSpan",
":=",
"opentrac... | // AddSpanToAnyExisting checks 'ctx' for Jaeger tracing information, and if
// tracing metadata is present, it generates a new span for 'operation', marks
// it as a child of the existing span, and returns it. | [
"AddSpanToAnyExisting",
"checks",
"ctx",
"for",
"Jaeger",
"tracing",
"information",
"and",
"if",
"tracing",
"metadata",
"is",
"present",
"it",
"generates",
"a",
"new",
"span",
"for",
"operation",
"marks",
"it",
"as",
"a",
"child",
"of",
"the",
"existing",
"spa... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/tracing/tracing.go#L57-L64 | test |
pachyderm/pachyderm | src/client/pkg/tracing/tracing.go | InstallJaegerTracerFromEnv | func InstallJaegerTracerFromEnv() {
jaegerOnce.Do(func() {
jaegerEndpoint, onUserMachine := os.LookupEnv(jaegerEndpointEnvVar)
if !onUserMachine {
if host, ok := os.LookupEnv("JAEGER_COLLECTOR_SERVICE_HOST"); ok {
port := os.Getenv("JAEGER_COLLECTOR_SERVICE_PORT_JAEGER_COLLECTOR_HTTP")
jaegerEndpoint = ... | go | func InstallJaegerTracerFromEnv() {
jaegerOnce.Do(func() {
jaegerEndpoint, onUserMachine := os.LookupEnv(jaegerEndpointEnvVar)
if !onUserMachine {
if host, ok := os.LookupEnv("JAEGER_COLLECTOR_SERVICE_HOST"); ok {
port := os.Getenv("JAEGER_COLLECTOR_SERVICE_PORT_JAEGER_COLLECTOR_HTTP")
jaegerEndpoint = ... | [
"func",
"InstallJaegerTracerFromEnv",
"(",
")",
"{",
"jaegerOnce",
".",
"Do",
"(",
"func",
"(",
")",
"{",
"jaegerEndpoint",
",",
"onUserMachine",
":=",
"os",
".",
"LookupEnv",
"(",
"jaegerEndpointEnvVar",
")",
"\n",
"if",
"!",
"onUserMachine",
"{",
"if",
"ho... | // InstallJaegerTracerFromEnv installs a Jaeger client as then opentracing
// global tracer, relying on environment variables to configure the client. It
// returns the address used to initialize the global tracer, if any
// initialization occurred | [
"InstallJaegerTracerFromEnv",
"installs",
"a",
"Jaeger",
"client",
"as",
"then",
"opentracing",
"global",
"tracer",
"relying",
"on",
"environment",
"variables",
"to",
"configure",
"the",
"client",
".",
"It",
"returns",
"the",
"address",
"used",
"to",
"initialize",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/tracing/tracing.go#L78-L128 | test |
pachyderm/pachyderm | src/client/pkg/tracing/tracing.go | UnaryClientInterceptor | func UnaryClientInterceptor() grpc.UnaryClientInterceptor {
return otgrpc.OpenTracingClientInterceptor(opentracing.GlobalTracer(),
otgrpc.IncludingSpans(addTraceIfTracingEnabled))
} | go | func UnaryClientInterceptor() grpc.UnaryClientInterceptor {
return otgrpc.OpenTracingClientInterceptor(opentracing.GlobalTracer(),
otgrpc.IncludingSpans(addTraceIfTracingEnabled))
} | [
"func",
"UnaryClientInterceptor",
"(",
")",
"grpc",
".",
"UnaryClientInterceptor",
"{",
"return",
"otgrpc",
".",
"OpenTracingClientInterceptor",
"(",
"opentracing",
".",
"GlobalTracer",
"(",
")",
",",
"otgrpc",
".",
"IncludingSpans",
"(",
"addTraceIfTracingEnabled",
"... | // UnaryClientInterceptor returns a GRPC interceptor for non-streaming GRPC RPCs | [
"UnaryClientInterceptor",
"returns",
"a",
"GRPC",
"interceptor",
"for",
"non",
"-",
"streaming",
"GRPC",
"RPCs"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/tracing/tracing.go#L161-L164 | test |
pachyderm/pachyderm | src/client/pkg/tracing/tracing.go | StreamClientInterceptor | func StreamClientInterceptor() grpc.StreamClientInterceptor {
return otgrpc.OpenTracingStreamClientInterceptor(opentracing.GlobalTracer(),
otgrpc.IncludingSpans(addTraceIfTracingEnabled))
} | go | func StreamClientInterceptor() grpc.StreamClientInterceptor {
return otgrpc.OpenTracingStreamClientInterceptor(opentracing.GlobalTracer(),
otgrpc.IncludingSpans(addTraceIfTracingEnabled))
} | [
"func",
"StreamClientInterceptor",
"(",
")",
"grpc",
".",
"StreamClientInterceptor",
"{",
"return",
"otgrpc",
".",
"OpenTracingStreamClientInterceptor",
"(",
"opentracing",
".",
"GlobalTracer",
"(",
")",
",",
"otgrpc",
".",
"IncludingSpans",
"(",
"addTraceIfTracingEnabl... | // StreamClientInterceptor returns a GRPC interceptor for non-streaming GRPC RPCs | [
"StreamClientInterceptor",
"returns",
"a",
"GRPC",
"interceptor",
"for",
"non",
"-",
"streaming",
"GRPC",
"RPCs"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/tracing/tracing.go#L167-L170 | test |
pachyderm/pachyderm | src/client/pkg/tracing/tracing.go | UnaryServerInterceptor | func UnaryServerInterceptor() grpc.UnaryServerInterceptor {
return otgrpc.OpenTracingServerInterceptor(opentracing.GlobalTracer(),
otgrpc.IncludingSpans(addTraceIfTracingEnabled))
} | go | func UnaryServerInterceptor() grpc.UnaryServerInterceptor {
return otgrpc.OpenTracingServerInterceptor(opentracing.GlobalTracer(),
otgrpc.IncludingSpans(addTraceIfTracingEnabled))
} | [
"func",
"UnaryServerInterceptor",
"(",
")",
"grpc",
".",
"UnaryServerInterceptor",
"{",
"return",
"otgrpc",
".",
"OpenTracingServerInterceptor",
"(",
"opentracing",
".",
"GlobalTracer",
"(",
")",
",",
"otgrpc",
".",
"IncludingSpans",
"(",
"addTraceIfTracingEnabled",
"... | // UnaryServerInterceptor returns a GRPC interceptor for non-streaming GRPC RPCs | [
"UnaryServerInterceptor",
"returns",
"a",
"GRPC",
"interceptor",
"for",
"non",
"-",
"streaming",
"GRPC",
"RPCs"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/tracing/tracing.go#L173-L176 | test |
pachyderm/pachyderm | src/client/pkg/tracing/tracing.go | StreamServerInterceptor | func StreamServerInterceptor() grpc.StreamServerInterceptor {
return otgrpc.OpenTracingStreamServerInterceptor(opentracing.GlobalTracer(),
otgrpc.IncludingSpans(addTraceIfTracingEnabled))
} | go | func StreamServerInterceptor() grpc.StreamServerInterceptor {
return otgrpc.OpenTracingStreamServerInterceptor(opentracing.GlobalTracer(),
otgrpc.IncludingSpans(addTraceIfTracingEnabled))
} | [
"func",
"StreamServerInterceptor",
"(",
")",
"grpc",
".",
"StreamServerInterceptor",
"{",
"return",
"otgrpc",
".",
"OpenTracingStreamServerInterceptor",
"(",
"opentracing",
".",
"GlobalTracer",
"(",
")",
",",
"otgrpc",
".",
"IncludingSpans",
"(",
"addTraceIfTracingEnabl... | // StreamServerInterceptor returns a GRPC interceptor for non-streaming GRPC RPCs | [
"StreamServerInterceptor",
"returns",
"a",
"GRPC",
"interceptor",
"for",
"non",
"-",
"streaming",
"GRPC",
"RPCs"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/tracing/tracing.go#L179-L182 | test |
pachyderm/pachyderm | src/client/pkg/tracing/tracing.go | CloseAndReportTraces | func CloseAndReportTraces() {
if c, ok := opentracing.GlobalTracer().(io.Closer); ok {
c.Close()
}
} | go | func CloseAndReportTraces() {
if c, ok := opentracing.GlobalTracer().(io.Closer); ok {
c.Close()
}
} | [
"func",
"CloseAndReportTraces",
"(",
")",
"{",
"if",
"c",
",",
"ok",
":=",
"opentracing",
".",
"GlobalTracer",
"(",
")",
".",
"(",
"io",
".",
"Closer",
")",
";",
"ok",
"{",
"c",
".",
"Close",
"(",
")",
"\n",
"}",
"\n",
"}"
] | // CloseAndReportTraces tries to close the global tracer, which, in the case of
// the Jaeger tracer, causes it to send any unreported traces to the collector | [
"CloseAndReportTraces",
"tries",
"to",
"close",
"the",
"global",
"tracer",
"which",
"in",
"the",
"case",
"of",
"the",
"Jaeger",
"tracer",
"causes",
"it",
"to",
"send",
"any",
"unreported",
"traces",
"to",
"the",
"collector"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/tracing/tracing.go#L186-L190 | test |
pachyderm/pachyderm | src/server/pkg/storage/chunk/writer.go | newWriter | func newWriter(ctx context.Context, objC obj.Client, prefix string) *Writer {
// Initialize buzhash64 with WindowSize window.
hash := buzhash64.New()
hash.Write(make([]byte, WindowSize))
return &Writer{
ctx: ctx,
objC: objC,
prefix: prefix,
cbs: []func([]*DataRef) error{},
buf: &... | go | func newWriter(ctx context.Context, objC obj.Client, prefix string) *Writer {
// Initialize buzhash64 with WindowSize window.
hash := buzhash64.New()
hash.Write(make([]byte, WindowSize))
return &Writer{
ctx: ctx,
objC: objC,
prefix: prefix,
cbs: []func([]*DataRef) error{},
buf: &... | [
"func",
"newWriter",
"(",
"ctx",
"context",
".",
"Context",
",",
"objC",
"obj",
".",
"Client",
",",
"prefix",
"string",
")",
"*",
"Writer",
"{",
"hash",
":=",
"buzhash64",
".",
"New",
"(",
")",
"\n",
"hash",
".",
"Write",
"(",
"make",
"(",
"[",
"]"... | // newWriter creates a new Writer. | [
"newWriter",
"creates",
"a",
"new",
"Writer",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/storage/chunk/writer.go#L47-L60 | test |
pachyderm/pachyderm | src/server/pkg/backoff/backoff.go | For | func (b *ConstantBackOff) For(maxElapsed time.Duration) *ConstantBackOff {
b.MaxElapsedTime = maxElapsed
return b
} | go | func (b *ConstantBackOff) For(maxElapsed time.Duration) *ConstantBackOff {
b.MaxElapsedTime = maxElapsed
return b
} | [
"func",
"(",
"b",
"*",
"ConstantBackOff",
")",
"For",
"(",
"maxElapsed",
"time",
".",
"Duration",
")",
"*",
"ConstantBackOff",
"{",
"b",
".",
"MaxElapsedTime",
"=",
"maxElapsed",
"\n",
"return",
"b",
"\n",
"}"
] | // For sets b.MaxElapsedTime to 'maxElapsed' and returns b | [
"For",
"sets",
"b",
".",
"MaxElapsedTime",
"to",
"maxElapsed",
"and",
"returns",
"b"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/backoff/backoff.go#L107-L110 | test |
pachyderm/pachyderm | src/server/pkg/log/log.go | Log | func (l *logger) Log(request interface{}, response interface{}, err error, duration time.Duration) {
if err != nil {
l.LogAtLevelFromDepth(request, response, err, duration, logrus.ErrorLevel, 4)
} else {
l.LogAtLevelFromDepth(request, response, err, duration, logrus.InfoLevel, 4)
}
// We have to grab the method... | go | func (l *logger) Log(request interface{}, response interface{}, err error, duration time.Duration) {
if err != nil {
l.LogAtLevelFromDepth(request, response, err, duration, logrus.ErrorLevel, 4)
} else {
l.LogAtLevelFromDepth(request, response, err, duration, logrus.InfoLevel, 4)
}
// We have to grab the method... | [
"func",
"(",
"l",
"*",
"logger",
")",
"Log",
"(",
"request",
"interface",
"{",
"}",
",",
"response",
"interface",
"{",
"}",
",",
"err",
"error",
",",
"duration",
"time",
".",
"Duration",
")",
"{",
"if",
"err",
"!=",
"nil",
"{",
"l",
".",
"LogAtLeve... | // Helper function used to log requests and responses from our GRPC method
// implementations | [
"Helper",
"function",
"used",
"to",
"log",
"requests",
"and",
"responses",
"from",
"our",
"GRPC",
"method",
"implementations"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/log/log.go#L88-L97 | test |
pachyderm/pachyderm | src/server/pkg/log/log.go | Format | func (f FormatterFunc) Format(entry *logrus.Entry) ([]byte, error) {
return f(entry)
} | go | func (f FormatterFunc) Format(entry *logrus.Entry) ([]byte, error) {
return f(entry)
} | [
"func",
"(",
"f",
"FormatterFunc",
")",
"Format",
"(",
"entry",
"*",
"logrus",
".",
"Entry",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"return",
"f",
"(",
"entry",
")",
"\n",
"}"
] | // Format proxies the closure in order to satisfy `logrus.Formatter`'s
// interface. | [
"Format",
"proxies",
"the",
"closure",
"in",
"order",
"to",
"satisfy",
"logrus",
".",
"Formatter",
"s",
"interface",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/log/log.go#L246-L248 | test |
pachyderm/pachyderm | src/server/pkg/log/log.go | NewGRPCLogWriter | func NewGRPCLogWriter(logger *logrus.Logger, source string) *GRPCLogWriter {
return &GRPCLogWriter{
logger: logger,
source: source,
}
} | go | func NewGRPCLogWriter(logger *logrus.Logger, source string) *GRPCLogWriter {
return &GRPCLogWriter{
logger: logger,
source: source,
}
} | [
"func",
"NewGRPCLogWriter",
"(",
"logger",
"*",
"logrus",
".",
"Logger",
",",
"source",
"string",
")",
"*",
"GRPCLogWriter",
"{",
"return",
"&",
"GRPCLogWriter",
"{",
"logger",
":",
"logger",
",",
"source",
":",
"source",
",",
"}",
"\n",
"}"
] | // NewGRPCLogWriter creates a new GRPC log writer. `logger` specifies the
// underlying logger, and `source` specifies where these logs are coming from;
// it is added as a entry field for all log messages. | [
"NewGRPCLogWriter",
"creates",
"a",
"new",
"GRPC",
"log",
"writer",
".",
"logger",
"specifies",
"the",
"underlying",
"logger",
"and",
"source",
"specifies",
"where",
"these",
"logs",
"are",
"coming",
"from",
";",
"it",
"is",
"added",
"as",
"a",
"entry",
"fie... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/log/log.go#L296-L301 | test |
pachyderm/pachyderm | src/client/pkg/config/config.go | Read | func Read() (*Config, error) {
var c *Config
// Read json file
p := configPath()
if raw, err := ioutil.ReadFile(p); err == nil {
err = json.Unmarshal(raw, &c)
if err != nil {
return nil, err
}
} else if os.IsNotExist(err) {
// File doesn't exist, so create a new config
fmt.Println("no config detected... | go | func Read() (*Config, error) {
var c *Config
// Read json file
p := configPath()
if raw, err := ioutil.ReadFile(p); err == nil {
err = json.Unmarshal(raw, &c)
if err != nil {
return nil, err
}
} else if os.IsNotExist(err) {
// File doesn't exist, so create a new config
fmt.Println("no config detected... | [
"func",
"Read",
"(",
")",
"(",
"*",
"Config",
",",
"error",
")",
"{",
"var",
"c",
"*",
"Config",
"\n",
"p",
":=",
"configPath",
"(",
")",
"\n",
"if",
"raw",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"p",
")",
";",
"err",
"==",
"nil",
... | // Read loads the Pachyderm config on this machine.
// If an existing configuration cannot be found, it sets up the defaults. Read
// returns a nil Config if and only if it returns a non-nil error. | [
"Read",
"loads",
"the",
"Pachyderm",
"config",
"on",
"this",
"machine",
".",
"If",
"an",
"existing",
"configuration",
"cannot",
"be",
"found",
"it",
"sets",
"up",
"the",
"defaults",
".",
"Read",
"returns",
"a",
"nil",
"Config",
"if",
"and",
"only",
"if",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/config/config.go#L28-L58 | test |
pachyderm/pachyderm | src/client/pkg/config/config.go | Write | func (c *Config) Write() error {
rawConfig, err := json.MarshalIndent(c, "", " ")
if err != nil {
return err
}
// If we're not using a custom config path, create the default config path
p := configPath()
if _, ok := os.LookupEnv(configEnvVar); ok {
// using overridden config path -- just make sure the paren... | go | func (c *Config) Write() error {
rawConfig, err := json.MarshalIndent(c, "", " ")
if err != nil {
return err
}
// If we're not using a custom config path, create the default config path
p := configPath()
if _, ok := os.LookupEnv(configEnvVar); ok {
// using overridden config path -- just make sure the paren... | [
"func",
"(",
"c",
"*",
"Config",
")",
"Write",
"(",
")",
"error",
"{",
"rawConfig",
",",
"err",
":=",
"json",
".",
"MarshalIndent",
"(",
"c",
",",
"\"\"",
",",
"\" \"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
... | // Write writes the configuration in 'c' to this machine's Pachyderm config
// file. | [
"Write",
"writes",
"the",
"configuration",
"in",
"c",
"to",
"this",
"machine",
"s",
"Pachyderm",
"config",
"file",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/config/config.go#L62-L84 | test |
pachyderm/pachyderm | src/client/pkg/pbutil/pbutil.go | Read | func (r *readWriter) Read(val proto.Message) error {
buf, err := r.ReadBytes()
if err != nil {
return err
}
return proto.Unmarshal(buf, val)
} | go | func (r *readWriter) Read(val proto.Message) error {
buf, err := r.ReadBytes()
if err != nil {
return err
}
return proto.Unmarshal(buf, val)
} | [
"func",
"(",
"r",
"*",
"readWriter",
")",
"Read",
"(",
"val",
"proto",
".",
"Message",
")",
"error",
"{",
"buf",
",",
"err",
":=",
"r",
".",
"ReadBytes",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
... | // Read reads val from r. | [
"Read",
"reads",
"val",
"from",
"r",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/pbutil/pbutil.go#L54-L60 | test |
pachyderm/pachyderm | src/client/pkg/pbutil/pbutil.go | Write | func (r *readWriter) Write(val proto.Message) (int64, error) {
bytes, err := proto.Marshal(val)
if err != nil {
return 0, err
}
return r.WriteBytes(bytes)
} | go | func (r *readWriter) Write(val proto.Message) (int64, error) {
bytes, err := proto.Marshal(val)
if err != nil {
return 0, err
}
return r.WriteBytes(bytes)
} | [
"func",
"(",
"r",
"*",
"readWriter",
")",
"Write",
"(",
"val",
"proto",
".",
"Message",
")",
"(",
"int64",
",",
"error",
")",
"{",
"bytes",
",",
"err",
":=",
"proto",
".",
"Marshal",
"(",
"val",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",... | // Write writes val to r. | [
"Write",
"writes",
"val",
"to",
"r",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/pbutil/pbutil.go#L72-L78 | test |
pachyderm/pachyderm | src/client/pkg/pbutil/pbutil.go | NewReadWriter | func NewReadWriter(rw io.ReadWriter) ReadWriter {
return &readWriter{r: rw, w: rw}
} | go | func NewReadWriter(rw io.ReadWriter) ReadWriter {
return &readWriter{r: rw, w: rw}
} | [
"func",
"NewReadWriter",
"(",
"rw",
"io",
".",
"ReadWriter",
")",
"ReadWriter",
"{",
"return",
"&",
"readWriter",
"{",
"r",
":",
"rw",
",",
"w",
":",
"rw",
"}",
"\n",
"}"
] | // NewReadWriter returns a new ReadWriter with rw as both its source and its sink. | [
"NewReadWriter",
"returns",
"a",
"new",
"ReadWriter",
"with",
"rw",
"as",
"both",
"its",
"source",
"and",
"its",
"sink",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/pbutil/pbutil.go#L91-L93 | test |
pachyderm/pachyderm | src/server/pps/server/githook/githook.go | RunGitHookServer | func RunGitHookServer(address string, etcdAddress string, etcdPrefix string) error {
c, err := client.NewFromAddress(address)
if err != nil {
return err
}
etcdClient, err := etcd.New(etcd.Config{
Endpoints: []string{etcdAddress},
DialOptions: client.DefaultDialOptions(),
})
if err != nil {
return err
}... | go | func RunGitHookServer(address string, etcdAddress string, etcdPrefix string) error {
c, err := client.NewFromAddress(address)
if err != nil {
return err
}
etcdClient, err := etcd.New(etcd.Config{
Endpoints: []string{etcdAddress},
DialOptions: client.DefaultDialOptions(),
})
if err != nil {
return err
}... | [
"func",
"RunGitHookServer",
"(",
"address",
"string",
",",
"etcdAddress",
"string",
",",
"etcdPrefix",
"string",
")",
"error",
"{",
"c",
",",
"err",
":=",
"client",
".",
"NewFromAddress",
"(",
"address",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
... | // RunGitHookServer starts the webhook server | [
"RunGitHookServer",
"starts",
"the",
"webhook",
"server"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/server/githook/githook.go#L59-L82 | test |
pachyderm/pachyderm | src/server/pkg/cert/logging_conn.go | newLoggingPipe | func newLoggingPipe() *loggingPipe {
p := &loggingPipe{}
p.clientReader, p.clientWriter = io.Pipe()
p.clientReader = io.TeeReader(p.clientReader, &p.ServerToClientBuf)
p.serverReader, p.serverWriter = io.Pipe()
p.serverReader = io.TeeReader(p.serverReader, &p.ClientToServerBuf)
return p
} | go | func newLoggingPipe() *loggingPipe {
p := &loggingPipe{}
p.clientReader, p.clientWriter = io.Pipe()
p.clientReader = io.TeeReader(p.clientReader, &p.ServerToClientBuf)
p.serverReader, p.serverWriter = io.Pipe()
p.serverReader = io.TeeReader(p.serverReader, &p.ClientToServerBuf)
return p
} | [
"func",
"newLoggingPipe",
"(",
")",
"*",
"loggingPipe",
"{",
"p",
":=",
"&",
"loggingPipe",
"{",
"}",
"\n",
"p",
".",
"clientReader",
",",
"p",
".",
"clientWriter",
"=",
"io",
".",
"Pipe",
"(",
")",
"\n",
"p",
".",
"clientReader",
"=",
"io",
".",
"... | // newLoggingPipe initializes a loggingPipe | [
"newLoggingPipe",
"initializes",
"a",
"loggingPipe"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cert/logging_conn.go#L40-L47 | test |
pachyderm/pachyderm | src/server/pkg/cert/logging_conn.go | Read | func (l *loggingConn) Read(b []byte) (n int, err error) {
return l.r.Read(b)
} | go | func (l *loggingConn) Read(b []byte) (n int, err error) {
return l.r.Read(b)
} | [
"func",
"(",
"l",
"*",
"loggingConn",
")",
"Read",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"return",
"l",
".",
"r",
".",
"Read",
"(",
"b",
")",
"\n",
"}"
] | // Read implements the corresponding method of net.Conn | [
"Read",
"implements",
"the",
"corresponding",
"method",
"of",
"net",
".",
"Conn"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cert/logging_conn.go#L89-L91 | test |
pachyderm/pachyderm | src/server/pkg/cert/logging_conn.go | Write | func (l *loggingConn) Write(b []byte) (n int, err error) {
return l.w.Write(b)
} | go | func (l *loggingConn) Write(b []byte) (n int, err error) {
return l.w.Write(b)
} | [
"func",
"(",
"l",
"*",
"loggingConn",
")",
"Write",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"return",
"l",
".",
"w",
".",
"Write",
"(",
"b",
")",
"\n",
"}"
] | // Write implements the corresponding method of net.Conn | [
"Write",
"implements",
"the",
"corresponding",
"method",
"of",
"net",
".",
"Conn"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cert/logging_conn.go#L94-L96 | test |
pachyderm/pachyderm | src/server/pkg/cert/logging_conn.go | Accept | func (l *TestListener) Accept() (net.Conn, error) {
conn := <-l.connCh
if conn == nil {
return nil, errors.New("Accept() has already been called on this TestListener")
}
return conn, nil
} | go | func (l *TestListener) Accept() (net.Conn, error) {
conn := <-l.connCh
if conn == nil {
return nil, errors.New("Accept() has already been called on this TestListener")
}
return conn, nil
} | [
"func",
"(",
"l",
"*",
"TestListener",
")",
"Accept",
"(",
")",
"(",
"net",
".",
"Conn",
",",
"error",
")",
"{",
"conn",
":=",
"<-",
"l",
".",
"connCh",
"\n",
"if",
"conn",
"==",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"A... | // Accept implements the corresponding method of net.Listener for
// TestListener | [
"Accept",
"implements",
"the",
"corresponding",
"method",
"of",
"net",
".",
"Listener",
"for",
"TestListener"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cert/logging_conn.go#L182-L188 | test |
pachyderm/pachyderm | src/server/pkg/cert/logging_conn.go | Close | func (l *TestListener) Close() error {
l.connMu.Lock()
defer l.connMu.Unlock()
c := <-l.connCh
if c != nil {
close(l.connCh)
}
return nil
} | go | func (l *TestListener) Close() error {
l.connMu.Lock()
defer l.connMu.Unlock()
c := <-l.connCh
if c != nil {
close(l.connCh)
}
return nil
} | [
"func",
"(",
"l",
"*",
"TestListener",
")",
"Close",
"(",
")",
"error",
"{",
"l",
".",
"connMu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"connMu",
".",
"Unlock",
"(",
")",
"\n",
"c",
":=",
"<-",
"l",
".",
"connCh",
"\n",
"if",
"c",
"!... | // Close implements the corresponding method of net.Listener for
// TestListener. Any blocked Accept operations will be unblocked and return
// errors. | [
"Close",
"implements",
"the",
"corresponding",
"method",
"of",
"net",
".",
"Listener",
"for",
"TestListener",
".",
"Any",
"blocked",
"Accept",
"operations",
"will",
"be",
"unblocked",
"and",
"return",
"errors",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cert/logging_conn.go#L193-L201 | test |
pachyderm/pachyderm | src/server/pkg/hashtree/error.go | errorf | func errorf(c ErrCode, fmtStr string, args ...interface{}) error {
return &hashTreeError{
code: c,
s: fmt.Sprintf(fmtStr, args...),
}
} | go | func errorf(c ErrCode, fmtStr string, args ...interface{}) error {
return &hashTreeError{
code: c,
s: fmt.Sprintf(fmtStr, args...),
}
} | [
"func",
"errorf",
"(",
"c",
"ErrCode",
",",
"fmtStr",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"&",
"hashTreeError",
"{",
"code",
":",
"c",
",",
"s",
":",
"fmt",
".",
"Sprintf",
"(",
"fmtStr",
",",
"args",
"... | // errorf is analogous to fmt.Errorf, but generates hashTreeErrors instead of
// errorStrings. | [
"errorf",
"is",
"analogous",
"to",
"fmt",
".",
"Errorf",
"but",
"generates",
"hashTreeErrors",
"instead",
"of",
"errorStrings",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/error.go#L32-L37 | test |
pachyderm/pachyderm | src/server/pkg/serviceenv/service_env.go | InitWithKube | func InitWithKube(config *Configuration) *ServiceEnv {
env := InitServiceEnv(config)
env.kubeEg.Go(env.initKubeClient)
return env // env is not ready yet
} | go | func InitWithKube(config *Configuration) *ServiceEnv {
env := InitServiceEnv(config)
env.kubeEg.Go(env.initKubeClient)
return env // env is not ready yet
} | [
"func",
"InitWithKube",
"(",
"config",
"*",
"Configuration",
")",
"*",
"ServiceEnv",
"{",
"env",
":=",
"InitServiceEnv",
"(",
"config",
")",
"\n",
"env",
".",
"kubeEg",
".",
"Go",
"(",
"env",
".",
"initKubeClient",
")",
"\n",
"return",
"env",
"\n",
"}"
] | // InitWithKube is like InitServiceEnv, but also assumes that it's run inside
// a kubernetes cluster and tries to connect to the kubernetes API server. | [
"InitWithKube",
"is",
"like",
"InitServiceEnv",
"but",
"also",
"assumes",
"that",
"it",
"s",
"run",
"inside",
"a",
"kubernetes",
"cluster",
"and",
"tries",
"to",
"connect",
"to",
"the",
"kubernetes",
"API",
"server",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/serviceenv/service_env.go#L85-L89 | test |
pachyderm/pachyderm | src/server/pkg/serviceenv/service_env.go | GetEtcdClient | func (env *ServiceEnv) GetEtcdClient() *etcd.Client {
if err := env.etcdEg.Wait(); err != nil {
panic(err) // If env can't connect, there's no sensible way to recover
}
if env.etcdClient == nil {
panic("service env never connected to etcd")
}
return env.etcdClient
} | go | func (env *ServiceEnv) GetEtcdClient() *etcd.Client {
if err := env.etcdEg.Wait(); err != nil {
panic(err) // If env can't connect, there's no sensible way to recover
}
if env.etcdClient == nil {
panic("service env never connected to etcd")
}
return env.etcdClient
} | [
"func",
"(",
"env",
"*",
"ServiceEnv",
")",
"GetEtcdClient",
"(",
")",
"*",
"etcd",
".",
"Client",
"{",
"if",
"err",
":=",
"env",
".",
"etcdEg",
".",
"Wait",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
")",
"\n",
"}",
"\n",
"if... | // GetEtcdClient returns the already connected etcd client without modification. | [
"GetEtcdClient",
"returns",
"the",
"already",
"connected",
"etcd",
"client",
"without",
"modification",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/serviceenv/service_env.go#L174-L182 | test |
pachyderm/pachyderm | src/server/pkg/serviceenv/service_env.go | GetKubeClient | func (env *ServiceEnv) GetKubeClient() *kube.Clientset {
if err := env.kubeEg.Wait(); err != nil {
panic(err) // If env can't connect, there's no sensible way to recover
}
if env.kubeClient == nil {
panic("service env never connected to kubernetes")
}
return env.kubeClient
} | go | func (env *ServiceEnv) GetKubeClient() *kube.Clientset {
if err := env.kubeEg.Wait(); err != nil {
panic(err) // If env can't connect, there's no sensible way to recover
}
if env.kubeClient == nil {
panic("service env never connected to kubernetes")
}
return env.kubeClient
} | [
"func",
"(",
"env",
"*",
"ServiceEnv",
")",
"GetKubeClient",
"(",
")",
"*",
"kube",
".",
"Clientset",
"{",
"if",
"err",
":=",
"env",
".",
"kubeEg",
".",
"Wait",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
")",
"\n",
"}",
"\n",
... | // GetKubeClient returns the already connected Kubernetes API client without
// modification. | [
"GetKubeClient",
"returns",
"the",
"already",
"connected",
"Kubernetes",
"API",
"client",
"without",
"modification",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/serviceenv/service_env.go#L186-L194 | test |
pachyderm/pachyderm | src/server/pps/hash.go | NewHasher | func NewHasher(jobModulus uint64, pipelineModulus uint64) *Hasher {
return &Hasher{
JobModulus: jobModulus,
PipelineModulus: pipelineModulus,
}
} | go | func NewHasher(jobModulus uint64, pipelineModulus uint64) *Hasher {
return &Hasher{
JobModulus: jobModulus,
PipelineModulus: pipelineModulus,
}
} | [
"func",
"NewHasher",
"(",
"jobModulus",
"uint64",
",",
"pipelineModulus",
"uint64",
")",
"*",
"Hasher",
"{",
"return",
"&",
"Hasher",
"{",
"JobModulus",
":",
"jobModulus",
",",
"PipelineModulus",
":",
"pipelineModulus",
",",
"}",
"\n",
"}"
] | // NewHasher creates a hasher. | [
"NewHasher",
"creates",
"a",
"hasher",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/hash.go#L14-L19 | test |
pachyderm/pachyderm | src/server/pps/hash.go | HashJob | func (s *Hasher) HashJob(jobID string) uint64 {
return uint64(adler32.Checksum([]byte(jobID))) % s.JobModulus
} | go | func (s *Hasher) HashJob(jobID string) uint64 {
return uint64(adler32.Checksum([]byte(jobID))) % s.JobModulus
} | [
"func",
"(",
"s",
"*",
"Hasher",
")",
"HashJob",
"(",
"jobID",
"string",
")",
"uint64",
"{",
"return",
"uint64",
"(",
"adler32",
".",
"Checksum",
"(",
"[",
"]",
"byte",
"(",
"jobID",
")",
")",
")",
"%",
"s",
".",
"JobModulus",
"\n",
"}"
] | // HashJob computes and returns the hash of a job. | [
"HashJob",
"computes",
"and",
"returns",
"the",
"hash",
"of",
"a",
"job",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/hash.go#L22-L24 | test |
pachyderm/pachyderm | src/server/pps/hash.go | HashPipeline | func (s *Hasher) HashPipeline(pipelineName string) uint64 {
return uint64(adler32.Checksum([]byte(pipelineName))) % s.PipelineModulus
} | go | func (s *Hasher) HashPipeline(pipelineName string) uint64 {
return uint64(adler32.Checksum([]byte(pipelineName))) % s.PipelineModulus
} | [
"func",
"(",
"s",
"*",
"Hasher",
")",
"HashPipeline",
"(",
"pipelineName",
"string",
")",
"uint64",
"{",
"return",
"uint64",
"(",
"adler32",
".",
"Checksum",
"(",
"[",
"]",
"byte",
"(",
"pipelineName",
")",
")",
")",
"%",
"s",
".",
"PipelineModulus",
"... | // HashPipeline computes and returns the hash of a pipeline. | [
"HashPipeline",
"computes",
"and",
"returns",
"the",
"hash",
"of",
"a",
"pipeline",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/hash.go#L27-L29 | test |
pachyderm/pachyderm | src/server/worker/client.go | Status | func Status(ctx context.Context, pipelineRcName string, etcdClient *etcd.Client, etcdPrefix string, workerGrpcPort uint16) ([]*pps.WorkerStatus, error) {
workerClients, err := Clients(ctx, pipelineRcName, etcdClient, etcdPrefix, workerGrpcPort)
if err != nil {
return nil, err
}
var result []*pps.WorkerStatus
for... | go | func Status(ctx context.Context, pipelineRcName string, etcdClient *etcd.Client, etcdPrefix string, workerGrpcPort uint16) ([]*pps.WorkerStatus, error) {
workerClients, err := Clients(ctx, pipelineRcName, etcdClient, etcdPrefix, workerGrpcPort)
if err != nil {
return nil, err
}
var result []*pps.WorkerStatus
for... | [
"func",
"Status",
"(",
"ctx",
"context",
".",
"Context",
",",
"pipelineRcName",
"string",
",",
"etcdClient",
"*",
"etcd",
".",
"Client",
",",
"etcdPrefix",
"string",
",",
"workerGrpcPort",
"uint16",
")",
"(",
"[",
"]",
"*",
"pps",
".",
"WorkerStatus",
",",... | // Status returns the statuses of workers referenced by pipelineRcName.
// pipelineRcName is the name of the pipeline's RC and can be gotten with
// ppsutil.PipelineRcName. You can also pass "" for pipelineRcName to get all
// clients for all workers. | [
"Status",
"returns",
"the",
"statuses",
"of",
"workers",
"referenced",
"by",
"pipelineRcName",
".",
"pipelineRcName",
"is",
"the",
"name",
"of",
"the",
"pipeline",
"s",
"RC",
"and",
"can",
"be",
"gotten",
"with",
"ppsutil",
".",
"PipelineRcName",
".",
"You",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/worker/client.go#L28-L42 | test |
pachyderm/pachyderm | src/server/worker/client.go | Cancel | func Cancel(ctx context.Context, pipelineRcName string, etcdClient *etcd.Client,
etcdPrefix string, workerGrpcPort uint16, jobID string, dataFilter []string) error {
workerClients, err := Clients(ctx, pipelineRcName, etcdClient, etcdPrefix, workerGrpcPort)
if err != nil {
return err
}
success := false
for _, wo... | go | func Cancel(ctx context.Context, pipelineRcName string, etcdClient *etcd.Client,
etcdPrefix string, workerGrpcPort uint16, jobID string, dataFilter []string) error {
workerClients, err := Clients(ctx, pipelineRcName, etcdClient, etcdPrefix, workerGrpcPort)
if err != nil {
return err
}
success := false
for _, wo... | [
"func",
"Cancel",
"(",
"ctx",
"context",
".",
"Context",
",",
"pipelineRcName",
"string",
",",
"etcdClient",
"*",
"etcd",
".",
"Client",
",",
"etcdPrefix",
"string",
",",
"workerGrpcPort",
"uint16",
",",
"jobID",
"string",
",",
"dataFilter",
"[",
"]",
"strin... | // Cancel cancels a set of datums running on workers.
// pipelineRcName is the name of the pipeline's RC and can be gotten with
// ppsutil.PipelineRcName. | [
"Cancel",
"cancels",
"a",
"set",
"of",
"datums",
"running",
"on",
"workers",
".",
"pipelineRcName",
"is",
"the",
"name",
"of",
"the",
"pipeline",
"s",
"RC",
"and",
"can",
"be",
"gotten",
"with",
"ppsutil",
".",
"PipelineRcName",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/worker/client.go#L47-L70 | test |
pachyderm/pachyderm | src/server/worker/client.go | Conns | func Conns(ctx context.Context, pipelineRcName string, etcdClient *etcd.Client, etcdPrefix string, workerGrpcPort uint16) ([]*grpc.ClientConn, error) {
resp, err := etcdClient.Get(ctx, path.Join(etcdPrefix, WorkerEtcdPrefix, pipelineRcName), etcd.WithPrefix())
if err != nil {
return nil, err
}
var result []*grpc.... | go | func Conns(ctx context.Context, pipelineRcName string, etcdClient *etcd.Client, etcdPrefix string, workerGrpcPort uint16) ([]*grpc.ClientConn, error) {
resp, err := etcdClient.Get(ctx, path.Join(etcdPrefix, WorkerEtcdPrefix, pipelineRcName), etcd.WithPrefix())
if err != nil {
return nil, err
}
var result []*grpc.... | [
"func",
"Conns",
"(",
"ctx",
"context",
".",
"Context",
",",
"pipelineRcName",
"string",
",",
"etcdClient",
"*",
"etcd",
".",
"Client",
",",
"etcdPrefix",
"string",
",",
"workerGrpcPort",
"uint16",
")",
"(",
"[",
"]",
"*",
"grpc",
".",
"ClientConn",
",",
... | // Conns returns a slice of connections to worker servers.
// pipelineRcName is the name of the pipeline's RC and can be gotten with
// ppsutil.PipelineRcName. You can also pass "" for pipelineRcName to get all
// clients for all workers. | [
"Conns",
"returns",
"a",
"slice",
"of",
"connections",
"to",
"worker",
"servers",
".",
"pipelineRcName",
"is",
"the",
"name",
"of",
"the",
"pipeline",
"s",
"RC",
"and",
"can",
"be",
"gotten",
"with",
"ppsutil",
".",
"PipelineRcName",
".",
"You",
"can",
"al... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/worker/client.go#L76-L91 | test |
pachyderm/pachyderm | src/server/worker/client.go | Clients | func Clients(ctx context.Context, pipelineRcName string, etcdClient *etcd.Client, etcdPrefix string, workerGrpcPort uint16) ([]Client, error) {
conns, err := Conns(ctx, pipelineRcName, etcdClient, etcdPrefix, workerGrpcPort)
if err != nil {
return nil, err
}
var result []Client
for _, conn := range conns {
res... | go | func Clients(ctx context.Context, pipelineRcName string, etcdClient *etcd.Client, etcdPrefix string, workerGrpcPort uint16) ([]Client, error) {
conns, err := Conns(ctx, pipelineRcName, etcdClient, etcdPrefix, workerGrpcPort)
if err != nil {
return nil, err
}
var result []Client
for _, conn := range conns {
res... | [
"func",
"Clients",
"(",
"ctx",
"context",
".",
"Context",
",",
"pipelineRcName",
"string",
",",
"etcdClient",
"*",
"etcd",
".",
"Client",
",",
"etcdPrefix",
"string",
",",
"workerGrpcPort",
"uint16",
")",
"(",
"[",
"]",
"Client",
",",
"error",
")",
"{",
... | // Clients returns a slice of worker clients for a pipeline.
// pipelineRcName is the name of the pipeline's RC and can be gotten with
// ppsutil.PipelineRcName. You can also pass "" for pipelineRcName to get all
// clients for all workers. | [
"Clients",
"returns",
"a",
"slice",
"of",
"worker",
"clients",
"for",
"a",
"pipeline",
".",
"pipelineRcName",
"is",
"the",
"name",
"of",
"the",
"pipeline",
"s",
"RC",
"and",
"can",
"be",
"gotten",
"with",
"ppsutil",
".",
"PipelineRcName",
".",
"You",
"can"... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/worker/client.go#L110-L120 | test |
pachyderm/pachyderm | src/server/worker/client.go | NewClient | func NewClient(address string) (Client, error) {
port, err := strconv.Atoi(os.Getenv(client.PPSWorkerPortEnv))
if err != nil {
return Client{}, err
}
conn, err := grpc.Dial(fmt.Sprintf("%s:%d", address, port),
append(client.DefaultDialOptions(), grpc.WithInsecure())...)
if err != nil {
return Client{}, err
... | go | func NewClient(address string) (Client, error) {
port, err := strconv.Atoi(os.Getenv(client.PPSWorkerPortEnv))
if err != nil {
return Client{}, err
}
conn, err := grpc.Dial(fmt.Sprintf("%s:%d", address, port),
append(client.DefaultDialOptions(), grpc.WithInsecure())...)
if err != nil {
return Client{}, err
... | [
"func",
"NewClient",
"(",
"address",
"string",
")",
"(",
"Client",
",",
"error",
")",
"{",
"port",
",",
"err",
":=",
"strconv",
".",
"Atoi",
"(",
"os",
".",
"Getenv",
"(",
"client",
".",
"PPSWorkerPortEnv",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // NewClient returns a worker client for the worker at the IP address passed in. | [
"NewClient",
"returns",
"a",
"worker",
"client",
"for",
"the",
"worker",
"at",
"the",
"IP",
"address",
"passed",
"in",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/worker/client.go#L123-L134 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/cobra.go | RunFixedArgs | func RunFixedArgs(numArgs int, run func([]string) error) func(*cobra.Command, []string) {
return func(cmd *cobra.Command, args []string) {
if len(args) != numArgs {
fmt.Printf("expected %d arguments, got %d\n\n", numArgs, len(args))
cmd.Usage()
} else {
if err := run(args); err != nil {
ErrorAndExit("... | go | func RunFixedArgs(numArgs int, run func([]string) error) func(*cobra.Command, []string) {
return func(cmd *cobra.Command, args []string) {
if len(args) != numArgs {
fmt.Printf("expected %d arguments, got %d\n\n", numArgs, len(args))
cmd.Usage()
} else {
if err := run(args); err != nil {
ErrorAndExit("... | [
"func",
"RunFixedArgs",
"(",
"numArgs",
"int",
",",
"run",
"func",
"(",
"[",
"]",
"string",
")",
"error",
")",
"func",
"(",
"*",
"cobra",
".",
"Command",
",",
"[",
"]",
"string",
")",
"{",
"return",
"func",
"(",
"cmd",
"*",
"cobra",
".",
"Command",... | // RunFixedArgs wraps a function in a function
// that checks its exact argument count. | [
"RunFixedArgs",
"wraps",
"a",
"function",
"in",
"a",
"function",
"that",
"checks",
"its",
"exact",
"argument",
"count",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/cobra.go#L16-L27 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/cobra.go | RunBoundedArgs | func RunBoundedArgs(min int, max int, run func([]string) error) func(*cobra.Command, []string) {
return func(cmd *cobra.Command, args []string) {
if len(args) < min || len(args) > max {
fmt.Printf("expected %d to %d arguments, got %d\n\n", min, max, len(args))
cmd.Usage()
} else {
if err := run(args); err... | go | func RunBoundedArgs(min int, max int, run func([]string) error) func(*cobra.Command, []string) {
return func(cmd *cobra.Command, args []string) {
if len(args) < min || len(args) > max {
fmt.Printf("expected %d to %d arguments, got %d\n\n", min, max, len(args))
cmd.Usage()
} else {
if err := run(args); err... | [
"func",
"RunBoundedArgs",
"(",
"min",
"int",
",",
"max",
"int",
",",
"run",
"func",
"(",
"[",
"]",
"string",
")",
"error",
")",
"func",
"(",
"*",
"cobra",
".",
"Command",
",",
"[",
"]",
"string",
")",
"{",
"return",
"func",
"(",
"cmd",
"*",
"cobr... | // RunBoundedArgs wraps a function in a function
// that checks its argument count is within a range. | [
"RunBoundedArgs",
"wraps",
"a",
"function",
"in",
"a",
"function",
"that",
"checks",
"its",
"argument",
"count",
"is",
"within",
"a",
"range",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/cobra.go#L31-L42 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/cobra.go | Run | func Run(run func(args []string) error) func(*cobra.Command, []string) {
return func(_ *cobra.Command, args []string) {
if err := run(args); err != nil {
ErrorAndExit(err.Error())
}
}
} | go | func Run(run func(args []string) error) func(*cobra.Command, []string) {
return func(_ *cobra.Command, args []string) {
if err := run(args); err != nil {
ErrorAndExit(err.Error())
}
}
} | [
"func",
"Run",
"(",
"run",
"func",
"(",
"args",
"[",
"]",
"string",
")",
"error",
")",
"func",
"(",
"*",
"cobra",
".",
"Command",
",",
"[",
"]",
"string",
")",
"{",
"return",
"func",
"(",
"_",
"*",
"cobra",
".",
"Command",
",",
"args",
"[",
"]"... | // Run makes a new cobra run function that wraps the given function. | [
"Run",
"makes",
"a",
"new",
"cobra",
"run",
"function",
"that",
"wraps",
"the",
"given",
"function",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/cobra.go#L45-L51 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/cobra.go | ErrorAndExit | func ErrorAndExit(format string, args ...interface{}) {
if errString := strings.TrimSpace(fmt.Sprintf(format, args...)); errString != "" {
fmt.Fprintf(os.Stderr, "%s\n", errString)
}
os.Exit(1)
} | go | func ErrorAndExit(format string, args ...interface{}) {
if errString := strings.TrimSpace(fmt.Sprintf(format, args...)); errString != "" {
fmt.Fprintf(os.Stderr, "%s\n", errString)
}
os.Exit(1)
} | [
"func",
"ErrorAndExit",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"if",
"errString",
":=",
"strings",
".",
"TrimSpace",
"(",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"args",
"...",
")",
")",
";",
"errString",
"!=",... | // ErrorAndExit errors with the given format and args, and then exits. | [
"ErrorAndExit",
"errors",
"with",
"the",
"given",
"format",
"and",
"args",
"and",
"then",
"exits",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/cobra.go#L54-L59 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/cobra.go | ParseCommit | func ParseCommit(arg string) (*pfs.Commit, error) {
parts := strings.SplitN(arg, "@", 2)
if parts[0] == "" {
return nil, fmt.Errorf("invalid format \"%s\": repo cannot be empty", arg)
}
commit := &pfs.Commit{
Repo: &pfs.Repo{
Name: parts[0],
},
ID: "",
}
if len(parts) == 2 {
commit.ID = parts[1]
}
... | go | func ParseCommit(arg string) (*pfs.Commit, error) {
parts := strings.SplitN(arg, "@", 2)
if parts[0] == "" {
return nil, fmt.Errorf("invalid format \"%s\": repo cannot be empty", arg)
}
commit := &pfs.Commit{
Repo: &pfs.Repo{
Name: parts[0],
},
ID: "",
}
if len(parts) == 2 {
commit.ID = parts[1]
}
... | [
"func",
"ParseCommit",
"(",
"arg",
"string",
")",
"(",
"*",
"pfs",
".",
"Commit",
",",
"error",
")",
"{",
"parts",
":=",
"strings",
".",
"SplitN",
"(",
"arg",
",",
"\"@\"",
",",
"2",
")",
"\n",
"if",
"parts",
"[",
"0",
"]",
"==",
"\"\"",
"{",
"... | // ParseCommit takes an argument of the form "repo[@branch-or-commit]" and
// returns the corresponding *pfs.Commit. | [
"ParseCommit",
"takes",
"an",
"argument",
"of",
"the",
"form",
"repo",
"["
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/cobra.go#L63-L78 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/cobra.go | ParseBranch | func ParseBranch(arg string) (*pfs.Branch, error) {
commit, err := ParseCommit(arg)
if err != nil {
return nil, err
}
return &pfs.Branch{Repo: commit.Repo, Name: commit.ID}, nil
} | go | func ParseBranch(arg string) (*pfs.Branch, error) {
commit, err := ParseCommit(arg)
if err != nil {
return nil, err
}
return &pfs.Branch{Repo: commit.Repo, Name: commit.ID}, nil
} | [
"func",
"ParseBranch",
"(",
"arg",
"string",
")",
"(",
"*",
"pfs",
".",
"Branch",
",",
"error",
")",
"{",
"commit",
",",
"err",
":=",
"ParseCommit",
"(",
"arg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n... | // ParseBranch takes an argument of the form "repo[@branch]" and
// returns the corresponding *pfs.Branch. This uses ParseCommit under the hood
// because a branch name is usually interchangeable with a commit-id. | [
"ParseBranch",
"takes",
"an",
"argument",
"of",
"the",
"form",
"repo",
"["
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/cobra.go#L97-L103 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/cobra.go | ParseFile | func ParseFile(arg string) (*pfs.File, error) {
repoAndRest := strings.SplitN(arg, "@", 2)
if repoAndRest[0] == "" {
return nil, fmt.Errorf("invalid format \"%s\": repo cannot be empty", arg)
}
file := &pfs.File{
Commit: &pfs.Commit{
Repo: &pfs.Repo{
Name: repoAndRest[0],
},
ID: "",
},
Path: ""... | go | func ParseFile(arg string) (*pfs.File, error) {
repoAndRest := strings.SplitN(arg, "@", 2)
if repoAndRest[0] == "" {
return nil, fmt.Errorf("invalid format \"%s\": repo cannot be empty", arg)
}
file := &pfs.File{
Commit: &pfs.Commit{
Repo: &pfs.Repo{
Name: repoAndRest[0],
},
ID: "",
},
Path: ""... | [
"func",
"ParseFile",
"(",
"arg",
"string",
")",
"(",
"*",
"pfs",
".",
"File",
",",
"error",
")",
"{",
"repoAndRest",
":=",
"strings",
".",
"SplitN",
"(",
"arg",
",",
"\"@\"",
",",
"2",
")",
"\n",
"if",
"repoAndRest",
"[",
"0",
"]",
"==",
"\"\"",
... | // ParseFile takes an argument of the form "repo[@branch-or-commit[:path]]", and
// returns the corresponding *pfs.File. | [
"ParseFile",
"takes",
"an",
"argument",
"of",
"the",
"form",
"repo",
"["
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/cobra.go#L121-L146 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/cobra.go | Set | func (r *RepeatedStringArg) Set(s string) error {
*r = append(*r, s)
return nil
} | go | func (r *RepeatedStringArg) Set(s string) error {
*r = append(*r, s)
return nil
} | [
"func",
"(",
"r",
"*",
"RepeatedStringArg",
")",
"Set",
"(",
"s",
"string",
")",
"error",
"{",
"*",
"r",
"=",
"append",
"(",
"*",
"r",
",",
"s",
")",
"\n",
"return",
"nil",
"\n",
"}"
] | // Set adds a string to r | [
"Set",
"adds",
"a",
"string",
"to",
"r"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/cobra.go#L177-L180 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/cobra.go | SetDocsUsage | func SetDocsUsage(command *cobra.Command) {
command.SetHelpTemplate(`{{or .Long .Short}}
{{.UsageString}}
`)
command.SetUsageFunc(func(cmd *cobra.Command) error {
rootCmd := cmd.Root()
// Walk the command tree, finding commands with the documented word
var associated []*cobra.Command
var walk func(*cobra.C... | go | func SetDocsUsage(command *cobra.Command) {
command.SetHelpTemplate(`{{or .Long .Short}}
{{.UsageString}}
`)
command.SetUsageFunc(func(cmd *cobra.Command) error {
rootCmd := cmd.Root()
// Walk the command tree, finding commands with the documented word
var associated []*cobra.Command
var walk func(*cobra.C... | [
"func",
"SetDocsUsage",
"(",
"command",
"*",
"cobra",
".",
"Command",
")",
"{",
"command",
".",
"SetHelpTemplate",
"(",
"`{{or .Long .Short}}{{.UsageString}}`",
")",
"\n",
"command",
".",
"SetUsageFunc",
"(",
"func",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
"... | // SetDocsUsage sets the usage string for a docs-style command. Docs commands
// have no functionality except to output some docs and related commands, and
// should not specify a 'Run' attribute. | [
"SetDocsUsage",
"sets",
"the",
"usage",
"string",
"for",
"a",
"docs",
"-",
"style",
"command",
".",
"Docs",
"commands",
"have",
"no",
"functionality",
"except",
"to",
"output",
"some",
"docs",
"and",
"related",
"commands",
"and",
"should",
"not",
"specify",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/cobra.go#L275-L323 | test |
pachyderm/pachyderm | src/server/pps/server/master.go | makeCronCommits | func (a *apiServer) makeCronCommits(pachClient *client.APIClient, in *pps.Input) error {
schedule, err := cron.ParseStandard(in.Cron.Spec)
if err != nil {
return err // Shouldn't happen, as the input is validated in CreatePipeline
}
// make sure there isn't an unfinished commit on the branch
commitInfo, err := p... | go | func (a *apiServer) makeCronCommits(pachClient *client.APIClient, in *pps.Input) error {
schedule, err := cron.ParseStandard(in.Cron.Spec)
if err != nil {
return err // Shouldn't happen, as the input is validated in CreatePipeline
}
// make sure there isn't an unfinished commit on the branch
commitInfo, err := p... | [
"func",
"(",
"a",
"*",
"apiServer",
")",
"makeCronCommits",
"(",
"pachClient",
"*",
"client",
".",
"APIClient",
",",
"in",
"*",
"pps",
".",
"Input",
")",
"error",
"{",
"schedule",
",",
"err",
":=",
"cron",
".",
"ParseStandard",
"(",
"in",
".",
"Cron",
... | // makeCronCommits makes commits to a single cron input's repo. It's
// a helper function called by monitorPipeline. | [
"makeCronCommits",
"makes",
"commits",
"to",
"a",
"single",
"cron",
"input",
"s",
"repo",
".",
"It",
"s",
"a",
"helper",
"function",
"called",
"by",
"monitorPipeline",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/server/master.go#L561-L633 | test |
pachyderm/pachyderm | src/server/pkg/obj/tracing.go | Writer | func (o *tracingObjClient) Writer(ctx context.Context, name string) (io.WriteCloser, error) {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Writer", "name", name)
if span != nil {
defer span.Finish()
}
return o.Client.Writer(ctx, name)
} | go | func (o *tracingObjClient) Writer(ctx context.Context, name string) (io.WriteCloser, error) {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Writer", "name", name)
if span != nil {
defer span.Finish()
}
return o.Client.Writer(ctx, name)
} | [
"func",
"(",
"o",
"*",
"tracingObjClient",
")",
"Writer",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
")",
"(",
"io",
".",
"WriteCloser",
",",
"error",
")",
"{",
"span",
",",
"ctx",
":=",
"tracing",
".",
"AddSpanToAnyExisting",
"(",
"... | // Writer implements the corresponding method in the Client interface | [
"Writer",
"implements",
"the",
"corresponding",
"method",
"in",
"the",
"Client",
"interface"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/tracing.go#L23-L29 | test |
pachyderm/pachyderm | src/server/pkg/obj/tracing.go | Reader | func (o *tracingObjClient) Reader(ctx context.Context, name string, offset uint64, size uint64) (io.ReadCloser, error) {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Reader",
"name", name,
"offset", fmt.Sprintf("%d", offset),
"size", fmt.Sprintf("%d", size))
defer tracing.FinishAnySpan(span)
ret... | go | func (o *tracingObjClient) Reader(ctx context.Context, name string, offset uint64, size uint64) (io.ReadCloser, error) {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Reader",
"name", name,
"offset", fmt.Sprintf("%d", offset),
"size", fmt.Sprintf("%d", size))
defer tracing.FinishAnySpan(span)
ret... | [
"func",
"(",
"o",
"*",
"tracingObjClient",
")",
"Reader",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
",",
"offset",
"uint64",
",",
"size",
"uint64",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
"{",
"span",
",",
"ctx",
":=... | // Reader implements the corresponding method in the Client interface | [
"Reader",
"implements",
"the",
"corresponding",
"method",
"in",
"the",
"Client",
"interface"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/tracing.go#L32-L39 | test |
pachyderm/pachyderm | src/server/pkg/obj/tracing.go | Delete | func (o *tracingObjClient) Delete(ctx context.Context, name string) error {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Delete",
"name", name)
defer tracing.FinishAnySpan(span)
return o.Client.Delete(ctx, name)
} | go | func (o *tracingObjClient) Delete(ctx context.Context, name string) error {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Delete",
"name", name)
defer tracing.FinishAnySpan(span)
return o.Client.Delete(ctx, name)
} | [
"func",
"(",
"o",
"*",
"tracingObjClient",
")",
"Delete",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
")",
"error",
"{",
"span",
",",
"ctx",
":=",
"tracing",
".",
"AddSpanToAnyExisting",
"(",
"ctx",
",",
"o",
".",
"provider",
"+",
"\"... | // Delete implements the corresponding method in the Client interface | [
"Delete",
"implements",
"the",
"corresponding",
"method",
"in",
"the",
"Client",
"interface"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/tracing.go#L42-L47 | test |
pachyderm/pachyderm | src/server/pkg/obj/tracing.go | Walk | func (o *tracingObjClient) Walk(ctx context.Context, prefix string, fn func(name string) error) error {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Walk",
"prefix", prefix)
defer tracing.FinishAnySpan(span)
return o.Client.Walk(ctx, prefix, fn)
} | go | func (o *tracingObjClient) Walk(ctx context.Context, prefix string, fn func(name string) error) error {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Walk",
"prefix", prefix)
defer tracing.FinishAnySpan(span)
return o.Client.Walk(ctx, prefix, fn)
} | [
"func",
"(",
"o",
"*",
"tracingObjClient",
")",
"Walk",
"(",
"ctx",
"context",
".",
"Context",
",",
"prefix",
"string",
",",
"fn",
"func",
"(",
"name",
"string",
")",
"error",
")",
"error",
"{",
"span",
",",
"ctx",
":=",
"tracing",
".",
"AddSpanToAnyEx... | // Walk implements the corresponding method in the Client interface | [
"Walk",
"implements",
"the",
"corresponding",
"method",
"in",
"the",
"Client",
"interface"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/tracing.go#L50-L55 | test |
pachyderm/pachyderm | src/server/pkg/obj/tracing.go | Exists | func (o *tracingObjClient) Exists(ctx context.Context, name string) bool {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Exists",
"name", name)
defer tracing.FinishAnySpan(span)
return o.Client.Exists(ctx, name)
} | go | func (o *tracingObjClient) Exists(ctx context.Context, name string) bool {
span, ctx := tracing.AddSpanToAnyExisting(ctx, o.provider+".Exists",
"name", name)
defer tracing.FinishAnySpan(span)
return o.Client.Exists(ctx, name)
} | [
"func",
"(",
"o",
"*",
"tracingObjClient",
")",
"Exists",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
")",
"bool",
"{",
"span",
",",
"ctx",
":=",
"tracing",
".",
"AddSpanToAnyExisting",
"(",
"ctx",
",",
"o",
".",
"provider",
"+",
"\".... | // Exists implements the corresponding method in the Client interface | [
"Exists",
"implements",
"the",
"corresponding",
"method",
"in",
"the",
"Client",
"interface"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/tracing.go#L58-L63 | test |
pachyderm/pachyderm | src/client/pfs/pfs.go | GetBlock | func GetBlock(hash hash.Hash) *Block {
return &Block{
Hash: base64.URLEncoding.EncodeToString(hash.Sum(nil)),
}
} | go | func GetBlock(hash hash.Hash) *Block {
return &Block{
Hash: base64.URLEncoding.EncodeToString(hash.Sum(nil)),
}
} | [
"func",
"GetBlock",
"(",
"hash",
"hash",
".",
"Hash",
")",
"*",
"Block",
"{",
"return",
"&",
"Block",
"{",
"Hash",
":",
"base64",
".",
"URLEncoding",
".",
"EncodeToString",
"(",
"hash",
".",
"Sum",
"(",
"nil",
")",
")",
",",
"}",
"\n",
"}"
] | // GetBlock encodes a hash into a readable format in the form of a Block. | [
"GetBlock",
"encodes",
"a",
"hash",
"into",
"a",
"readable",
"format",
"in",
"the",
"form",
"of",
"a",
"Block",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs/pfs.go#L37-L41 | test |
pachyderm/pachyderm | src/server/health/health.go | Health | func (h *healthServer) Health(context.Context, *types.Empty) (*types.Empty, error) {
if !h.ready {
return nil, fmt.Errorf("server not ready")
}
return &types.Empty{}, nil
} | go | func (h *healthServer) Health(context.Context, *types.Empty) (*types.Empty, error) {
if !h.ready {
return nil, fmt.Errorf("server not ready")
}
return &types.Empty{}, nil
} | [
"func",
"(",
"h",
"*",
"healthServer",
")",
"Health",
"(",
"context",
".",
"Context",
",",
"*",
"types",
".",
"Empty",
")",
"(",
"*",
"types",
".",
"Empty",
",",
"error",
")",
"{",
"if",
"!",
"h",
".",
"ready",
"{",
"return",
"nil",
",",
"fmt",
... | // Health implements the Health method for healthServer. | [
"Health",
"implements",
"the",
"Health",
"method",
"for",
"healthServer",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/health/health.go#L27-L32 | test |
pachyderm/pachyderm | src/server/pkg/hashtree/path.go | split | func split(p string) (string, string) {
return clean(path.Dir(p)), base(p)
} | go | func split(p string) (string, string) {
return clean(path.Dir(p)), base(p)
} | [
"func",
"split",
"(",
"p",
"string",
")",
"(",
"string",
",",
"string",
")",
"{",
"return",
"clean",
"(",
"path",
".",
"Dir",
"(",
"p",
")",
")",
",",
"base",
"(",
"p",
")",
"\n",
"}"
] | // split is like path.Split, but uses this library's defaults for canonical
// paths | [
"split",
"is",
"like",
"path",
".",
"Split",
"but",
"uses",
"this",
"library",
"s",
"defaults",
"for",
"canonical",
"paths"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/path.go#L63-L65 | test |
pachyderm/pachyderm | src/server/pkg/hashtree/path.go | ValidatePath | func ValidatePath(path string) error {
path = clean(path)
match, _ := regexp.MatchString("^[ -~]+$", path)
if !match {
return fmt.Errorf("path (%v) invalid: only printable ASCII characters allowed", path)
}
if IsGlob(path) {
return fmt.Errorf("path (%v) invalid: globbing character (%v) not allowed in path", ... | go | func ValidatePath(path string) error {
path = clean(path)
match, _ := regexp.MatchString("^[ -~]+$", path)
if !match {
return fmt.Errorf("path (%v) invalid: only printable ASCII characters allowed", path)
}
if IsGlob(path) {
return fmt.Errorf("path (%v) invalid: globbing character (%v) not allowed in path", ... | [
"func",
"ValidatePath",
"(",
"path",
"string",
")",
"error",
"{",
"path",
"=",
"clean",
"(",
"path",
")",
"\n",
"match",
",",
"_",
":=",
"regexp",
".",
"MatchString",
"(",
"\"^[ -~]+$\"",
",",
"path",
")",
"\n",
"if",
"!",
"match",
"{",
"return",
"fm... | // ValidatePath checks if a file path is legal | [
"ValidatePath",
"checks",
"if",
"a",
"file",
"path",
"is",
"legal"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/path.go#L74-L87 | test |
pachyderm/pachyderm | src/server/worker/worker.go | MatchDatum | func MatchDatum(filter []string, data []*pps.InputFile) bool {
// All paths in request.DataFilters must appear somewhere in the log
// line's inputs, or it's filtered
matchesData := true
dataFilters:
for _, dataFilter := range filter {
for _, datum := range data {
if dataFilter == datum.Path ||
dataFilter ... | go | func MatchDatum(filter []string, data []*pps.InputFile) bool {
// All paths in request.DataFilters must appear somewhere in the log
// line's inputs, or it's filtered
matchesData := true
dataFilters:
for _, dataFilter := range filter {
for _, datum := range data {
if dataFilter == datum.Path ||
dataFilter ... | [
"func",
"MatchDatum",
"(",
"filter",
"[",
"]",
"string",
",",
"data",
"[",
"]",
"*",
"pps",
".",
"InputFile",
")",
"bool",
"{",
"matchesData",
":=",
"true",
"\n",
"dataFilters",
":",
"for",
"_",
",",
"dataFilter",
":=",
"range",
"filter",
"{",
"for",
... | // MatchDatum checks if a datum matches a filter. To match each string in
// filter must correspond match at least 1 datum's Path or Hash. Order of
// filter and data is irrelevant. | [
"MatchDatum",
"checks",
"if",
"a",
"datum",
"matches",
"a",
"filter",
".",
"To",
"match",
"each",
"string",
"in",
"filter",
"must",
"correspond",
"match",
"at",
"least",
"1",
"datum",
"s",
"Path",
"or",
"Hash",
".",
"Order",
"of",
"filter",
"and",
"data"... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/worker/worker.go#L12-L29 | test |
pachyderm/pachyderm | src/server/pkg/cache/server/server.go | NewCacheServer | func NewCacheServer(router shard.Router, shards uint64) CacheServer {
server := &groupCacheServer{
Logger: log.NewLogger("CacheServer"),
router: router,
localShards: make(map[uint64]bool),
shards: shards,
}
groupcache.RegisterPeerPicker(func() groupcache.PeerPicker { return server })
return s... | go | func NewCacheServer(router shard.Router, shards uint64) CacheServer {
server := &groupCacheServer{
Logger: log.NewLogger("CacheServer"),
router: router,
localShards: make(map[uint64]bool),
shards: shards,
}
groupcache.RegisterPeerPicker(func() groupcache.PeerPicker { return server })
return s... | [
"func",
"NewCacheServer",
"(",
"router",
"shard",
".",
"Router",
",",
"shards",
"uint64",
")",
"CacheServer",
"{",
"server",
":=",
"&",
"groupCacheServer",
"{",
"Logger",
":",
"log",
".",
"NewLogger",
"(",
"\"CacheServer\"",
")",
",",
"router",
":",
"router"... | // NewCacheServer creates a new CacheServer. | [
"NewCacheServer",
"creates",
"a",
"new",
"CacheServer",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cache/server/server.go#L26-L35 | test |
pachyderm/pachyderm | src/server/pps/server/api_server.go | authorizePipelineOp | func (a *apiServer) authorizePipelineOp(pachClient *client.APIClient, operation pipelineOperation, input *pps.Input, output string) error {
ctx := pachClient.Ctx()
me, err := pachClient.WhoAmI(ctx, &auth.WhoAmIRequest{})
if auth.IsErrNotActivated(err) {
return nil // Auth isn't activated, skip authorization comple... | go | func (a *apiServer) authorizePipelineOp(pachClient *client.APIClient, operation pipelineOperation, input *pps.Input, output string) error {
ctx := pachClient.Ctx()
me, err := pachClient.WhoAmI(ctx, &auth.WhoAmIRequest{})
if auth.IsErrNotActivated(err) {
return nil // Auth isn't activated, skip authorization comple... | [
"func",
"(",
"a",
"*",
"apiServer",
")",
"authorizePipelineOp",
"(",
"pachClient",
"*",
"client",
".",
"APIClient",
",",
"operation",
"pipelineOperation",
",",
"input",
"*",
"pps",
".",
"Input",
",",
"output",
"string",
")",
"error",
"{",
"ctx",
":=",
"pac... | // authorizePipelineOp checks if the user indicated by 'ctx' is authorized
// to perform 'operation' on the pipeline in 'info' | [
"authorizePipelineOp",
"checks",
"if",
"the",
"user",
"indicated",
"by",
"ctx",
"is",
"authorized",
"to",
"perform",
"operation",
"on",
"the",
"pipeline",
"in",
"info"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/server/api_server.go#L377-L468 | test |
pachyderm/pachyderm | src/server/pps/server/api_server.go | sudo | func (a *apiServer) sudo(pachClient *client.APIClient, f func(*client.APIClient) error) error {
// Get PPS auth token
superUserTokenOnce.Do(func() {
b := backoff.NewExponentialBackOff()
b.MaxElapsedTime = 60 * time.Second
b.MaxInterval = 5 * time.Second
if err := backoff.Retry(func() error {
superUserToken... | go | func (a *apiServer) sudo(pachClient *client.APIClient, f func(*client.APIClient) error) error {
// Get PPS auth token
superUserTokenOnce.Do(func() {
b := backoff.NewExponentialBackOff()
b.MaxElapsedTime = 60 * time.Second
b.MaxInterval = 5 * time.Second
if err := backoff.Retry(func() error {
superUserToken... | [
"func",
"(",
"a",
"*",
"apiServer",
")",
"sudo",
"(",
"pachClient",
"*",
"client",
".",
"APIClient",
",",
"f",
"func",
"(",
"*",
"client",
".",
"APIClient",
")",
"error",
")",
"error",
"{",
"superUserTokenOnce",
".",
"Do",
"(",
"func",
"(",
")",
"{",... | // sudo is a helper function that copies 'pachClient' grants it PPS's superuser
// token, and calls 'f' with the superuser client. This helps isolate PPS's use
// of its superuser token so that it's not widely copied and is unlikely to
// leak authority to parts of the code that aren't supposed to have it.
//
// Note t... | [
"sudo",
"is",
"a",
"helper",
"function",
"that",
"copies",
"pachClient",
"grants",
"it",
"PPS",
"s",
"superuser",
"token",
"and",
"calls",
"f",
"with",
"the",
"superuser",
"client",
".",
"This",
"helps",
"isolate",
"PPS",
"s",
"use",
"of",
"its",
"superuse... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/server/api_server.go#L1588-L1612 | test |
pachyderm/pachyderm | src/server/pps/server/api_server.go | setPipelineDefaults | func setPipelineDefaults(pipelineInfo *pps.PipelineInfo) {
now := time.Now()
if pipelineInfo.Transform.Image == "" {
pipelineInfo.Transform.Image = DefaultUserImage
}
pps.VisitInput(pipelineInfo.Input, func(input *pps.Input) {
if input.Pfs != nil {
if input.Pfs.Branch == "" {
input.Pfs.Branch = "master"
... | go | func setPipelineDefaults(pipelineInfo *pps.PipelineInfo) {
now := time.Now()
if pipelineInfo.Transform.Image == "" {
pipelineInfo.Transform.Image = DefaultUserImage
}
pps.VisitInput(pipelineInfo.Input, func(input *pps.Input) {
if input.Pfs != nil {
if input.Pfs.Branch == "" {
input.Pfs.Branch = "master"
... | [
"func",
"setPipelineDefaults",
"(",
"pipelineInfo",
"*",
"pps",
".",
"PipelineInfo",
")",
"{",
"now",
":=",
"time",
".",
"Now",
"(",
")",
"\n",
"if",
"pipelineInfo",
".",
"Transform",
".",
"Image",
"==",
"\"\"",
"{",
"pipelineInfo",
".",
"Transform",
".",
... | // setPipelineDefaults sets the default values for a pipeline info | [
"setPipelineDefaults",
"sets",
"the",
"default",
"values",
"for",
"a",
"pipeline",
"info"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/server/api_server.go#L1970-L2023 | test |
pachyderm/pachyderm | src/server/pps/server/api_server.go | incrementGCGeneration | func (a *apiServer) incrementGCGeneration(ctx context.Context) error {
resp, err := a.env.GetEtcdClient().Get(ctx, client.GCGenerationKey)
if err != nil {
return err
}
if resp.Count == 0 {
// If the generation number does not exist, create it.
// It's important that the new generation is 1, as the first
//... | go | func (a *apiServer) incrementGCGeneration(ctx context.Context) error {
resp, err := a.env.GetEtcdClient().Get(ctx, client.GCGenerationKey)
if err != nil {
return err
}
if resp.Count == 0 {
// If the generation number does not exist, create it.
// It's important that the new generation is 1, as the first
//... | [
"func",
"(",
"a",
"*",
"apiServer",
")",
"incrementGCGeneration",
"(",
"ctx",
"context",
".",
"Context",
")",
"error",
"{",
"resp",
",",
"err",
":=",
"a",
".",
"env",
".",
"GetEtcdClient",
"(",
")",
".",
"Get",
"(",
"ctx",
",",
"client",
".",
"GCGene... | // incrementGCGeneration increments the GC generation number in etcd | [
"incrementGCGeneration",
"increments",
"the",
"GC",
"generation",
"number",
"in",
"etcd"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/server/api_server.go#L2692-L2716 | test |
pachyderm/pachyderm | src/server/debug/server/server.go | NewDebugServer | func NewDebugServer(name string, etcdClient *etcd.Client, etcdPrefix string, workerGrpcPort uint16) debug.DebugServer {
return &debugServer{
name: name,
etcdClient: etcdClient,
etcdPrefix: etcdPrefix,
workerGrpcPort: workerGrpcPort,
}
} | go | func NewDebugServer(name string, etcdClient *etcd.Client, etcdPrefix string, workerGrpcPort uint16) debug.DebugServer {
return &debugServer{
name: name,
etcdClient: etcdClient,
etcdPrefix: etcdPrefix,
workerGrpcPort: workerGrpcPort,
}
} | [
"func",
"NewDebugServer",
"(",
"name",
"string",
",",
"etcdClient",
"*",
"etcd",
".",
"Client",
",",
"etcdPrefix",
"string",
",",
"workerGrpcPort",
"uint16",
")",
"debug",
".",
"DebugServer",
"{",
"return",
"&",
"debugServer",
"{",
"name",
":",
"name",
",",
... | // NewDebugServer creates a new server that serves the debug api over GRPC | [
"NewDebugServer",
"creates",
"a",
"new",
"server",
"that",
"serves",
"the",
"debug",
"api",
"over",
"GRPC"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/debug/server/server.go#L22-L29 | test |
pachyderm/pachyderm | src/client/health.go | Health | func (c APIClient) Health() error {
_, err := c.healthClient.Health(c.Ctx(), &types.Empty{})
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) Health() error {
_, err := c.healthClient.Health(c.Ctx(), &types.Empty{})
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"Health",
"(",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"healthClient",
".",
"Health",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"types",
".",
"Empty",
"{",
"}",
")",
"\n",
"return",
"grpcutil",
".... | // Health health checks pachd, it returns an error if pachd isn't healthy. | [
"Health",
"health",
"checks",
"pachd",
"it",
"returns",
"an",
"error",
"if",
"pachd",
"isn",
"t",
"healthy",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/health.go#L10-L13 | test |
pachyderm/pachyderm | src/server/pfs/server/obj_block_api_server.go | newObjBlockAPIServer | func newObjBlockAPIServer(dir string, cacheBytes int64, etcdAddress string, objClient obj.Client, test bool) (*objBlockAPIServer, error) {
// defensive measure to make sure storage is working and error early if it's not
// this is where we'll find out if the credentials have been misconfigured
if err := obj.TestStor... | go | func newObjBlockAPIServer(dir string, cacheBytes int64, etcdAddress string, objClient obj.Client, test bool) (*objBlockAPIServer, error) {
// defensive measure to make sure storage is working and error early if it's not
// this is where we'll find out if the credentials have been misconfigured
if err := obj.TestStor... | [
"func",
"newObjBlockAPIServer",
"(",
"dir",
"string",
",",
"cacheBytes",
"int64",
",",
"etcdAddress",
"string",
",",
"objClient",
"obj",
".",
"Client",
",",
"test",
"bool",
")",
"(",
"*",
"objBlockAPIServer",
",",
"error",
")",
"{",
"if",
"err",
":=",
"obj... | // In test mode, we use unique names for cache groups, since we might want
// to run multiple block servers locally, which would conflict if groups
// had the same name. We also do not report stats to prometheus | [
"In",
"test",
"mode",
"we",
"use",
"unique",
"names",
"for",
"cache",
"groups",
"since",
"we",
"might",
"want",
"to",
"run",
"multiple",
"block",
"servers",
"locally",
"which",
"would",
"conflict",
"if",
"groups",
"had",
"the",
"same",
"name",
".",
"We",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/server/obj_block_api_server.go#L69-L110 | test |
pachyderm/pachyderm | src/server/pfs/server/obj_block_api_server.go | watchGC | func (s *objBlockAPIServer) watchGC(etcdAddress string) {
b := backoff.NewInfiniteBackOff()
backoff.RetryNotify(func() error {
etcdClient, err := etcd.New(etcd.Config{
Endpoints: []string{etcdAddress},
DialOptions: client.DefaultDialOptions(),
})
if err != nil {
return fmt.Errorf("error instantiating... | go | func (s *objBlockAPIServer) watchGC(etcdAddress string) {
b := backoff.NewInfiniteBackOff()
backoff.RetryNotify(func() error {
etcdClient, err := etcd.New(etcd.Config{
Endpoints: []string{etcdAddress},
DialOptions: client.DefaultDialOptions(),
})
if err != nil {
return fmt.Errorf("error instantiating... | [
"func",
"(",
"s",
"*",
"objBlockAPIServer",
")",
"watchGC",
"(",
"etcdAddress",
"string",
")",
"{",
"b",
":=",
"backoff",
".",
"NewInfiniteBackOff",
"(",
")",
"\n",
"backoff",
".",
"RetryNotify",
"(",
"func",
"(",
")",
"error",
"{",
"etcdClient",
",",
"e... | // watchGC watches for GC runs and invalidate all cache when GC happens. | [
"watchGC",
"watches",
"for",
"GC",
"runs",
"and",
"invalidate",
"all",
"cache",
"when",
"GC",
"happens",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/server/obj_block_api_server.go#L113-L148 | test |
pachyderm/pachyderm | src/server/pfs/server/obj_block_api_server.go | splitKey | func (s *objBlockAPIServer) splitKey(key string) string {
gen := s.getGeneration()
if len(key) < prefixLength {
return fmt.Sprintf("%s.%d", key, gen)
}
return fmt.Sprintf("%s.%s.%d", key[:prefixLength], key[prefixLength:], gen)
} | go | func (s *objBlockAPIServer) splitKey(key string) string {
gen := s.getGeneration()
if len(key) < prefixLength {
return fmt.Sprintf("%s.%d", key, gen)
}
return fmt.Sprintf("%s.%s.%d", key[:prefixLength], key[prefixLength:], gen)
} | [
"func",
"(",
"s",
"*",
"objBlockAPIServer",
")",
"splitKey",
"(",
"key",
"string",
")",
"string",
"{",
"gen",
":=",
"s",
".",
"getGeneration",
"(",
")",
"\n",
"if",
"len",
"(",
"key",
")",
"<",
"prefixLength",
"{",
"return",
"fmt",
".",
"Sprintf",
"(... | // splitKey splits a key into the format we want, and also postpends
// the generation number | [
"splitKey",
"splits",
"a",
"key",
"into",
"the",
"format",
"we",
"want",
"and",
"also",
"postpends",
"the",
"generation",
"number"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/server/obj_block_api_server.go#L1101-L1107 | test |
pachyderm/pachyderm | src/server/pkg/tabwriter/tabwriter.go | NewWriter | func NewWriter(w io.Writer, header string) *Writer {
if header[len(header)-1] != '\n' {
panic("header must end in a new line")
}
tabwriter := ansiterm.NewTabWriter(w, 0, 1, 1, ' ', 0)
tabwriter.Write([]byte(header))
return &Writer{
w: tabwriter,
lines: 1, // 1 because we just printed the header
heade... | go | func NewWriter(w io.Writer, header string) *Writer {
if header[len(header)-1] != '\n' {
panic("header must end in a new line")
}
tabwriter := ansiterm.NewTabWriter(w, 0, 1, 1, ' ', 0)
tabwriter.Write([]byte(header))
return &Writer{
w: tabwriter,
lines: 1, // 1 because we just printed the header
heade... | [
"func",
"NewWriter",
"(",
"w",
"io",
".",
"Writer",
",",
"header",
"string",
")",
"*",
"Writer",
"{",
"if",
"header",
"[",
"len",
"(",
"header",
")",
"-",
"1",
"]",
"!=",
"'\\n'",
"{",
"panic",
"(",
"\"header must end in a new line\"",
")",
"\n",
"}",
... | // NewWriter returns a new Writer, it will flush when
// it gets termHeight many lines, including the header line.
// The header line will be reprinted termHeight many lines have been written.
// NewStreamingWriter will panic if it's given a header that doesn't end in \n. | [
"NewWriter",
"returns",
"a",
"new",
"Writer",
"it",
"will",
"flush",
"when",
"it",
"gets",
"termHeight",
"many",
"lines",
"including",
"the",
"header",
"line",
".",
"The",
"header",
"line",
"will",
"be",
"reprinted",
"termHeight",
"many",
"lines",
"have",
"b... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/tabwriter/tabwriter.go#L28-L39 | test |
pachyderm/pachyderm | src/server/pkg/tabwriter/tabwriter.go | Write | func (w *Writer) Write(buf []byte) (int, error) {
if w.lines >= termHeight {
if err := w.Flush(); err != nil {
return 0, err
}
if _, err := w.w.Write(w.header); err != nil {
return 0, err
}
w.lines++
}
w.lines += bytes.Count(buf, []byte{'\n'})
return w.w.Write(buf)
} | go | func (w *Writer) Write(buf []byte) (int, error) {
if w.lines >= termHeight {
if err := w.Flush(); err != nil {
return 0, err
}
if _, err := w.w.Write(w.header); err != nil {
return 0, err
}
w.lines++
}
w.lines += bytes.Count(buf, []byte{'\n'})
return w.w.Write(buf)
} | [
"func",
"(",
"w",
"*",
"Writer",
")",
"Write",
"(",
"buf",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"error",
")",
"{",
"if",
"w",
".",
"lines",
">=",
"termHeight",
"{",
"if",
"err",
":=",
"w",
".",
"Flush",
"(",
")",
";",
"err",
"!=",
"nil",
... | // Write writes a line to the tabwriter. | [
"Write",
"writes",
"a",
"line",
"to",
"the",
"tabwriter",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/tabwriter/tabwriter.go#L42-L54 | test |
pachyderm/pachyderm | src/server/pfs/pretty/pretty.go | PrintRepoHeader | func PrintRepoHeader(w io.Writer, printAuth bool) {
if printAuth {
fmt.Fprint(w, RepoAuthHeader)
return
}
fmt.Fprint(w, RepoHeader)
} | go | func PrintRepoHeader(w io.Writer, printAuth bool) {
if printAuth {
fmt.Fprint(w, RepoAuthHeader)
return
}
fmt.Fprint(w, RepoHeader)
} | [
"func",
"PrintRepoHeader",
"(",
"w",
"io",
".",
"Writer",
",",
"printAuth",
"bool",
")",
"{",
"if",
"printAuth",
"{",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"RepoAuthHeader",
")",
"\n",
"return",
"\n",
"}",
"\n",
"fmt",
".",
"Fprint",
"(",
"w",
",",
... | // PrintRepoHeader prints a repo header. | [
"PrintRepoHeader",
"prints",
"a",
"repo",
"header",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/pretty/pretty.go#L28-L34 | test |
pachyderm/pachyderm | src/server/pfs/pretty/pretty.go | PrintRepoInfo | func PrintRepoInfo(w io.Writer, repoInfo *pfs.RepoInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", repoInfo.Repo.Name)
if fullTimestamps {
fmt.Fprintf(w, "%s\t", repoInfo.Created.String())
} else {
fmt.Fprintf(w, "%s\t", pretty.Ago(repoInfo.Created))
}
fmt.Fprintf(w, "%s\t", units.BytesSize(float64(repoInfo... | go | func PrintRepoInfo(w io.Writer, repoInfo *pfs.RepoInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", repoInfo.Repo.Name)
if fullTimestamps {
fmt.Fprintf(w, "%s\t", repoInfo.Created.String())
} else {
fmt.Fprintf(w, "%s\t", pretty.Ago(repoInfo.Created))
}
fmt.Fprintf(w, "%s\t", units.BytesSize(float64(repoInfo... | [
"func",
"PrintRepoInfo",
"(",
"w",
"io",
".",
"Writer",
",",
"repoInfo",
"*",
"pfs",
".",
"RepoInfo",
",",
"fullTimestamps",
"bool",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"%s\\t\"",
",",
"\\t",
")",
"\n",
"repoInfo",
".",
"Repo",
".",
"Na... | // PrintRepoInfo pretty-prints repo info. | [
"PrintRepoInfo",
"pretty",
"-",
"prints",
"repo",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/pretty/pretty.go#L37-L49 | test |
pachyderm/pachyderm | src/server/pfs/pretty/pretty.go | PrintDetailedRepoInfo | func PrintDetailedRepoInfo(repoInfo *PrintableRepoInfo) error {
template, err := template.New("RepoInfo").Funcs(funcMap).Parse(
`Name: {{.Repo.Name}}{{if .Description}}
Description: {{.Description}}{{end}}{{if .FullTimestamps}}
Created: {{.Created}}{{else}}
Created: {{prettyAgo .Created}}{{end}}
Size of HEAD on mast... | go | func PrintDetailedRepoInfo(repoInfo *PrintableRepoInfo) error {
template, err := template.New("RepoInfo").Funcs(funcMap).Parse(
`Name: {{.Repo.Name}}{{if .Description}}
Description: {{.Description}}{{end}}{{if .FullTimestamps}}
Created: {{.Created}}{{else}}
Created: {{prettyAgo .Created}}{{end}}
Size of HEAD on mast... | [
"func",
"PrintDetailedRepoInfo",
"(",
"repoInfo",
"*",
"PrintableRepoInfo",
")",
"error",
"{",
"template",
",",
"err",
":=",
"template",
".",
"New",
"(",
"\"RepoInfo\"",
")",
".",
"Funcs",
"(",
"funcMap",
")",
".",
"Parse",
"(",
"`Name: {{.Repo.Name}}{{if .Descr... | // PrintDetailedRepoInfo pretty-prints detailed repo info. | [
"PrintDetailedRepoInfo",
"pretty",
"-",
"prints",
"detailed",
"repo",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/pretty/pretty.go#L66-L83 | test |
pachyderm/pachyderm | src/server/pfs/pretty/pretty.go | PrintBranch | func PrintBranch(w io.Writer, branchInfo *pfs.BranchInfo) {
fmt.Fprintf(w, "%s\t", branchInfo.Branch.Name)
if branchInfo.Head != nil {
fmt.Fprintf(w, "%s\t\n", branchInfo.Head.ID)
} else {
fmt.Fprintf(w, "-\t\n")
}
} | go | func PrintBranch(w io.Writer, branchInfo *pfs.BranchInfo) {
fmt.Fprintf(w, "%s\t", branchInfo.Branch.Name)
if branchInfo.Head != nil {
fmt.Fprintf(w, "%s\t\n", branchInfo.Head.ID)
} else {
fmt.Fprintf(w, "-\t\n")
}
} | [
"func",
"PrintBranch",
"(",
"w",
"io",
".",
"Writer",
",",
"branchInfo",
"*",
"pfs",
".",
"BranchInfo",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"%s\\t\"",
",",
"\\t",
")",
"\n",
"branchInfo",
".",
"Branch",
".",
"Name",
"\n",
"}"
] | // PrintBranch pretty-prints a Branch. | [
"PrintBranch",
"pretty",
"-",
"prints",
"a",
"Branch",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/pretty/pretty.go#L91-L98 | test |
pachyderm/pachyderm | src/server/pfs/pretty/pretty.go | PrintCommitInfo | func PrintCommitInfo(w io.Writer, commitInfo *pfs.CommitInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", commitInfo.Commit.Repo.Name)
fmt.Fprintf(w, "%s\t", commitInfo.Branch.Name)
fmt.Fprintf(w, "%s\t", commitInfo.Commit.ID)
if commitInfo.ParentCommit != nil {
fmt.Fprintf(w, "%s\t", commitInfo.ParentCommit.ID... | go | func PrintCommitInfo(w io.Writer, commitInfo *pfs.CommitInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", commitInfo.Commit.Repo.Name)
fmt.Fprintf(w, "%s\t", commitInfo.Branch.Name)
fmt.Fprintf(w, "%s\t", commitInfo.Commit.ID)
if commitInfo.ParentCommit != nil {
fmt.Fprintf(w, "%s\t", commitInfo.ParentCommit.ID... | [
"func",
"PrintCommitInfo",
"(",
"w",
"io",
".",
"Writer",
",",
"commitInfo",
"*",
"pfs",
".",
"CommitInfo",
",",
"fullTimestamps",
"bool",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"%s\\t\"",
",",
"\\t",
")",
"\n",
"commitInfo",
".",
"Commit",
... | // PrintCommitInfo pretty-prints commit info. | [
"PrintCommitInfo",
"pretty",
"-",
"prints",
"commit",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/pretty/pretty.go#L106-L128 | test |
pachyderm/pachyderm | src/server/pfs/pretty/pretty.go | PrintDetailedCommitInfo | func PrintDetailedCommitInfo(commitInfo *PrintableCommitInfo) error {
template, err := template.New("CommitInfo").Funcs(funcMap).Parse(
`Commit: {{.Commit.Repo.Name}}@{{.Commit.ID}}{{if .Branch}}
Original Branch: {{.Branch.Name}}{{end}}{{if .Description}}
Description: {{.Description}}{{end}}{{if .ParentCommit}}
Pare... | go | func PrintDetailedCommitInfo(commitInfo *PrintableCommitInfo) error {
template, err := template.New("CommitInfo").Funcs(funcMap).Parse(
`Commit: {{.Commit.Repo.Name}}@{{.Commit.ID}}{{if .Branch}}
Original Branch: {{.Branch.Name}}{{end}}{{if .Description}}
Description: {{.Description}}{{end}}{{if .ParentCommit}}
Pare... | [
"func",
"PrintDetailedCommitInfo",
"(",
"commitInfo",
"*",
"PrintableCommitInfo",
")",
"error",
"{",
"template",
",",
"err",
":=",
"template",
".",
"New",
"(",
"\"CommitInfo\"",
")",
".",
"Funcs",
"(",
"funcMap",
")",
".",
"Parse",
"(",
"`Commit: {{.Commit.Repo.... | // PrintDetailedCommitInfo pretty-prints detailed commit info. | [
"PrintDetailedCommitInfo",
"pretty",
"-",
"prints",
"detailed",
"commit",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/pretty/pretty.go#L145-L166 | test |
pachyderm/pachyderm | src/server/pfs/pretty/pretty.go | PrintFileInfo | func PrintFileInfo(w io.Writer, fileInfo *pfs.FileInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", fileInfo.File.Commit.ID)
fmt.Fprintf(w, "%s\t", fileInfo.File.Path)
if fileInfo.FileType == pfs.FileType_FILE {
fmt.Fprint(w, "file\t")
} else {
fmt.Fprint(w, "dir\t")
}
if fileInfo.Committed == nil {
fmt.F... | go | func PrintFileInfo(w io.Writer, fileInfo *pfs.FileInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", fileInfo.File.Commit.ID)
fmt.Fprintf(w, "%s\t", fileInfo.File.Path)
if fileInfo.FileType == pfs.FileType_FILE {
fmt.Fprint(w, "file\t")
} else {
fmt.Fprint(w, "dir\t")
}
if fileInfo.Committed == nil {
fmt.F... | [
"func",
"PrintFileInfo",
"(",
"w",
"io",
".",
"Writer",
",",
"fileInfo",
"*",
"pfs",
".",
"FileInfo",
",",
"fullTimestamps",
"bool",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"%s\\t\"",
",",
"\\t",
")",
"\n",
"fileInfo",
".",
"File",
".",
"Co... | // PrintFileInfo pretty-prints file info.
// If recurse is false and directory size is 0, display "-" instead
// If fast is true and file size is 0, display "-" instead | [
"PrintFileInfo",
"pretty",
"-",
"prints",
"file",
"info",
".",
"If",
"recurse",
"is",
"false",
"and",
"directory",
"size",
"is",
"0",
"display",
"-",
"instead",
"If",
"fast",
"is",
"true",
"and",
"file",
"size",
"is",
"0",
"display",
"-",
"instead"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/pretty/pretty.go#L176-L192 | test |
pachyderm/pachyderm | src/server/pfs/pretty/pretty.go | PrintDetailedFileInfo | func PrintDetailedFileInfo(fileInfo *pfs.FileInfo) error {
template, err := template.New("FileInfo").Funcs(funcMap).Parse(
`Path: {{.File.Path}}
Type: {{fileType .FileType}}
Size: {{prettySize .SizeBytes}}
Children: {{range .Children}} {{.}} {{end}}
`)
if err != nil {
return err
}
return template.Execute(os.Std... | go | func PrintDetailedFileInfo(fileInfo *pfs.FileInfo) error {
template, err := template.New("FileInfo").Funcs(funcMap).Parse(
`Path: {{.File.Path}}
Type: {{fileType .FileType}}
Size: {{prettySize .SizeBytes}}
Children: {{range .Children}} {{.}} {{end}}
`)
if err != nil {
return err
}
return template.Execute(os.Std... | [
"func",
"PrintDetailedFileInfo",
"(",
"fileInfo",
"*",
"pfs",
".",
"FileInfo",
")",
"error",
"{",
"template",
",",
"err",
":=",
"template",
".",
"New",
"(",
"\"FileInfo\"",
")",
".",
"Funcs",
"(",
"funcMap",
")",
".",
"Parse",
"(",
"`Path: {{.File.Path}}Type... | // PrintDetailedFileInfo pretty-prints detailed file info. | [
"PrintDetailedFileInfo",
"pretty",
"-",
"prints",
"detailed",
"file",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/pretty/pretty.go#L195-L206 | test |
pachyderm/pachyderm | src/server/pkg/ancestry/ancestry.go | Add | func Add(s string, ancestors int) string {
return fmt.Sprintf("%s~%d", s, ancestors)
} | go | func Add(s string, ancestors int) string {
return fmt.Sprintf("%s~%d", s, ancestors)
} | [
"func",
"Add",
"(",
"s",
"string",
",",
"ancestors",
"int",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"%s~%d\"",
",",
"s",
",",
"ancestors",
")",
"\n",
"}"
] | // Add adds an ancestry reference to the given string. | [
"Add",
"adds",
"an",
"ancestry",
"reference",
"to",
"the",
"given",
"string",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/ancestry/ancestry.go#L54-L56 | test |
pachyderm/pachyderm | src/server/pkg/backoff/retry.go | RetryNotify | func RetryNotify(operation Operation, b BackOff, notify Notify) error {
var err error
var next time.Duration
b.Reset()
for {
if err = operation(); err == nil {
return nil
}
if next = b.NextBackOff(); next == Stop {
return err
}
if notify != nil {
if err := notify(err, next); err != nil {
r... | go | func RetryNotify(operation Operation, b BackOff, notify Notify) error {
var err error
var next time.Duration
b.Reset()
for {
if err = operation(); err == nil {
return nil
}
if next = b.NextBackOff(); next == Stop {
return err
}
if notify != nil {
if err := notify(err, next); err != nil {
r... | [
"func",
"RetryNotify",
"(",
"operation",
"Operation",
",",
"b",
"BackOff",
",",
"notify",
"Notify",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"var",
"next",
"time",
".",
"Duration",
"\n",
"b",
".",
"Reset",
"(",
")",
"\n",
"for",
"{",
"if",
"er... | // RetryNotify calls notify function with the error and wait duration
// for each failed attempt before sleep. | [
"RetryNotify",
"calls",
"notify",
"function",
"with",
"the",
"error",
"and",
"wait",
"duration",
"for",
"each",
"failed",
"attempt",
"before",
"sleep",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/backoff/retry.go#L29-L51 | test |
pachyderm/pachyderm | src/server/pkg/hashtree/cache.go | Get | func (c *MergeCache) Get(id int64, w io.Writer, filter Filter) (retErr error) {
r, err := c.Cache.Get(fmt.Sprint(id))
if err != nil {
return err
}
defer func() {
if err := r.Close(); err != nil && retErr == nil {
retErr = err
}
}()
return NewWriter(w).Copy(NewReader(r, filter))
} | go | func (c *MergeCache) Get(id int64, w io.Writer, filter Filter) (retErr error) {
r, err := c.Cache.Get(fmt.Sprint(id))
if err != nil {
return err
}
defer func() {
if err := r.Close(); err != nil && retErr == nil {
retErr = err
}
}()
return NewWriter(w).Copy(NewReader(r, filter))
} | [
"func",
"(",
"c",
"*",
"MergeCache",
")",
"Get",
"(",
"id",
"int64",
",",
"w",
"io",
".",
"Writer",
",",
"filter",
"Filter",
")",
"(",
"retErr",
"error",
")",
"{",
"r",
",",
"err",
":=",
"c",
".",
"Cache",
".",
"Get",
"(",
"fmt",
".",
"Sprint",... | // Get does a filtered write of id's hashtree to the passed in io.Writer. | [
"Get",
"does",
"a",
"filtered",
"write",
"of",
"id",
"s",
"hashtree",
"to",
"the",
"passed",
"in",
"io",
".",
"Writer",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/cache.go#L56-L67 | test |
pachyderm/pachyderm | src/server/pkg/hashtree/cache.go | Delete | func (c *MergeCache) Delete(id int64) error {
return c.Cache.Delete(fmt.Sprint(id))
} | go | func (c *MergeCache) Delete(id int64) error {
return c.Cache.Delete(fmt.Sprint(id))
} | [
"func",
"(",
"c",
"*",
"MergeCache",
")",
"Delete",
"(",
"id",
"int64",
")",
"error",
"{",
"return",
"c",
".",
"Cache",
".",
"Delete",
"(",
"fmt",
".",
"Sprint",
"(",
"id",
")",
")",
"\n",
"}"
] | // Delete deletes a hashtree from the cache. | [
"Delete",
"deletes",
"a",
"hashtree",
"from",
"the",
"cache",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/cache.go#L70-L72 | test |
pachyderm/pachyderm | src/server/pps/pretty/pretty.go | PrintJobInfo | func PrintJobInfo(w io.Writer, jobInfo *ppsclient.JobInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", jobInfo.Job.ID)
fmt.Fprintf(w, "%s\t", jobInfo.Pipeline.Name)
if fullTimestamps {
fmt.Fprintf(w, "%s\t", jobInfo.Started.String())
} else {
fmt.Fprintf(w, "%s\t", pretty.Ago(jobInfo.Started))
}
if jobInfo.... | go | func PrintJobInfo(w io.Writer, jobInfo *ppsclient.JobInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", jobInfo.Job.ID)
fmt.Fprintf(w, "%s\t", jobInfo.Pipeline.Name)
if fullTimestamps {
fmt.Fprintf(w, "%s\t", jobInfo.Started.String())
} else {
fmt.Fprintf(w, "%s\t", pretty.Ago(jobInfo.Started))
}
if jobInfo.... | [
"func",
"PrintJobInfo",
"(",
"w",
"io",
".",
"Writer",
",",
"jobInfo",
"*",
"ppsclient",
".",
"JobInfo",
",",
"fullTimestamps",
"bool",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"%s\\t\"",
",",
"\\t",
")",
"\n",
"jobInfo",
".",
"Job",
".",
"I... | // PrintJobInfo pretty-prints job info. | [
"PrintJobInfo",
"pretty",
"-",
"prints",
"job",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/pretty/pretty.go#L46-L72 | test |
pachyderm/pachyderm | src/server/pps/pretty/pretty.go | PrintPipelineInfo | func PrintPipelineInfo(w io.Writer, pipelineInfo *ppsclient.PipelineInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", pipelineInfo.Pipeline.Name)
fmt.Fprintf(w, "%s\t", ShorthandInput(pipelineInfo.Input))
if fullTimestamps {
fmt.Fprintf(w, "%s\t", pipelineInfo.CreatedAt.String())
} else {
fmt.Fprintf(w, "%s\t... | go | func PrintPipelineInfo(w io.Writer, pipelineInfo *ppsclient.PipelineInfo, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", pipelineInfo.Pipeline.Name)
fmt.Fprintf(w, "%s\t", ShorthandInput(pipelineInfo.Input))
if fullTimestamps {
fmt.Fprintf(w, "%s\t", pipelineInfo.CreatedAt.String())
} else {
fmt.Fprintf(w, "%s\t... | [
"func",
"PrintPipelineInfo",
"(",
"w",
"io",
".",
"Writer",
",",
"pipelineInfo",
"*",
"ppsclient",
".",
"PipelineInfo",
",",
"fullTimestamps",
"bool",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"%s\\t\"",
",",
"\\t",
")",
"\n",
"pipelineInfo",
".",
... | // PrintPipelineInfo pretty-prints pipeline info. | [
"PrintPipelineInfo",
"pretty",
"-",
"prints",
"pipeline",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/pretty/pretty.go#L80-L89 | test |
pachyderm/pachyderm | src/server/pps/pretty/pretty.go | PrintWorkerStatus | func PrintWorkerStatus(w io.Writer, workerStatus *ppsclient.WorkerStatus, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", workerStatus.WorkerID)
fmt.Fprintf(w, "%s\t", workerStatus.JobID)
for _, datum := range workerStatus.Data {
fmt.Fprintf(w, datum.Path)
}
fmt.Fprintf(w, "\t")
if fullTimestamps {
fmt.Fprintf(... | go | func PrintWorkerStatus(w io.Writer, workerStatus *ppsclient.WorkerStatus, fullTimestamps bool) {
fmt.Fprintf(w, "%s\t", workerStatus.WorkerID)
fmt.Fprintf(w, "%s\t", workerStatus.JobID)
for _, datum := range workerStatus.Data {
fmt.Fprintf(w, datum.Path)
}
fmt.Fprintf(w, "\t")
if fullTimestamps {
fmt.Fprintf(... | [
"func",
"PrintWorkerStatus",
"(",
"w",
"io",
".",
"Writer",
",",
"workerStatus",
"*",
"ppsclient",
".",
"WorkerStatus",
",",
"fullTimestamps",
"bool",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"%s\\t\"",
",",
"\\t",
")",
"\n",
"workerStatus",
".",
... | // PrintWorkerStatus pretty prints a worker status. | [
"PrintWorkerStatus",
"pretty",
"prints",
"a",
"worker",
"status",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/pretty/pretty.go#L97-L110 | test |
pachyderm/pachyderm | src/server/pps/pretty/pretty.go | PrintDetailedJobInfo | func PrintDetailedJobInfo(jobInfo *PrintableJobInfo) error {
template, err := template.New("JobInfo").Funcs(funcMap).Parse(
`ID: {{.Job.ID}} {{if .Pipeline}}
Pipeline: {{.Pipeline.Name}} {{end}} {{if .ParentJob}}
Parent: {{.ParentJob.ID}} {{end}}{{if .FullTimestamps}}
Started: {{.Started}}{{else}}
Started: {{prettyA... | go | func PrintDetailedJobInfo(jobInfo *PrintableJobInfo) error {
template, err := template.New("JobInfo").Funcs(funcMap).Parse(
`ID: {{.Job.ID}} {{if .Pipeline}}
Pipeline: {{.Pipeline.Name}} {{end}} {{if .ParentJob}}
Parent: {{.ParentJob.ID}} {{end}}{{if .FullTimestamps}}
Started: {{.Started}}{{else}}
Started: {{prettyA... | [
"func",
"PrintDetailedJobInfo",
"(",
"jobInfo",
"*",
"PrintableJobInfo",
")",
"error",
"{",
"template",
",",
"err",
":=",
"template",
".",
"New",
"(",
"\"JobInfo\"",
")",
".",
"Funcs",
"(",
"funcMap",
")",
".",
"Parse",
"(",
"`ID: {{.Job.ID}} {{if .Pipeline}}Pip... | // PrintDetailedJobInfo pretty-prints detailed job info. | [
"PrintDetailedJobInfo",
"pretty",
"-",
"prints",
"detailed",
"job",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/pretty/pretty.go#L127-L179 | test |
pachyderm/pachyderm | src/server/pps/pretty/pretty.go | PrintDetailedPipelineInfo | func PrintDetailedPipelineInfo(pipelineInfo *PrintablePipelineInfo) error {
template, err := template.New("PipelineInfo").Funcs(funcMap).Parse(
`Name: {{.Pipeline.Name}}{{if .Description}}
Description: {{.Description}}{{end}}{{if .FullTimestamps }}
Created: {{.CreatedAt}}{{ else }}
Created: {{prettyAgo .CreatedAt}} ... | go | func PrintDetailedPipelineInfo(pipelineInfo *PrintablePipelineInfo) error {
template, err := template.New("PipelineInfo").Funcs(funcMap).Parse(
`Name: {{.Pipeline.Name}}{{if .Description}}
Description: {{.Description}}{{end}}{{if .FullTimestamps }}
Created: {{.CreatedAt}}{{ else }}
Created: {{prettyAgo .CreatedAt}} ... | [
"func",
"PrintDetailedPipelineInfo",
"(",
"pipelineInfo",
"*",
"PrintablePipelineInfo",
")",
"error",
"{",
"template",
",",
"err",
":=",
"template",
".",
"New",
"(",
"\"PipelineInfo\"",
")",
".",
"Funcs",
"(",
"funcMap",
")",
".",
"Parse",
"(",
"`Name: {{.Pipeli... | // PrintDetailedPipelineInfo pretty-prints detailed pipeline info. | [
"PrintDetailedPipelineInfo",
"pretty",
"-",
"prints",
"detailed",
"pipeline",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/pretty/pretty.go#L196-L236 | test |
pachyderm/pachyderm | src/server/pps/pretty/pretty.go | PrintDatumInfo | func PrintDatumInfo(w io.Writer, datumInfo *ppsclient.DatumInfo) {
totalTime := "-"
if datumInfo.Stats != nil {
totalTime = units.HumanDuration(client.GetDatumTotalTime(datumInfo.Stats))
}
fmt.Fprintf(w, "%s\t%s\t%s\n", datumInfo.Datum.ID, datumState(datumInfo.State), totalTime)
} | go | func PrintDatumInfo(w io.Writer, datumInfo *ppsclient.DatumInfo) {
totalTime := "-"
if datumInfo.Stats != nil {
totalTime = units.HumanDuration(client.GetDatumTotalTime(datumInfo.Stats))
}
fmt.Fprintf(w, "%s\t%s\t%s\n", datumInfo.Datum.ID, datumState(datumInfo.State), totalTime)
} | [
"func",
"PrintDatumInfo",
"(",
"w",
"io",
".",
"Writer",
",",
"datumInfo",
"*",
"ppsclient",
".",
"DatumInfo",
")",
"{",
"totalTime",
":=",
"\"-\"",
"\n",
"if",
"datumInfo",
".",
"Stats",
"!=",
"nil",
"{",
"totalTime",
"=",
"units",
".",
"HumanDuration",
... | // PrintDatumInfo pretty-prints file info.
// If recurse is false and directory size is 0, display "-" instead
// If fast is true and file size is 0, display "-" instead | [
"PrintDatumInfo",
"pretty",
"-",
"prints",
"file",
"info",
".",
"If",
"recurse",
"is",
"false",
"and",
"directory",
"size",
"is",
"0",
"display",
"-",
"instead",
"If",
"fast",
"is",
"true",
"and",
"file",
"size",
"is",
"0",
"display",
"-",
"instead"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/pretty/pretty.go#L246-L252 | test |
pachyderm/pachyderm | src/server/pps/pretty/pretty.go | PrintDetailedDatumInfo | func PrintDetailedDatumInfo(w io.Writer, datumInfo *ppsclient.DatumInfo) {
fmt.Fprintf(w, "ID\t%s\n", datumInfo.Datum.ID)
fmt.Fprintf(w, "Job ID\t%s\n", datumInfo.Datum.Job.ID)
fmt.Fprintf(w, "State\t%s\n", datumInfo.State)
fmt.Fprintf(w, "Data Downloaded\t%s\n", pretty.Size(datumInfo.Stats.DownloadBytes))
fmt.Fpr... | go | func PrintDetailedDatumInfo(w io.Writer, datumInfo *ppsclient.DatumInfo) {
fmt.Fprintf(w, "ID\t%s\n", datumInfo.Datum.ID)
fmt.Fprintf(w, "Job ID\t%s\n", datumInfo.Datum.Job.ID)
fmt.Fprintf(w, "State\t%s\n", datumInfo.State)
fmt.Fprintf(w, "Data Downloaded\t%s\n", pretty.Size(datumInfo.Stats.DownloadBytes))
fmt.Fpr... | [
"func",
"PrintDetailedDatumInfo",
"(",
"w",
"io",
".",
"Writer",
",",
"datumInfo",
"*",
"ppsclient",
".",
"DatumInfo",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"ID\\t%s\\n\"",
",",
"\\t",
")",
"\n",
"\\n",
"\n",
"datumInfo",
".",
"Datum",
".",
... | // PrintDetailedDatumInfo pretty-prints detailed info about a datum | [
"PrintDetailedDatumInfo",
"pretty",
"-",
"prints",
"detailed",
"info",
"about",
"a",
"datum"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/pretty/pretty.go#L255-L301 | test |
pachyderm/pachyderm | src/server/pps/pretty/pretty.go | PrintFile | func PrintFile(w io.Writer, file *pfsclient.File) {
fmt.Fprintf(w, " %s\t%s\t%s\t\n", file.Commit.Repo.Name, file.Commit.ID, file.Path)
} | go | func PrintFile(w io.Writer, file *pfsclient.File) {
fmt.Fprintf(w, " %s\t%s\t%s\t\n", file.Commit.Repo.Name, file.Commit.ID, file.Path)
} | [
"func",
"PrintFile",
"(",
"w",
"io",
".",
"Writer",
",",
"file",
"*",
"pfsclient",
".",
"File",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\" %s\\t%s\\t%s\\t\\n\"",
",",
"\\t",
",",
"\\t",
",",
"\\t",
")",
"\n",
"}"
] | // PrintFile values for a pfs file. | [
"PrintFile",
"values",
"for",
"a",
"pfs",
"file",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/pretty/pretty.go#L309-L311 | test |
pachyderm/pachyderm | src/server/pps/pretty/pretty.go | ShorthandInput | func ShorthandInput(input *ppsclient.Input) string {
switch {
case input == nil:
return "none"
case input.Pfs != nil:
return fmt.Sprintf("%s:%s", input.Pfs.Repo, input.Pfs.Glob)
case input.Cross != nil:
var subInput []string
for _, input := range input.Cross {
subInput = append(subInput, ShorthandInput(i... | go | func ShorthandInput(input *ppsclient.Input) string {
switch {
case input == nil:
return "none"
case input.Pfs != nil:
return fmt.Sprintf("%s:%s", input.Pfs.Repo, input.Pfs.Glob)
case input.Cross != nil:
var subInput []string
for _, input := range input.Cross {
subInput = append(subInput, ShorthandInput(i... | [
"func",
"ShorthandInput",
"(",
"input",
"*",
"ppsclient",
".",
"Input",
")",
"string",
"{",
"switch",
"{",
"case",
"input",
"==",
"nil",
":",
"return",
"\"none\"",
"\n",
"case",
"input",
".",
"Pfs",
"!=",
"nil",
":",
"return",
"fmt",
".",
"Sprintf",
"(... | // ShorthandInput renders a pps.Input as a short, readable string | [
"ShorthandInput",
"renders",
"a",
"pps",
".",
"Input",
"as",
"a",
"short",
"readable",
"string"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pps/pretty/pretty.go#L414-L436 | test |
pachyderm/pachyderm | src/server/pkg/obj/amazon_client.go | Retrieve | func (v *vaultCredentialsProvider) Retrieve() (credentials.Value, error) {
var emptyCreds, result credentials.Value // result
// retrieve AWS creds from vault
vaultSecret, err := v.vaultClient.Logical().Read(path.Join("aws", "creds", v.vaultRole))
if err != nil {
return emptyCreds, fmt.Errorf("could not retrieve... | go | func (v *vaultCredentialsProvider) Retrieve() (credentials.Value, error) {
var emptyCreds, result credentials.Value // result
// retrieve AWS creds from vault
vaultSecret, err := v.vaultClient.Logical().Read(path.Join("aws", "creds", v.vaultRole))
if err != nil {
return emptyCreds, fmt.Errorf("could not retrieve... | [
"func",
"(",
"v",
"*",
"vaultCredentialsProvider",
")",
"Retrieve",
"(",
")",
"(",
"credentials",
".",
"Value",
",",
"error",
")",
"{",
"var",
"emptyCreds",
",",
"result",
"credentials",
".",
"Value",
"\n",
"vaultSecret",
",",
"err",
":=",
"v",
".",
"vau... | // Retrieve returns nil if it successfully retrieved the value. Error is
// returned if the value were not obtainable, or empty. | [
"Retrieve",
"returns",
"nil",
"if",
"it",
"successfully",
"retrieved",
"the",
"value",
".",
"Error",
"is",
"returned",
"if",
"the",
"value",
"were",
"not",
"obtainable",
"or",
"empty",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/amazon_client.go#L90-L143 | test |
pachyderm/pachyderm | src/server/pkg/obj/amazon_client.go | IsExpired | func (v *vaultCredentialsProvider) IsExpired() bool {
v.leaseMu.Lock()
defer v.leaseMu.Unlock()
return time.Now().After(v.leaseLastRenew.Add(v.leaseDuration))
} | go | func (v *vaultCredentialsProvider) IsExpired() bool {
v.leaseMu.Lock()
defer v.leaseMu.Unlock()
return time.Now().After(v.leaseLastRenew.Add(v.leaseDuration))
} | [
"func",
"(",
"v",
"*",
"vaultCredentialsProvider",
")",
"IsExpired",
"(",
")",
"bool",
"{",
"v",
".",
"leaseMu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"v",
".",
"leaseMu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"time",
".",
"Now",
"(",
")",
".",
... | // IsExpired returns if the credentials are no longer valid, and need to be
// retrieved. | [
"IsExpired",
"returns",
"if",
"the",
"credentials",
"are",
"no",
"longer",
"valid",
"and",
"need",
"to",
"be",
"retrieved",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/amazon_client.go#L147-L151 | test |
pachyderm/pachyderm | src/client/pfs.go | NewBranch | func NewBranch(repoName string, branchName string) *pfs.Branch {
return &pfs.Branch{
Repo: NewRepo(repoName),
Name: branchName,
}
} | go | func NewBranch(repoName string, branchName string) *pfs.Branch {
return &pfs.Branch{
Repo: NewRepo(repoName),
Name: branchName,
}
} | [
"func",
"NewBranch",
"(",
"repoName",
"string",
",",
"branchName",
"string",
")",
"*",
"pfs",
".",
"Branch",
"{",
"return",
"&",
"pfs",
".",
"Branch",
"{",
"Repo",
":",
"NewRepo",
"(",
"repoName",
")",
",",
"Name",
":",
"branchName",
",",
"}",
"\n",
... | // NewBranch creates a pfs.Branch | [
"NewBranch",
"creates",
"a",
"pfs",
".",
"Branch"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L22-L27 | test |
pachyderm/pachyderm | src/client/pfs.go | NewCommit | func NewCommit(repoName string, commitID string) *pfs.Commit {
return &pfs.Commit{
Repo: NewRepo(repoName),
ID: commitID,
}
} | go | func NewCommit(repoName string, commitID string) *pfs.Commit {
return &pfs.Commit{
Repo: NewRepo(repoName),
ID: commitID,
}
} | [
"func",
"NewCommit",
"(",
"repoName",
"string",
",",
"commitID",
"string",
")",
"*",
"pfs",
".",
"Commit",
"{",
"return",
"&",
"pfs",
".",
"Commit",
"{",
"Repo",
":",
"NewRepo",
"(",
"repoName",
")",
",",
"ID",
":",
"commitID",
",",
"}",
"\n",
"}"
] | // NewCommit creates a pfs.Commit. | [
"NewCommit",
"creates",
"a",
"pfs",
".",
"Commit",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L30-L35 | test |
pachyderm/pachyderm | src/client/pfs.go | NewCommitProvenance | func NewCommitProvenance(repoName string, branchName string, commitID string) *pfs.CommitProvenance {
return &pfs.CommitProvenance{
Commit: NewCommit(repoName, commitID),
Branch: NewBranch(repoName, branchName),
}
} | go | func NewCommitProvenance(repoName string, branchName string, commitID string) *pfs.CommitProvenance {
return &pfs.CommitProvenance{
Commit: NewCommit(repoName, commitID),
Branch: NewBranch(repoName, branchName),
}
} | [
"func",
"NewCommitProvenance",
"(",
"repoName",
"string",
",",
"branchName",
"string",
",",
"commitID",
"string",
")",
"*",
"pfs",
".",
"CommitProvenance",
"{",
"return",
"&",
"pfs",
".",
"CommitProvenance",
"{",
"Commit",
":",
"NewCommit",
"(",
"repoName",
",... | // NewCommitProvenance creates a pfs.CommitProvenance. | [
"NewCommitProvenance",
"creates",
"a",
"pfs",
".",
"CommitProvenance",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L38-L43 | test |
pachyderm/pachyderm | src/client/pfs.go | NewFile | func NewFile(repoName string, commitID string, path string) *pfs.File {
return &pfs.File{
Commit: NewCommit(repoName, commitID),
Path: path,
}
} | go | func NewFile(repoName string, commitID string, path string) *pfs.File {
return &pfs.File{
Commit: NewCommit(repoName, commitID),
Path: path,
}
} | [
"func",
"NewFile",
"(",
"repoName",
"string",
",",
"commitID",
"string",
",",
"path",
"string",
")",
"*",
"pfs",
".",
"File",
"{",
"return",
"&",
"pfs",
".",
"File",
"{",
"Commit",
":",
"NewCommit",
"(",
"repoName",
",",
"commitID",
")",
",",
"Path",
... | // NewFile creates a pfs.File. | [
"NewFile",
"creates",
"a",
"pfs",
".",
"File",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L46-L51 | test |
pachyderm/pachyderm | src/client/pfs.go | CreateRepo | func (c APIClient) CreateRepo(repoName string) error {
_, err := c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfs.CreateRepoRequest{
Repo: NewRepo(repoName),
},
)
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) CreateRepo(repoName string) error {
_, err := c.PfsAPIClient.CreateRepo(
c.Ctx(),
&pfs.CreateRepoRequest{
Repo: NewRepo(repoName),
},
)
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"CreateRepo",
"(",
"repoName",
"string",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"PfsAPIClient",
".",
"CreateRepo",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pfs",
".",
"CreateRepoRequest",
"{",
"Repo"... | // CreateRepo creates a new Repo object in pfs with the given name. Repos are
// the top level data object in pfs and should be used to store data of a
// similar type. For example rather than having a single Repo for an entire
// project you might have separate Repos for logs, metrics, database dumps etc. | [
"CreateRepo",
"creates",
"a",
"new",
"Repo",
"object",
"in",
"pfs",
"with",
"the",
"given",
"name",
".",
"Repos",
"are",
"the",
"top",
"level",
"data",
"object",
"in",
"pfs",
"and",
"should",
"be",
"used",
"to",
"store",
"data",
"of",
"a",
"similar",
"... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L78-L86 | test |
pachyderm/pachyderm | src/client/pfs.go | InspectRepo | func (c APIClient) InspectRepo(repoName string) (*pfs.RepoInfo, error) {
resp, err := c.PfsAPIClient.InspectRepo(
c.Ctx(),
&pfs.InspectRepoRequest{
Repo: NewRepo(repoName),
},
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err)
}
return resp, nil
} | go | func (c APIClient) InspectRepo(repoName string) (*pfs.RepoInfo, error) {
resp, err := c.PfsAPIClient.InspectRepo(
c.Ctx(),
&pfs.InspectRepoRequest{
Repo: NewRepo(repoName),
},
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err)
}
return resp, nil
} | [
"func",
"(",
"c",
"APIClient",
")",
"InspectRepo",
"(",
"repoName",
"string",
")",
"(",
"*",
"pfs",
".",
"RepoInfo",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"c",
".",
"PfsAPIClient",
".",
"InspectRepo",
"(",
"c",
".",
"Ctx",
"(",
")",
","... | // InspectRepo returns info about a specific Repo. | [
"InspectRepo",
"returns",
"info",
"about",
"a",
"specific",
"Repo",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L89-L100 | test |
pachyderm/pachyderm | src/client/pfs.go | ListRepo | func (c APIClient) ListRepo() ([]*pfs.RepoInfo, error) {
request := &pfs.ListRepoRequest{}
repoInfos, err := c.PfsAPIClient.ListRepo(
c.Ctx(),
request,
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err)
}
return repoInfos.RepoInfo, nil
} | go | func (c APIClient) ListRepo() ([]*pfs.RepoInfo, error) {
request := &pfs.ListRepoRequest{}
repoInfos, err := c.PfsAPIClient.ListRepo(
c.Ctx(),
request,
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err)
}
return repoInfos.RepoInfo, nil
} | [
"func",
"(",
"c",
"APIClient",
")",
"ListRepo",
"(",
")",
"(",
"[",
"]",
"*",
"pfs",
".",
"RepoInfo",
",",
"error",
")",
"{",
"request",
":=",
"&",
"pfs",
".",
"ListRepoRequest",
"{",
"}",
"\n",
"repoInfos",
",",
"err",
":=",
"c",
".",
"PfsAPIClien... | // ListRepo returns info about all Repos.
// provenance specifies a set of provenance repos, only repos which have ALL of
// the specified repos as provenance will be returned unless provenance is nil
// in which case it is ignored. | [
"ListRepo",
"returns",
"info",
"about",
"all",
"Repos",
".",
"provenance",
"specifies",
"a",
"set",
"of",
"provenance",
"repos",
"only",
"repos",
"which",
"have",
"ALL",
"of",
"the",
"specified",
"repos",
"as",
"provenance",
"will",
"be",
"returned",
"unless",... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L106-L116 | test |
pachyderm/pachyderm | src/client/pfs.go | DeleteRepo | func (c APIClient) DeleteRepo(repoName string, force bool) error {
_, err := c.PfsAPIClient.DeleteRepo(
c.Ctx(),
&pfs.DeleteRepoRequest{
Repo: NewRepo(repoName),
Force: force,
},
)
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) DeleteRepo(repoName string, force bool) error {
_, err := c.PfsAPIClient.DeleteRepo(
c.Ctx(),
&pfs.DeleteRepoRequest{
Repo: NewRepo(repoName),
Force: force,
},
)
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"DeleteRepo",
"(",
"repoName",
"string",
",",
"force",
"bool",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"PfsAPIClient",
".",
"DeleteRepo",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pfs",
".",
"DeleteR... | // DeleteRepo deletes a repo and reclaims the storage space it was using. Note
// that as of 1.0 we do not reclaim the blocks that the Repo was referencing,
// this is because they may also be referenced by other Repos and deleting them
// would make those Repos inaccessible. This will be resolved in later
// versions.... | [
"DeleteRepo",
"deletes",
"a",
"repo",
"and",
"reclaims",
"the",
"storage",
"space",
"it",
"was",
"using",
".",
"Note",
"that",
"as",
"of",
"1",
".",
"0",
"we",
"do",
"not",
"reclaim",
"the",
"blocks",
"that",
"the",
"Repo",
"was",
"referencing",
"this",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L125-L134 | test |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.