id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
125,200 | minio/minio | cmd/crypto/header.go | IsRequested | func (s3KMS) IsRequested(h http.Header) bool {
if _, ok := h[SSEKmsID]; ok {
return true
}
if _, ok := h[SSEKmsContext]; ok {
return true
}
if _, ok := h[SSEHeader]; ok {
return strings.ToUpper(h.Get(SSEHeader)) != SSEAlgorithmAES256 // Return only true if the SSE header is specified and does not contain the... | go | func (s3KMS) IsRequested(h http.Header) bool {
if _, ok := h[SSEKmsID]; ok {
return true
}
if _, ok := h[SSEKmsContext]; ok {
return true
}
if _, ok := h[SSEHeader]; ok {
return strings.ToUpper(h.Get(SSEHeader)) != SSEAlgorithmAES256 // Return only true if the SSE header is specified and does not contain the... | [
"func",
"(",
"s3KMS",
")",
"IsRequested",
"(",
"h",
"http",
".",
"Header",
")",
"bool",
"{",
"if",
"_",
",",
"ok",
":=",
"h",
"[",
"SSEKmsID",
"]",
";",
"ok",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"_",
",",
"ok",
":=",
"h",
"[",
"SSEK... | // IsRequested returns true if the HTTP headers indicates that
// the S3 client requests SSE-KMS. | [
"IsRequested",
"returns",
"true",
"if",
"the",
"HTTP",
"headers",
"indicates",
"that",
"the",
"S3",
"client",
"requests",
"SSE",
"-",
"KMS",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/crypto/header.go#L115-L126 |
125,201 | minio/minio | cmd/crypto/header.go | IsRequested | func (ssec) IsRequested(h http.Header) bool {
if _, ok := h[SSECAlgorithm]; ok {
return true
}
if _, ok := h[SSECKey]; ok {
return true
}
if _, ok := h[SSECKeyMD5]; ok {
return true
}
return false
} | go | func (ssec) IsRequested(h http.Header) bool {
if _, ok := h[SSECAlgorithm]; ok {
return true
}
if _, ok := h[SSECKey]; ok {
return true
}
if _, ok := h[SSECKeyMD5]; ok {
return true
}
return false
} | [
"func",
"(",
"ssec",
")",
"IsRequested",
"(",
"h",
"http",
".",
"Header",
")",
"bool",
"{",
"if",
"_",
",",
"ok",
":=",
"h",
"[",
"SSECAlgorithm",
"]",
";",
"ok",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"_",
",",
"ok",
":=",
"h",
"[",
"... | // IsRequested returns true if the HTTP headers contains
// at least one SSE-C header. SSE-C copy headers are ignored. | [
"IsRequested",
"returns",
"true",
"if",
"the",
"HTTP",
"headers",
"contains",
"at",
"least",
"one",
"SSE",
"-",
"C",
"header",
".",
"SSE",
"-",
"C",
"copy",
"headers",
"are",
"ignored",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/crypto/header.go#L143-L154 |
125,202 | minio/minio | cmd/crypto/header.go | IsRequested | func (ssecCopy) IsRequested(h http.Header) bool {
if _, ok := h[SSECopyAlgorithm]; ok {
return true
}
if _, ok := h[SSECopyKey]; ok {
return true
}
if _, ok := h[SSECopyKeyMD5]; ok {
return true
}
return false
} | go | func (ssecCopy) IsRequested(h http.Header) bool {
if _, ok := h[SSECopyAlgorithm]; ok {
return true
}
if _, ok := h[SSECopyKey]; ok {
return true
}
if _, ok := h[SSECopyKeyMD5]; ok {
return true
}
return false
} | [
"func",
"(",
"ssecCopy",
")",
"IsRequested",
"(",
"h",
"http",
".",
"Header",
")",
"bool",
"{",
"if",
"_",
",",
"ok",
":=",
"h",
"[",
"SSECopyAlgorithm",
"]",
";",
"ok",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"_",
",",
"ok",
":=",
"h",
"... | // IsRequested returns true if the HTTP headers contains
// at least one SSE-C copy header. Regular SSE-C headers
// are ignored. | [
"IsRequested",
"returns",
"true",
"if",
"the",
"HTTP",
"headers",
"contains",
"at",
"least",
"one",
"SSE",
"-",
"C",
"copy",
"header",
".",
"Regular",
"SSE",
"-",
"C",
"headers",
"are",
"ignored",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/crypto/header.go#L159-L170 |
125,203 | minio/minio | cmd/crypto/header.go | ParseHTTP | func (ssec) ParseHTTP(h http.Header) (key [32]byte, err error) {
if h.Get(SSECAlgorithm) != SSEAlgorithmAES256 {
return key, ErrInvalidCustomerAlgorithm
}
if h.Get(SSECKey) == "" {
return key, ErrMissingCustomerKey
}
if h.Get(SSECKeyMD5) == "" {
return key, ErrMissingCustomerKeyMD5
}
clientKey, err := bas... | go | func (ssec) ParseHTTP(h http.Header) (key [32]byte, err error) {
if h.Get(SSECAlgorithm) != SSEAlgorithmAES256 {
return key, ErrInvalidCustomerAlgorithm
}
if h.Get(SSECKey) == "" {
return key, ErrMissingCustomerKey
}
if h.Get(SSECKeyMD5) == "" {
return key, ErrMissingCustomerKeyMD5
}
clientKey, err := bas... | [
"func",
"(",
"ssec",
")",
"ParseHTTP",
"(",
"h",
"http",
".",
"Header",
")",
"(",
"key",
"[",
"32",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"if",
"h",
".",
"Get",
"(",
"SSECAlgorithm",
")",
"!=",
"SSEAlgorithmAES256",
"{",
"return",
"key",
",",... | // ParseHTTP parses the SSE-C headers and returns the SSE-C client key
// on success. SSE-C copy headers are ignored. | [
"ParseHTTP",
"parses",
"the",
"SSE",
"-",
"C",
"headers",
"and",
"returns",
"the",
"SSE",
"-",
"C",
"client",
"key",
"on",
"success",
".",
"SSE",
"-",
"C",
"copy",
"headers",
"are",
"ignored",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/crypto/header.go#L174-L195 |
125,204 | minio/minio | cmd/crypto/header.go | ParseHTTP | func (ssecCopy) ParseHTTP(h http.Header) (key [32]byte, err error) {
if h.Get(SSECopyAlgorithm) != SSEAlgorithmAES256 {
return key, ErrInvalidCustomerAlgorithm
}
if h.Get(SSECopyKey) == "" {
return key, ErrMissingCustomerKey
}
if h.Get(SSECopyKeyMD5) == "" {
return key, ErrMissingCustomerKeyMD5
}
clientKe... | go | func (ssecCopy) ParseHTTP(h http.Header) (key [32]byte, err error) {
if h.Get(SSECopyAlgorithm) != SSEAlgorithmAES256 {
return key, ErrInvalidCustomerAlgorithm
}
if h.Get(SSECopyKey) == "" {
return key, ErrMissingCustomerKey
}
if h.Get(SSECopyKeyMD5) == "" {
return key, ErrMissingCustomerKeyMD5
}
clientKe... | [
"func",
"(",
"ssecCopy",
")",
"ParseHTTP",
"(",
"h",
"http",
".",
"Header",
")",
"(",
"key",
"[",
"32",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"if",
"h",
".",
"Get",
"(",
"SSECopyAlgorithm",
")",
"!=",
"SSEAlgorithmAES256",
"{",
"return",
"key",... | // ParseHTTP parses the SSE-C copy headers and returns the SSE-C client key
// on success. Regular SSE-C headers are ignored. | [
"ParseHTTP",
"parses",
"the",
"SSE",
"-",
"C",
"copy",
"headers",
"and",
"returns",
"the",
"SSE",
"-",
"C",
"client",
"key",
"on",
"success",
".",
"Regular",
"SSE",
"-",
"C",
"headers",
"are",
"ignored",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/crypto/header.go#L199-L220 |
125,205 | minio/minio | cmd/storage-class.go | UnmarshalJSON | func (sCfg *storageClassConfig) UnmarshalJSON(data []byte) error {
type Alias storageClassConfig
aux := &struct {
*Alias
}{
Alias: (*Alias)(sCfg),
}
if err := json.Unmarshal(data, &aux); err != nil {
return err
}
return validateParity(aux.Standard.Parity, aux.RRS.Parity)
} | go | func (sCfg *storageClassConfig) UnmarshalJSON(data []byte) error {
type Alias storageClassConfig
aux := &struct {
*Alias
}{
Alias: (*Alias)(sCfg),
}
if err := json.Unmarshal(data, &aux); err != nil {
return err
}
return validateParity(aux.Standard.Parity, aux.RRS.Parity)
} | [
"func",
"(",
"sCfg",
"*",
"storageClassConfig",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"type",
"Alias",
"storageClassConfig",
"\n",
"aux",
":=",
"&",
"struct",
"{",
"*",
"Alias",
"\n",
"}",
"{",
"Alias",
":",
"(",
"*",
... | // Validate SS and RRS parity when unmarshalling JSON. | [
"Validate",
"SS",
"and",
"RRS",
"parity",
"when",
"unmarshalling",
"JSON",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/storage-class.go#L59-L70 |
125,206 | minio/minio | cmd/storage-class.go | validateParity | func validateParity(ssParity, rrsParity int) (err error) {
if ssParity == 0 && rrsParity == 0 {
return nil
}
if !globalIsXL {
return fmt.Errorf("Setting storage class only allowed for erasure coding mode")
}
// SS parity disks should be greater than or equal to minimumParityDisks. Parity below minimumParityD... | go | func validateParity(ssParity, rrsParity int) (err error) {
if ssParity == 0 && rrsParity == 0 {
return nil
}
if !globalIsXL {
return fmt.Errorf("Setting storage class only allowed for erasure coding mode")
}
// SS parity disks should be greater than or equal to minimumParityDisks. Parity below minimumParityD... | [
"func",
"validateParity",
"(",
"ssParity",
",",
"rrsParity",
"int",
")",
"(",
"err",
"error",
")",
"{",
"if",
"ssParity",
"==",
"0",
"&&",
"rrsParity",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"if",
"!",
"globalIsXL",
"{",
"return",
"fmt",
... | // Validates the parity disks. | [
"Validates",
"the",
"parity",
"disks",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/storage-class.go#L132-L165 |
125,207 | minio/minio | cmd/storage-class.go | objectQuorumFromMeta | func objectQuorumFromMeta(ctx context.Context, xl xlObjects, partsMetaData []xlMetaV1, errs []error) (objectReadQuorum, objectWriteQuorum int, err error) {
// get the latest updated Metadata and a count of all the latest updated xlMeta(s)
latestXLMeta, err := getLatestXLMeta(ctx, partsMetaData, errs)
if err != nil ... | go | func objectQuorumFromMeta(ctx context.Context, xl xlObjects, partsMetaData []xlMetaV1, errs []error) (objectReadQuorum, objectWriteQuorum int, err error) {
// get the latest updated Metadata and a count of all the latest updated xlMeta(s)
latestXLMeta, err := getLatestXLMeta(ctx, partsMetaData, errs)
if err != nil ... | [
"func",
"objectQuorumFromMeta",
"(",
"ctx",
"context",
".",
"Context",
",",
"xl",
"xlObjects",
",",
"partsMetaData",
"[",
"]",
"xlMetaV1",
",",
"errs",
"[",
"]",
"error",
")",
"(",
"objectReadQuorum",
",",
"objectWriteQuorum",
"int",
",",
"err",
"error",
")"... | // Returns per object readQuorum and writeQuorum
// readQuorum is the minimum required disks to read data.
// writeQuorum is the minimum required disks to write data. | [
"Returns",
"per",
"object",
"readQuorum",
"and",
"writeQuorum",
"readQuorum",
"is",
"the",
"minimum",
"required",
"disks",
"to",
"read",
"data",
".",
"writeQuorum",
"is",
"the",
"minimum",
"required",
"disks",
"to",
"write",
"data",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/storage-class.go#L200-L211 |
125,208 | minio/minio | pkg/sys/stats_linux.go | getMemoryLimit | func getMemoryLimit() (sysLimit uint64, err error) {
if sysLimit, err = getSysinfoMemoryLimit(); err != nil {
// Physical memory info is not accessible, just exit here.
return 0, err
}
// Following code is deliberately ignoring the error.
cGroupLimit, gerr := cgroup.GetMemoryLimit(os.Getpid())
if gerr != nil ... | go | func getMemoryLimit() (sysLimit uint64, err error) {
if sysLimit, err = getSysinfoMemoryLimit(); err != nil {
// Physical memory info is not accessible, just exit here.
return 0, err
}
// Following code is deliberately ignoring the error.
cGroupLimit, gerr := cgroup.GetMemoryLimit(os.Getpid())
if gerr != nil ... | [
"func",
"getMemoryLimit",
"(",
")",
"(",
"sysLimit",
"uint64",
",",
"err",
"error",
")",
"{",
"if",
"sysLimit",
",",
"err",
"=",
"getSysinfoMemoryLimit",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"// Physical memory info is not accessible, just exit here.",
"return"... | // Get the final system memory limit chosen by the user.
// by default without any configuration on a vanilla Linux
// system you would see physical RAM limit. If cgroup
// is configured at some point in time this function
// would return the memory limit chosen for the given pid. | [
"Get",
"the",
"final",
"system",
"memory",
"limit",
"chosen",
"by",
"the",
"user",
".",
"by",
"default",
"without",
"any",
"configuration",
"on",
"a",
"vanilla",
"Linux",
"system",
"you",
"would",
"see",
"physical",
"RAM",
"limit",
".",
"If",
"cgroup",
"is... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/sys/stats_linux.go#L33-L56 |
125,209 | minio/minio | pkg/sys/stats_linux.go | getSysinfoMemoryLimit | func getSysinfoMemoryLimit() (limit uint64, err error) {
var si syscall.Sysinfo_t
if err = syscall.Sysinfo(&si); err != nil {
return 0, err
}
// Some fields in syscall.Sysinfo_t have different integer sizes
// in different platform architectures. Cast all fields to uint64.
totalRAM := uint64(si.Totalram)
uni... | go | func getSysinfoMemoryLimit() (limit uint64, err error) {
var si syscall.Sysinfo_t
if err = syscall.Sysinfo(&si); err != nil {
return 0, err
}
// Some fields in syscall.Sysinfo_t have different integer sizes
// in different platform architectures. Cast all fields to uint64.
totalRAM := uint64(si.Totalram)
uni... | [
"func",
"getSysinfoMemoryLimit",
"(",
")",
"(",
"limit",
"uint64",
",",
"err",
"error",
")",
"{",
"var",
"si",
"syscall",
".",
"Sysinfo_t",
"\n",
"if",
"err",
"=",
"syscall",
".",
"Sysinfo",
"(",
"&",
"si",
")",
";",
"err",
"!=",
"nil",
"{",
"return"... | // Get physical RAM size of the node. | [
"Get",
"physical",
"RAM",
"size",
"of",
"the",
"node",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/sys/stats_linux.go#L59-L74 |
125,210 | minio/minio | pkg/sys/stats_linux.go | GetStats | func GetStats() (stats Stats, err error) {
var limit uint64
limit, err = getMemoryLimit()
if err != nil {
return Stats{}, err
}
stats.TotalRAM = limit
return stats, nil
} | go | func GetStats() (stats Stats, err error) {
var limit uint64
limit, err = getMemoryLimit()
if err != nil {
return Stats{}, err
}
stats.TotalRAM = limit
return stats, nil
} | [
"func",
"GetStats",
"(",
")",
"(",
"stats",
"Stats",
",",
"err",
"error",
")",
"{",
"var",
"limit",
"uint64",
"\n",
"limit",
",",
"err",
"=",
"getMemoryLimit",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"Stats",
"{",
"}",
",",
"err",
... | // GetStats - return system statistics, currently only
// supported value is TotalRAM. | [
"GetStats",
"-",
"return",
"system",
"statistics",
"currently",
"only",
"supported",
"value",
"is",
"TotalRAM",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/sys/stats_linux.go#L78-L87 |
125,211 | minio/minio | cmd/erasure.go | NewErasure | func NewErasure(ctx context.Context, dataBlocks, parityBlocks int, blockSize int64) (e Erasure, err error) {
e = Erasure{
dataBlocks: dataBlocks,
parityBlocks: parityBlocks,
blockSize: blockSize,
}
e.encoder, err = reedsolomon.New(dataBlocks, parityBlocks, reedsolomon.WithAutoGoroutines(int(e.ShardSize())... | go | func NewErasure(ctx context.Context, dataBlocks, parityBlocks int, blockSize int64) (e Erasure, err error) {
e = Erasure{
dataBlocks: dataBlocks,
parityBlocks: parityBlocks,
blockSize: blockSize,
}
e.encoder, err = reedsolomon.New(dataBlocks, parityBlocks, reedsolomon.WithAutoGoroutines(int(e.ShardSize())... | [
"func",
"NewErasure",
"(",
"ctx",
"context",
".",
"Context",
",",
"dataBlocks",
",",
"parityBlocks",
"int",
",",
"blockSize",
"int64",
")",
"(",
"e",
"Erasure",
",",
"err",
"error",
")",
"{",
"e",
"=",
"Erasure",
"{",
"dataBlocks",
":",
"dataBlocks",
","... | // NewErasure creates a new ErasureStorage. | [
"NewErasure",
"creates",
"a",
"new",
"ErasureStorage",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/erasure.go#L34-L46 |
125,212 | minio/minio | cmd/erasure.go | EncodeData | func (e *Erasure) EncodeData(ctx context.Context, data []byte) ([][]byte, error) {
if len(data) == 0 {
return make([][]byte, e.dataBlocks+e.parityBlocks), nil
}
encoded, err := e.encoder.Split(data)
if err != nil {
logger.LogIf(ctx, err)
return nil, err
}
if err = e.encoder.Encode(encoded); err != nil {
l... | go | func (e *Erasure) EncodeData(ctx context.Context, data []byte) ([][]byte, error) {
if len(data) == 0 {
return make([][]byte, e.dataBlocks+e.parityBlocks), nil
}
encoded, err := e.encoder.Split(data)
if err != nil {
logger.LogIf(ctx, err)
return nil, err
}
if err = e.encoder.Encode(encoded); err != nil {
l... | [
"func",
"(",
"e",
"*",
"Erasure",
")",
"EncodeData",
"(",
"ctx",
"context",
".",
"Context",
",",
"data",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"len",
"(",
"data",
")",
"==",
"0",
"{",
"return",
... | // EncodeData encodes the given data and returns the erasure-coded data.
// It returns an error if the erasure coding failed. | [
"EncodeData",
"encodes",
"the",
"given",
"data",
"and",
"returns",
"the",
"erasure",
"-",
"coded",
"data",
".",
"It",
"returns",
"an",
"error",
"if",
"the",
"erasure",
"coding",
"failed",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/erasure.go#L50-L64 |
125,213 | minio/minio | cmd/erasure.go | DecodeDataBlocks | func (e *Erasure) DecodeDataBlocks(data [][]byte) error {
needsReconstruction := false
for _, b := range data[:e.dataBlocks] {
if b == nil {
needsReconstruction = true
break
}
}
if !needsReconstruction {
return nil
}
if err := e.encoder.ReconstructData(data); err != nil {
return err
}
return nil
} | go | func (e *Erasure) DecodeDataBlocks(data [][]byte) error {
needsReconstruction := false
for _, b := range data[:e.dataBlocks] {
if b == nil {
needsReconstruction = true
break
}
}
if !needsReconstruction {
return nil
}
if err := e.encoder.ReconstructData(data); err != nil {
return err
}
return nil
} | [
"func",
"(",
"e",
"*",
"Erasure",
")",
"DecodeDataBlocks",
"(",
"data",
"[",
"]",
"[",
"]",
"byte",
")",
"error",
"{",
"needsReconstruction",
":=",
"false",
"\n",
"for",
"_",
",",
"b",
":=",
"range",
"data",
"[",
":",
"e",
".",
"dataBlocks",
"]",
"... | // DecodeDataBlocks decodes the given erasure-coded data.
// It only decodes the data blocks but does not verify them.
// It returns an error if the decoding failed. | [
"DecodeDataBlocks",
"decodes",
"the",
"given",
"erasure",
"-",
"coded",
"data",
".",
"It",
"only",
"decodes",
"the",
"data",
"blocks",
"but",
"does",
"not",
"verify",
"them",
".",
"It",
"returns",
"an",
"error",
"if",
"the",
"decoding",
"failed",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/erasure.go#L69-L84 |
125,214 | minio/minio | cmd/erasure.go | DecodeDataAndParityBlocks | func (e *Erasure) DecodeDataAndParityBlocks(ctx context.Context, data [][]byte) error {
if err := e.encoder.Reconstruct(data); err != nil {
logger.LogIf(ctx, err)
return err
}
return nil
} | go | func (e *Erasure) DecodeDataAndParityBlocks(ctx context.Context, data [][]byte) error {
if err := e.encoder.Reconstruct(data); err != nil {
logger.LogIf(ctx, err)
return err
}
return nil
} | [
"func",
"(",
"e",
"*",
"Erasure",
")",
"DecodeDataAndParityBlocks",
"(",
"ctx",
"context",
".",
"Context",
",",
"data",
"[",
"]",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"err",
":=",
"e",
".",
"encoder",
".",
"Reconstruct",
"(",
"data",
")",
";",
... | // DecodeDataAndParityBlocks decodes the given erasure-coded data and verifies it.
// It returns an error if the decoding failed. | [
"DecodeDataAndParityBlocks",
"decodes",
"the",
"given",
"erasure",
"-",
"coded",
"data",
"and",
"verifies",
"it",
".",
"It",
"returns",
"an",
"error",
"if",
"the",
"decoding",
"failed",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/erasure.go#L88-L94 |
125,215 | minio/minio | cmd/erasure.go | ShardSize | func (e *Erasure) ShardSize() int64 {
return ceilFrac(e.blockSize, int64(e.dataBlocks))
} | go | func (e *Erasure) ShardSize() int64 {
return ceilFrac(e.blockSize, int64(e.dataBlocks))
} | [
"func",
"(",
"e",
"*",
"Erasure",
")",
"ShardSize",
"(",
")",
"int64",
"{",
"return",
"ceilFrac",
"(",
"e",
".",
"blockSize",
",",
"int64",
"(",
"e",
".",
"dataBlocks",
")",
")",
"\n",
"}"
] | // ShardSize - returns actual shared size from erasure blockSize. | [
"ShardSize",
"-",
"returns",
"actual",
"shared",
"size",
"from",
"erasure",
"blockSize",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/erasure.go#L97-L99 |
125,216 | minio/minio | cmd/erasure.go | ShardFileSize | func (e *Erasure) ShardFileSize(totalLength int64) int64 {
if totalLength == 0 {
return 0
}
if totalLength == -1 {
return -1
}
numShards := totalLength / e.blockSize
lastBlockSize := totalLength % int64(e.blockSize)
lastShardSize := ceilFrac(lastBlockSize, int64(e.dataBlocks))
return numShards*e.ShardSize()... | go | func (e *Erasure) ShardFileSize(totalLength int64) int64 {
if totalLength == 0 {
return 0
}
if totalLength == -1 {
return -1
}
numShards := totalLength / e.blockSize
lastBlockSize := totalLength % int64(e.blockSize)
lastShardSize := ceilFrac(lastBlockSize, int64(e.dataBlocks))
return numShards*e.ShardSize()... | [
"func",
"(",
"e",
"*",
"Erasure",
")",
"ShardFileSize",
"(",
"totalLength",
"int64",
")",
"int64",
"{",
"if",
"totalLength",
"==",
"0",
"{",
"return",
"0",
"\n",
"}",
"\n",
"if",
"totalLength",
"==",
"-",
"1",
"{",
"return",
"-",
"1",
"\n",
"}",
"\... | // ShardFileSize - returns final erasure size from original size. | [
"ShardFileSize",
"-",
"returns",
"final",
"erasure",
"size",
"from",
"original",
"size",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/erasure.go#L102-L113 |
125,217 | minio/minio | cmd/erasure.go | ShardFileTillOffset | func (e *Erasure) ShardFileTillOffset(startOffset, length, totalLength int64) int64 {
shardSize := e.ShardSize()
shardFileSize := e.ShardFileSize(totalLength)
endShard := (startOffset + int64(length)) / e.blockSize
tillOffset := endShard*shardSize + shardSize
if tillOffset > shardFileSize {
tillOffset = shardFil... | go | func (e *Erasure) ShardFileTillOffset(startOffset, length, totalLength int64) int64 {
shardSize := e.ShardSize()
shardFileSize := e.ShardFileSize(totalLength)
endShard := (startOffset + int64(length)) / e.blockSize
tillOffset := endShard*shardSize + shardSize
if tillOffset > shardFileSize {
tillOffset = shardFil... | [
"func",
"(",
"e",
"*",
"Erasure",
")",
"ShardFileTillOffset",
"(",
"startOffset",
",",
"length",
",",
"totalLength",
"int64",
")",
"int64",
"{",
"shardSize",
":=",
"e",
".",
"ShardSize",
"(",
")",
"\n",
"shardFileSize",
":=",
"e",
".",
"ShardFileSize",
"("... | // ShardFileTillOffset - returns the effectiv eoffset where erasure reading begins. | [
"ShardFileTillOffset",
"-",
"returns",
"the",
"effectiv",
"eoffset",
"where",
"erasure",
"reading",
"begins",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/erasure.go#L116-L125 |
125,218 | minio/minio | cmd/gateway/azure/gateway-azure.go | azureGatewayMain | func azureGatewayMain(ctx *cli.Context) {
// Validate gateway arguments.
host := ctx.Args().First()
// Validate gateway arguments.
logger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString("address"), host), "Invalid argument")
minio.StartGateway(ctx, &Azure{host})
} | go | func azureGatewayMain(ctx *cli.Context) {
// Validate gateway arguments.
host := ctx.Args().First()
// Validate gateway arguments.
logger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString("address"), host), "Invalid argument")
minio.StartGateway(ctx, &Azure{host})
} | [
"func",
"azureGatewayMain",
"(",
"ctx",
"*",
"cli",
".",
"Context",
")",
"{",
"// Validate gateway arguments.",
"host",
":=",
"ctx",
".",
"Args",
"(",
")",
".",
"First",
"(",
")",
"\n",
"// Validate gateway arguments.",
"logger",
".",
"FatalIf",
"(",
"minio",
... | // Handler for 'minio gateway azure' command line. | [
"Handler",
"for",
"minio",
"gateway",
"azure",
"command",
"line",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L128-L135 |
125,219 | minio/minio | cmd/gateway/azure/gateway-azure.go | NewGatewayLayer | func (g *Azure) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) {
var err error
// The default endpoint is the public cloud
var endpoint = azure.PublicCloud.StorageEndpointSuffix
var secure = true
// Load the endpoint url if supplied by the user.
if g.host != "" {
endpoint, secure, err = min... | go | func (g *Azure) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) {
var err error
// The default endpoint is the public cloud
var endpoint = azure.PublicCloud.StorageEndpointSuffix
var secure = true
// Load the endpoint url if supplied by the user.
if g.host != "" {
endpoint, secure, err = min... | [
"func",
"(",
"g",
"*",
"Azure",
")",
"NewGatewayLayer",
"(",
"creds",
"auth",
".",
"Credentials",
")",
"(",
"minio",
".",
"ObjectLayer",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"// The default endpoint is the public cloud",
"var",
"endpoint",
"=",... | // NewGatewayLayer initializes azure blob storage client and returns AzureObjects. | [
"NewGatewayLayer",
"initializes",
"azure",
"blob",
"storage",
"client",
"and",
"returns",
"AzureObjects",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L156-L190 |
125,220 | minio/minio | cmd/gateway/azure/gateway-azure.go | newPartMetaV1 | func newPartMetaV1(uploadID string, partID int) (partMeta *partMetadataV1) {
p := &partMetadataV1{}
p.Version = partMetaVersionV1
return p
} | go | func newPartMetaV1(uploadID string, partID int) (partMeta *partMetadataV1) {
p := &partMetadataV1{}
p.Version = partMetaVersionV1
return p
} | [
"func",
"newPartMetaV1",
"(",
"uploadID",
"string",
",",
"partID",
"int",
")",
"(",
"partMeta",
"*",
"partMetadataV1",
")",
"{",
"p",
":=",
"&",
"partMetadataV1",
"{",
"}",
"\n",
"p",
".",
"Version",
"=",
"partMetaVersionV1",
"\n",
"return",
"p",
"\n",
"... | // Returns the initialized part metadata struct | [
"Returns",
"the",
"initialized",
"part",
"metadata",
"struct"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L282-L286 |
125,221 | minio/minio | cmd/gateway/azure/gateway-azure.go | azureToObjectError | func azureToObjectError(err error, params ...string) error {
if err == nil {
return nil
}
bucket := ""
object := ""
if len(params) >= 1 {
bucket = params[0]
}
if len(params) == 2 {
object = params[1]
}
azureErr, ok := err.(storage.AzureStorageServiceError)
if !ok {
// We don't interpret non Azure er... | go | func azureToObjectError(err error, params ...string) error {
if err == nil {
return nil
}
bucket := ""
object := ""
if len(params) >= 1 {
bucket = params[0]
}
if len(params) == 2 {
object = params[1]
}
azureErr, ok := err.(storage.AzureStorageServiceError)
if !ok {
// We don't interpret non Azure er... | [
"func",
"azureToObjectError",
"(",
"err",
"error",
",",
"params",
"...",
"string",
")",
"error",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"bucket",
":=",
"\"",
"\"",
"\n",
"object",
":=",
"\"",
"\"",
"\n",
"if",
"len",
... | // Convert azure errors to minio object layer errors. | [
"Convert",
"azure",
"errors",
"to",
"minio",
"object",
"layer",
"errors",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L350-L396 |
125,222 | minio/minio | cmd/gateway/azure/gateway-azure.go | getAzureUploadID | func getAzureUploadID() (string, error) {
var id [8]byte
n, err := io.ReadFull(rand.Reader, id[:])
if err != nil {
return "", err
}
if n != len(id) {
return "", fmt.Errorf("Unexpected random data size. Expected: %d, read: %d)", len(id), n)
}
return hex.EncodeToString(id[:]), nil
} | go | func getAzureUploadID() (string, error) {
var id [8]byte
n, err := io.ReadFull(rand.Reader, id[:])
if err != nil {
return "", err
}
if n != len(id) {
return "", fmt.Errorf("Unexpected random data size. Expected: %d, read: %d)", len(id), n)
}
return hex.EncodeToString(id[:]), nil
} | [
"func",
"getAzureUploadID",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"var",
"id",
"[",
"8",
"]",
"byte",
"\n\n",
"n",
",",
"err",
":=",
"io",
".",
"ReadFull",
"(",
"rand",
".",
"Reader",
",",
"id",
"[",
":",
"]",
")",
"\n",
"if",
"err",... | // getAzureUploadID - returns new upload ID which is hex encoded 8 bytes random value.
// this 8 byte restriction is needed because Azure block id has a restriction of length
// upto 8 bytes. | [
"getAzureUploadID",
"-",
"returns",
"new",
"upload",
"ID",
"which",
"is",
"hex",
"encoded",
"8",
"bytes",
"random",
"value",
".",
"this",
"8",
"byte",
"restriction",
"is",
"needed",
"because",
"Azure",
"block",
"id",
"has",
"a",
"restriction",
"of",
"length"... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L401-L413 |
125,223 | minio/minio | cmd/gateway/azure/gateway-azure.go | checkAzureUploadID | func checkAzureUploadID(ctx context.Context, uploadID string) (err error) {
if len(uploadID) != 16 {
return minio.MalformedUploadID{
UploadID: uploadID,
}
}
if _, err = hex.DecodeString(uploadID); err != nil {
return minio.MalformedUploadID{
UploadID: uploadID,
}
}
return nil
} | go | func checkAzureUploadID(ctx context.Context, uploadID string) (err error) {
if len(uploadID) != 16 {
return minio.MalformedUploadID{
UploadID: uploadID,
}
}
if _, err = hex.DecodeString(uploadID); err != nil {
return minio.MalformedUploadID{
UploadID: uploadID,
}
}
return nil
} | [
"func",
"checkAzureUploadID",
"(",
"ctx",
"context",
".",
"Context",
",",
"uploadID",
"string",
")",
"(",
"err",
"error",
")",
"{",
"if",
"len",
"(",
"uploadID",
")",
"!=",
"16",
"{",
"return",
"minio",
".",
"MalformedUploadID",
"{",
"UploadID",
":",
"up... | // checkAzureUploadID - returns error in case of given string is upload ID. | [
"checkAzureUploadID",
"-",
"returns",
"error",
"in",
"case",
"of",
"given",
"string",
"is",
"upload",
"ID",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L416-L430 |
125,224 | minio/minio | cmd/gateway/azure/gateway-azure.go | parseAzurePart | func parseAzurePart(metaPartFileName, prefix string) (partID int, err error) {
partStr := strings.TrimPrefix(metaPartFileName, prefix+"/")
if partID, err = strconv.Atoi(partStr); err != nil || partID <= 0 {
err = fmt.Errorf("invalid part number in block id '%s'", string(partID))
return
}
return
} | go | func parseAzurePart(metaPartFileName, prefix string) (partID int, err error) {
partStr := strings.TrimPrefix(metaPartFileName, prefix+"/")
if partID, err = strconv.Atoi(partStr); err != nil || partID <= 0 {
err = fmt.Errorf("invalid part number in block id '%s'", string(partID))
return
}
return
} | [
"func",
"parseAzurePart",
"(",
"metaPartFileName",
",",
"prefix",
"string",
")",
"(",
"partID",
"int",
",",
"err",
"error",
")",
"{",
"partStr",
":=",
"strings",
".",
"TrimPrefix",
"(",
"metaPartFileName",
",",
"prefix",
"+",
"\"",
"\"",
")",
"\n",
"if",
... | // parses partID from part metadata file name | [
"parses",
"partID",
"from",
"part",
"metadata",
"file",
"name"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L433-L440 |
125,225 | minio/minio | cmd/gateway/azure/gateway-azure.go | StorageInfo | func (a *azureObjects) StorageInfo(ctx context.Context) (si minio.StorageInfo) {
return si
} | go | func (a *azureObjects) StorageInfo(ctx context.Context) (si minio.StorageInfo) {
return si
} | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"StorageInfo",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"si",
"minio",
".",
"StorageInfo",
")",
"{",
"return",
"si",
"\n",
"}"
] | // StorageInfo - Not relevant to Azure backend. | [
"StorageInfo",
"-",
"Not",
"relevant",
"to",
"Azure",
"backend",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L449-L451 |
125,226 | minio/minio | cmd/gateway/azure/gateway-azure.go | MakeBucketWithLocation | func (a *azureObjects) MakeBucketWithLocation(ctx context.Context, bucket, location string) error {
// Verify if bucket (container-name) is valid.
// IsValidBucketName has same restrictions as container names mentioned
// in azure documentation, so we will simply use the same function here.
// Ref - https://docs.mi... | go | func (a *azureObjects) MakeBucketWithLocation(ctx context.Context, bucket, location string) error {
// Verify if bucket (container-name) is valid.
// IsValidBucketName has same restrictions as container names mentioned
// in azure documentation, so we will simply use the same function here.
// Ref - https://docs.mi... | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"MakeBucketWithLocation",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"location",
"string",
")",
"error",
"{",
"// Verify if bucket (container-name) is valid.",
"// IsValidBucketName has same restrictions as contain... | // MakeBucketWithLocation - Create a new container on azure backend. | [
"MakeBucketWithLocation",
"-",
"Create",
"a",
"new",
"container",
"on",
"azure",
"backend",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L454-L468 |
125,227 | minio/minio | cmd/gateway/azure/gateway-azure.go | ListBuckets | func (a *azureObjects) ListBuckets(ctx context.Context) (buckets []minio.BucketInfo, err error) {
resp, err := a.client.ListContainers(storage.ListContainersParameters{})
if err != nil {
return nil, azureToObjectError(err)
}
for _, container := range resp.Containers {
t, e := time.Parse(time.RFC1123, container.... | go | func (a *azureObjects) ListBuckets(ctx context.Context) (buckets []minio.BucketInfo, err error) {
resp, err := a.client.ListContainers(storage.ListContainersParameters{})
if err != nil {
return nil, azureToObjectError(err)
}
for _, container := range resp.Containers {
t, e := time.Parse(time.RFC1123, container.... | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"ListBuckets",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"buckets",
"[",
"]",
"minio",
".",
"BucketInfo",
",",
"err",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"a",
".",
"client",
".",
"ListContai... | // ListBuckets - Lists all azure containers, uses Azure equivalent ListContainers. | [
"ListBuckets",
"-",
"Lists",
"all",
"azure",
"containers",
"uses",
"Azure",
"equivalent",
"ListContainers",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L495-L512 |
125,228 | minio/minio | cmd/gateway/azure/gateway-azure.go | DeleteBucket | func (a *azureObjects) DeleteBucket(ctx context.Context, bucket string) error {
container := a.client.GetContainerReference(bucket)
err := container.Delete(nil)
return azureToObjectError(err, bucket)
} | go | func (a *azureObjects) DeleteBucket(ctx context.Context, bucket string) error {
container := a.client.GetContainerReference(bucket)
err := container.Delete(nil)
return azureToObjectError(err, bucket)
} | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"DeleteBucket",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
"string",
")",
"error",
"{",
"container",
":=",
"a",
".",
"client",
".",
"GetContainerReference",
"(",
"bucket",
")",
"\n",
"err",
":=",
"co... | // DeleteBucket - delete a container on azure, uses Azure equivalent DeleteContainer. | [
"DeleteBucket",
"-",
"delete",
"a",
"container",
"on",
"azure",
"uses",
"Azure",
"equivalent",
"DeleteContainer",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L515-L519 |
125,229 | minio/minio | cmd/gateway/azure/gateway-azure.go | GetObject | func (a *azureObjects) GetObject(ctx context.Context, bucket, object string, startOffset int64, length int64, writer io.Writer, etag string, opts minio.ObjectOptions) error {
// startOffset cannot be negative.
if startOffset < 0 {
return azureToObjectError(minio.InvalidRange{}, bucket, object)
}
blobRange := &st... | go | func (a *azureObjects) GetObject(ctx context.Context, bucket, object string, startOffset int64, length int64, writer io.Writer, etag string, opts minio.ObjectOptions) error {
// startOffset cannot be negative.
if startOffset < 0 {
return azureToObjectError(minio.InvalidRange{}, bucket, object)
}
blobRange := &st... | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"GetObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
",",
"startOffset",
"int64",
",",
"length",
"int64",
",",
"writer",
"io",
".",
"Writer",
",",
"etag",
"string",
",",
... | // GetObject - reads an object from azure. Supports additional
// parameters like offset and length which are synonymous with
// HTTP Range requests.
//
// startOffset indicates the starting read location of the object.
// length indicates the total length of the object. | [
"GetObject",
"-",
"reads",
"an",
"object",
"from",
"azure",
".",
"Supports",
"additional",
"parameters",
"like",
"offset",
"and",
"length",
"which",
"are",
"synonymous",
"with",
"HTTP",
"Range",
"requests",
".",
"startOffset",
"indicates",
"the",
"starting",
"re... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L687-L714 |
125,230 | minio/minio | cmd/gateway/azure/gateway-azure.go | GetObjectInfo | func (a *azureObjects) GetObjectInfo(ctx context.Context, bucket, object string, opts minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) {
blob := a.client.GetContainerReference(bucket).GetBlobReference(object)
err = blob.GetProperties(nil)
if err != nil {
return objInfo, azureToObjectError(err, bucket, ob... | go | func (a *azureObjects) GetObjectInfo(ctx context.Context, bucket, object string, opts minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) {
blob := a.client.GetContainerReference(bucket).GetBlobReference(object)
err = blob.GetProperties(nil)
if err != nil {
return objInfo, azureToObjectError(err, bucket, ob... | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"GetObjectInfo",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
",",
"opts",
"minio",
".",
"ObjectOptions",
")",
"(",
"objInfo",
"minio",
".",
"ObjectInfo",
",",
"err",
"error",
... | // GetObjectInfo - reads blob metadata properties and replies back minio.ObjectInfo,
// uses zure equivalent GetBlobProperties. | [
"GetObjectInfo",
"-",
"reads",
"blob",
"metadata",
"properties",
"and",
"replies",
"back",
"minio",
".",
"ObjectInfo",
"uses",
"zure",
"equivalent",
"GetBlobProperties",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L718-L758 |
125,231 | minio/minio | cmd/gateway/azure/gateway-azure.go | CopyObject | func (a *azureObjects) CopyObject(ctx context.Context, srcBucket, srcObject, destBucket, destObject string, srcInfo minio.ObjectInfo, srcOpts, dstOpts minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) {
if srcOpts.CheckCopyPrecondFn != nil && srcOpts.CheckCopyPrecondFn(srcInfo, "") {
return minio.ObjectInfo... | go | func (a *azureObjects) CopyObject(ctx context.Context, srcBucket, srcObject, destBucket, destObject string, srcInfo minio.ObjectInfo, srcOpts, dstOpts minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) {
if srcOpts.CheckCopyPrecondFn != nil && srcOpts.CheckCopyPrecondFn(srcInfo, "") {
return minio.ObjectInfo... | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"CopyObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"srcBucket",
",",
"srcObject",
",",
"destBucket",
",",
"destObject",
"string",
",",
"srcInfo",
"minio",
".",
"ObjectInfo",
",",
"srcOpts",
",",
"dstOpts",
... | // CopyObject - Copies a blob from source container to destination container.
// Uses Azure equivalent CopyBlob API. | [
"CopyObject",
"-",
"Copies",
"a",
"blob",
"from",
"source",
"container",
"to",
"destination",
"container",
".",
"Uses",
"Azure",
"equivalent",
"CopyBlob",
"API",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L855-L886 |
125,232 | minio/minio | cmd/gateway/azure/gateway-azure.go | DeleteObject | func (a *azureObjects) DeleteObject(ctx context.Context, bucket, object string) error {
blob := a.client.GetContainerReference(bucket).GetBlobReference(object)
err := blob.Delete(nil)
if err != nil {
return azureToObjectError(err, bucket, object)
}
return nil
} | go | func (a *azureObjects) DeleteObject(ctx context.Context, bucket, object string) error {
blob := a.client.GetContainerReference(bucket).GetBlobReference(object)
err := blob.Delete(nil)
if err != nil {
return azureToObjectError(err, bucket, object)
}
return nil
} | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"DeleteObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
")",
"error",
"{",
"blob",
":=",
"a",
".",
"client",
".",
"GetContainerReference",
"(",
"bucket",
")",
".",
"GetBlo... | // DeleteObject - Deletes a blob on azure container, uses Azure
// equivalent DeleteBlob API. | [
"DeleteObject",
"-",
"Deletes",
"a",
"blob",
"on",
"azure",
"container",
"uses",
"Azure",
"equivalent",
"DeleteBlob",
"API",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L890-L897 |
125,233 | minio/minio | cmd/gateway/azure/gateway-azure.go | ListMultipartUploads | func (a *azureObjects) ListMultipartUploads(ctx context.Context, bucket, prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (result minio.ListMultipartsInfo, err error) {
// It's decided not to support List Multipart Uploads, hence returning empty result.
return result, nil
} | go | func (a *azureObjects) ListMultipartUploads(ctx context.Context, bucket, prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (result minio.ListMultipartsInfo, err error) {
// It's decided not to support List Multipart Uploads, hence returning empty result.
return result, nil
} | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"ListMultipartUploads",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"prefix",
",",
"keyMarker",
",",
"uploadIDMarker",
",",
"delimiter",
"string",
",",
"maxUploads",
"int",
")",
"(",
"result",
"minio... | // ListMultipartUploads - It's decided not to support List Multipart Uploads, hence returning empty result. | [
"ListMultipartUploads",
"-",
"It",
"s",
"decided",
"not",
"to",
"support",
"List",
"Multipart",
"Uploads",
"hence",
"returning",
"empty",
"result",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L900-L903 |
125,234 | minio/minio | cmd/gateway/azure/gateway-azure.go | getAzureMetadataPartName | func getAzureMetadataPartName(objectName, uploadID string, partID int) string {
partMetaPrefix := getAzureMetadataPartPrefix(uploadID, objectName)
return path.Join(partMetaPrefix, fmt.Sprintf("%d", partID))
} | go | func getAzureMetadataPartName(objectName, uploadID string, partID int) string {
partMetaPrefix := getAzureMetadataPartPrefix(uploadID, objectName)
return path.Join(partMetaPrefix, fmt.Sprintf("%d", partID))
} | [
"func",
"getAzureMetadataPartName",
"(",
"objectName",
",",
"uploadID",
"string",
",",
"partID",
"int",
")",
"string",
"{",
"partMetaPrefix",
":=",
"getAzureMetadataPartPrefix",
"(",
"uploadID",
",",
"objectName",
")",
"\n",
"return",
"path",
".",
"Join",
"(",
"... | // gets the name of part metadata file for multipart upload operations | [
"gets",
"the",
"name",
"of",
"part",
"metadata",
"file",
"for",
"multipart",
"upload",
"operations"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L915-L918 |
125,235 | minio/minio | cmd/gateway/azure/gateway-azure.go | getAzureMetadataPartPrefix | func getAzureMetadataPartPrefix(uploadID, objectName string) string {
return fmt.Sprintf(metadataPartNamePrefix, uploadID, sha256.Sum256([]byte(objectName)))
} | go | func getAzureMetadataPartPrefix(uploadID, objectName string) string {
return fmt.Sprintf(metadataPartNamePrefix, uploadID, sha256.Sum256([]byte(objectName)))
} | [
"func",
"getAzureMetadataPartPrefix",
"(",
"uploadID",
",",
"objectName",
"string",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"metadataPartNamePrefix",
",",
"uploadID",
",",
"sha256",
".",
"Sum256",
"(",
"[",
"]",
"byte",
"(",
"objectName",
")"... | // gets the prefix of part metadata file | [
"gets",
"the",
"prefix",
"of",
"part",
"metadata",
"file"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L921-L923 |
125,236 | minio/minio | cmd/gateway/azure/gateway-azure.go | NewMultipartUpload | func (a *azureObjects) NewMultipartUpload(ctx context.Context, bucket, object string, opts minio.ObjectOptions) (uploadID string, err error) {
uploadID, err = getAzureUploadID()
if err != nil {
logger.LogIf(ctx, err)
return "", err
}
metadataObject := getAzureMetadataObjectName(object, uploadID)
var jsonData ... | go | func (a *azureObjects) NewMultipartUpload(ctx context.Context, bucket, object string, opts minio.ObjectOptions) (uploadID string, err error) {
uploadID, err = getAzureUploadID()
if err != nil {
logger.LogIf(ctx, err)
return "", err
}
metadataObject := getAzureMetadataObjectName(object, uploadID)
var jsonData ... | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"NewMultipartUpload",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
",",
"opts",
"minio",
".",
"ObjectOptions",
")",
"(",
"uploadID",
"string",
",",
"err",
"error",
")",
"{",
"u... | // NewMultipartUpload - Use Azure equivalent CreateBlockBlob. | [
"NewMultipartUpload",
"-",
"Use",
"Azure",
"equivalent",
"CreateBlockBlob",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L943-L964 |
125,237 | minio/minio | cmd/gateway/azure/gateway-azure.go | PutObjectPart | func (a *azureObjects) PutObjectPart(ctx context.Context, bucket, object, uploadID string, partID int, r *minio.PutObjReader, opts minio.ObjectOptions) (info minio.PartInfo, err error) {
data := r.Reader
if err = a.checkUploadIDExists(ctx, bucket, object, uploadID); err != nil {
return info, err
}
if err = check... | go | func (a *azureObjects) PutObjectPart(ctx context.Context, bucket, object, uploadID string, partID int, r *minio.PutObjReader, opts minio.ObjectOptions) (info minio.PartInfo, err error) {
data := r.Reader
if err = a.checkUploadIDExists(ctx, bucket, object, uploadID); err != nil {
return info, err
}
if err = check... | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"PutObjectPart",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
",",
"uploadID",
"string",
",",
"partID",
"int",
",",
"r",
"*",
"minio",
".",
"PutObjReader",
",",
"opts",
"minio",
".",
"... | // PutObjectPart - Use Azure equivalent PutBlockWithLength. | [
"PutObjectPart",
"-",
"Use",
"Azure",
"equivalent",
"PutBlockWithLength",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L967-L1023 |
125,238 | minio/minio | cmd/gateway/azure/gateway-azure.go | AbortMultipartUpload | func (a *azureObjects) AbortMultipartUpload(ctx context.Context, bucket, object, uploadID string) (err error) {
if err = a.checkUploadIDExists(ctx, bucket, object, uploadID); err != nil {
return err
}
var partNumberMarker int
for {
lpi, err := a.ListObjectParts(ctx, bucket, object, uploadID, partNumberMarker, m... | go | func (a *azureObjects) AbortMultipartUpload(ctx context.Context, bucket, object, uploadID string) (err error) {
if err = a.checkUploadIDExists(ctx, bucket, object, uploadID); err != nil {
return err
}
var partNumberMarker int
for {
lpi, err := a.ListObjectParts(ctx, bucket, object, uploadID, partNumberMarker, m... | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"AbortMultipartUpload",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
",",
"uploadID",
"string",
")",
"(",
"err",
"error",
")",
"{",
"if",
"err",
"=",
"a",
".",
"checkUploadIDExists",
"("... | // AbortMultipartUpload - Not Implemented.
// There is no corresponding API in azure to abort an incomplete upload. The uncommmitted blocks
// gets deleted after one week. | [
"AbortMultipartUpload",
"-",
"Not",
"Implemented",
".",
"There",
"is",
"no",
"corresponding",
"API",
"in",
"azure",
"to",
"abort",
"an",
"incomplete",
"upload",
".",
"The",
"uncommmitted",
"blocks",
"gets",
"deleted",
"after",
"one",
"week",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L1121-L1145 |
125,239 | minio/minio | cmd/gateway/azure/gateway-azure.go | DeleteBucketPolicy | func (a *azureObjects) DeleteBucketPolicy(ctx context.Context, bucket string) error {
perm := storage.ContainerPermissions{
AccessType: storage.ContainerAccessTypePrivate,
AccessPolicies: nil,
}
container := a.client.GetContainerReference(bucket)
err := container.SetPermissions(perm, nil)
return azureToObj... | go | func (a *azureObjects) DeleteBucketPolicy(ctx context.Context, bucket string) error {
perm := storage.ContainerPermissions{
AccessType: storage.ContainerAccessTypePrivate,
AccessPolicies: nil,
}
container := a.client.GetContainerReference(bucket)
err := container.SetPermissions(perm, nil)
return azureToObj... | [
"func",
"(",
"a",
"*",
"azureObjects",
")",
"DeleteBucketPolicy",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
"string",
")",
"error",
"{",
"perm",
":=",
"storage",
".",
"ContainerPermissions",
"{",
"AccessType",
":",
"storage",
".",
"ContainerAccessT... | // DeleteBucketPolicy - Set the container ACL to "private" | [
"DeleteBucketPolicy",
"-",
"Set",
"the",
"container",
"ACL",
"to",
"private"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/azure/gateway-azure.go#L1323-L1331 |
125,240 | minio/minio | cmd/logger/logonce.go | logOnceIf | func (l *logOnceType) logOnceIf(ctx context.Context, err error, id interface{}) {
if err == nil {
return
}
l.Lock()
shouldLog := false
prevErr := l.IDMap[id]
if prevErr == nil {
l.IDMap[id] = err
shouldLog = true
} else {
if prevErr.Error() != err.Error() {
l.IDMap[id] = err
shouldLog = true
}
}... | go | func (l *logOnceType) logOnceIf(ctx context.Context, err error, id interface{}) {
if err == nil {
return
}
l.Lock()
shouldLog := false
prevErr := l.IDMap[id]
if prevErr == nil {
l.IDMap[id] = err
shouldLog = true
} else {
if prevErr.Error() != err.Error() {
l.IDMap[id] = err
shouldLog = true
}
}... | [
"func",
"(",
"l",
"*",
"logOnceType",
")",
"logOnceIf",
"(",
"ctx",
"context",
".",
"Context",
",",
"err",
"error",
",",
"id",
"interface",
"{",
"}",
")",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"l",
".",
"Lock",
"(",
")",
... | // One log message per error. | [
"One",
"log",
"message",
"per",
"error",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/logger/logonce.go#L33-L54 |
125,241 | minio/minio | cmd/logger/logonce.go | cleanupRoutine | func (l *logOnceType) cleanupRoutine() {
for {
l.Lock()
l.IDMap = make(map[interface{}]error)
l.Unlock()
time.Sleep(30 * time.Minute)
}
} | go | func (l *logOnceType) cleanupRoutine() {
for {
l.Lock()
l.IDMap = make(map[interface{}]error)
l.Unlock()
time.Sleep(30 * time.Minute)
}
} | [
"func",
"(",
"l",
"*",
"logOnceType",
")",
"cleanupRoutine",
"(",
")",
"{",
"for",
"{",
"l",
".",
"Lock",
"(",
")",
"\n",
"l",
".",
"IDMap",
"=",
"make",
"(",
"map",
"[",
"interface",
"{",
"}",
"]",
"error",
")",
"\n",
"l",
".",
"Unlock",
"(",
... | // Cleanup the map every 30 minutes so that the log message is printed again for the user to notice. | [
"Cleanup",
"the",
"map",
"every",
"30",
"minutes",
"so",
"that",
"the",
"log",
"message",
"is",
"printed",
"again",
"for",
"the",
"user",
"to",
"notice",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/logger/logonce.go#L57-L65 |
125,242 | minio/minio | cmd/xl-v1-object.go | putObjectDir | func (xl xlObjects) putObjectDir(ctx context.Context, bucket, object string, writeQuorum int) error {
var wg = &sync.WaitGroup{}
errs := make([]error, len(xl.getDisks()))
// Prepare object creation in all disks
for index, disk := range xl.getDisks() {
if disk == nil {
continue
}
wg.Add(1)
go func(index ... | go | func (xl xlObjects) putObjectDir(ctx context.Context, bucket, object string, writeQuorum int) error {
var wg = &sync.WaitGroup{}
errs := make([]error, len(xl.getDisks()))
// Prepare object creation in all disks
for index, disk := range xl.getDisks() {
if disk == nil {
continue
}
wg.Add(1)
go func(index ... | [
"func",
"(",
"xl",
"xlObjects",
")",
"putObjectDir",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
",",
"writeQuorum",
"int",
")",
"error",
"{",
"var",
"wg",
"=",
"&",
"sync",
".",
"WaitGroup",
"{",
"}",
"\n\n",
"errs",... | // putObjectDir hints the bottom layer to create a new directory. | [
"putObjectDir",
"hints",
"the",
"bottom",
"layer",
"to",
"create",
"a",
"new",
"directory",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-object.go#L37-L57 |
125,243 | minio/minio | cmd/xl-v1-object.go | GetObject | func (xl xlObjects) GetObject(ctx context.Context, bucket, object string, startOffset int64, length int64, writer io.Writer, etag string, opts ObjectOptions) error {
// Lock the object before reading.
objectLock := xl.nsMutex.NewNSLock(bucket, object)
if err := objectLock.GetRLock(globalObjectTimeout); err != nil {
... | go | func (xl xlObjects) GetObject(ctx context.Context, bucket, object string, startOffset int64, length int64, writer io.Writer, etag string, opts ObjectOptions) error {
// Lock the object before reading.
objectLock := xl.nsMutex.NewNSLock(bucket, object)
if err := objectLock.GetRLock(globalObjectTimeout); err != nil {
... | [
"func",
"(",
"xl",
"xlObjects",
")",
"GetObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
",",
"startOffset",
"int64",
",",
"length",
"int64",
",",
"writer",
"io",
".",
"Writer",
",",
"etag",
"string",
",",
"opts",
... | // GetObject - reads an object erasured coded across multiple
// disks. Supports additional parameters like offset and length
// which are synonymous with HTTP Range requests.
//
// startOffset indicates the starting read location of the object.
// length indicates the total length of the object. | [
"GetObject",
"-",
"reads",
"an",
"object",
"erasured",
"coded",
"across",
"multiple",
"disks",
".",
"Supports",
"additional",
"parameters",
"like",
"offset",
"and",
"length",
"which",
"are",
"synonymous",
"with",
"HTTP",
"Range",
"requests",
".",
"startOffset",
... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-object.go#L217-L225 |
125,244 | minio/minio | cmd/xl-v1-object.go | getObjectInfoDir | func (xl xlObjects) getObjectInfoDir(ctx context.Context, bucket, object string) (oi ObjectInfo, err error) {
var wg = &sync.WaitGroup{}
errs := make([]error, len(xl.getDisks()))
// Prepare object creation in a all disks
for index, disk := range xl.getDisks() {
if disk == nil {
continue
}
wg.Add(1)
go f... | go | func (xl xlObjects) getObjectInfoDir(ctx context.Context, bucket, object string) (oi ObjectInfo, err error) {
var wg = &sync.WaitGroup{}
errs := make([]error, len(xl.getDisks()))
// Prepare object creation in a all disks
for index, disk := range xl.getDisks() {
if disk == nil {
continue
}
wg.Add(1)
go f... | [
"func",
"(",
"xl",
"xlObjects",
")",
"getObjectInfoDir",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
")",
"(",
"oi",
"ObjectInfo",
",",
"err",
"error",
")",
"{",
"var",
"wg",
"=",
"&",
"sync",
".",
"WaitGroup",
"{",
... | // getObjectInfoDir - This getObjectInfo is specific to object directory lookup. | [
"getObjectInfoDir",
"-",
"This",
"getObjectInfo",
"is",
"specific",
"to",
"object",
"directory",
"lookup",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-object.go#L365-L395 |
125,245 | minio/minio | cmd/xl-v1-object.go | rename | func rename(ctx context.Context, disks []StorageAPI, srcBucket, srcEntry, dstBucket, dstEntry string, isDir bool, writeQuorum int, ignoredErr []error) ([]StorageAPI, error) {
// Initialize sync waitgroup.
var wg = &sync.WaitGroup{}
// Initialize list of errors.
var errs = make([]error, len(disks))
if isDir {
d... | go | func rename(ctx context.Context, disks []StorageAPI, srcBucket, srcEntry, dstBucket, dstEntry string, isDir bool, writeQuorum int, ignoredErr []error) ([]StorageAPI, error) {
// Initialize sync waitgroup.
var wg = &sync.WaitGroup{}
// Initialize list of errors.
var errs = make([]error, len(disks))
if isDir {
d... | [
"func",
"rename",
"(",
"ctx",
"context",
".",
"Context",
",",
"disks",
"[",
"]",
"StorageAPI",
",",
"srcBucket",
",",
"srcEntry",
",",
"dstBucket",
",",
"dstEntry",
"string",
",",
"isDir",
"bool",
",",
"writeQuorum",
"int",
",",
"ignoredErr",
"[",
"]",
"... | // rename - common function that renamePart and renameObject use to rename
// the respective underlying storage layer representations. | [
"rename",
"-",
"common",
"function",
"that",
"renamePart",
"and",
"renameObject",
"use",
"to",
"rename",
"the",
"respective",
"underlying",
"storage",
"layer",
"representations",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-object.go#L482-L522 |
125,246 | minio/minio | cmd/xl-v1-object.go | PutObject | func (xl xlObjects) PutObject(ctx context.Context, bucket string, object string, data *PutObjReader, opts ObjectOptions) (objInfo ObjectInfo, err error) {
// Validate put object input args.
if err = checkPutObjectArgs(ctx, bucket, object, xl, data.Size()); err != nil {
return ObjectInfo{}, err
}
// Lock the obje... | go | func (xl xlObjects) PutObject(ctx context.Context, bucket string, object string, data *PutObjReader, opts ObjectOptions) (objInfo ObjectInfo, err error) {
// Validate put object input args.
if err = checkPutObjectArgs(ctx, bucket, object, xl, data.Size()); err != nil {
return ObjectInfo{}, err
}
// Lock the obje... | [
"func",
"(",
"xl",
"xlObjects",
")",
"PutObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
"string",
",",
"object",
"string",
",",
"data",
"*",
"PutObjReader",
",",
"opts",
"ObjectOptions",
")",
"(",
"objInfo",
"ObjectInfo",
",",
"err",
"error... | // PutObject - creates an object upon reading from the input stream
// until EOF, erasure codes the data across all disk and additionally
// writes `xl.json` which carries the necessary metadata for future
// object operations. | [
"PutObject",
"-",
"creates",
"an",
"object",
"upon",
"reading",
"from",
"the",
"input",
"stream",
"until",
"EOF",
"erasure",
"codes",
"the",
"data",
"across",
"all",
"disk",
"and",
"additionally",
"writes",
"xl",
".",
"json",
"which",
"carries",
"the",
"nece... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-object.go#L528-L541 |
125,247 | minio/minio | cmd/xl-v1-object.go | deleteObject | func (xl xlObjects) deleteObject(ctx context.Context, bucket, object string, writeQuorum int, isDir bool) error {
var disks []StorageAPI
var err error
tmpObj := mustGetUUID()
if bucket == minioMetaTmpBucket {
tmpObj = object
disks = xl.getDisks()
} else {
// Rename the current object while requiring write q... | go | func (xl xlObjects) deleteObject(ctx context.Context, bucket, object string, writeQuorum int, isDir bool) error {
var disks []StorageAPI
var err error
tmpObj := mustGetUUID()
if bucket == minioMetaTmpBucket {
tmpObj = object
disks = xl.getDisks()
} else {
// Rename the current object while requiring write q... | [
"func",
"(",
"xl",
"xlObjects",
")",
"deleteObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
",",
"writeQuorum",
"int",
",",
"isDir",
"bool",
")",
"error",
"{",
"var",
"disks",
"[",
"]",
"StorageAPI",
"\n",
"var",
... | // deleteObject - wrapper for delete object, deletes an object from
// all the disks in parallel, including `xl.json` associated with the
// object. | [
"deleteObject",
"-",
"wrapper",
"for",
"delete",
"object",
"deletes",
"an",
"object",
"from",
"all",
"the",
"disks",
"in",
"parallel",
"including",
"xl",
".",
"json",
"associated",
"with",
"the",
"object",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-object.go#L799-L856 |
125,248 | minio/minio | cmd/xl-v1-object.go | DeleteObject | func (xl xlObjects) DeleteObject(ctx context.Context, bucket, object string) (err error) {
// Acquire a write lock before deleting the object.
objectLock := xl.nsMutex.NewNSLock(bucket, object)
if perr := objectLock.GetLock(globalOperationTimeout); perr != nil {
return perr
}
defer objectLock.Unlock()
if err =... | go | func (xl xlObjects) DeleteObject(ctx context.Context, bucket, object string) (err error) {
// Acquire a write lock before deleting the object.
objectLock := xl.nsMutex.NewNSLock(bucket, object)
if perr := objectLock.GetLock(globalOperationTimeout); perr != nil {
return perr
}
defer objectLock.Unlock()
if err =... | [
"func",
"(",
"xl",
"xlObjects",
")",
"DeleteObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
")",
"(",
"err",
"error",
")",
"{",
"// Acquire a write lock before deleting the object.",
"objectLock",
":=",
"xl",
".",
"nsMutex... | // DeleteObject - deletes an object, this call doesn't necessary reply
// any error as it is not necessary for the handler to reply back a
// response to the client request. | [
"DeleteObject",
"-",
"deletes",
"an",
"object",
"this",
"call",
"doesn",
"t",
"necessary",
"reply",
"any",
"error",
"as",
"it",
"is",
"not",
"necessary",
"for",
"the",
"handler",
"to",
"reply",
"back",
"a",
"response",
"to",
"the",
"client",
"request",
"."... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-object.go#L861-L908 |
125,249 | minio/minio | cmd/bitrot-whole.go | newWholeBitrotWriter | func newWholeBitrotWriter(disk StorageAPI, volume, filePath string, algo BitrotAlgorithm, shardSize int64) io.WriteCloser {
return &wholeBitrotWriter{disk, volume, filePath, shardSize, algo.New()}
} | go | func newWholeBitrotWriter(disk StorageAPI, volume, filePath string, algo BitrotAlgorithm, shardSize int64) io.WriteCloser {
return &wholeBitrotWriter{disk, volume, filePath, shardSize, algo.New()}
} | [
"func",
"newWholeBitrotWriter",
"(",
"disk",
"StorageAPI",
",",
"volume",
",",
"filePath",
"string",
",",
"algo",
"BitrotAlgorithm",
",",
"shardSize",
"int64",
")",
"io",
".",
"WriteCloser",
"{",
"return",
"&",
"wholeBitrotWriter",
"{",
"disk",
",",
"volume",
... | // Returns whole-file bitrot writer. | [
"Returns",
"whole",
"-",
"file",
"bitrot",
"writer",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/bitrot-whole.go#L55-L57 |
125,250 | minio/minio | cmd/bitrot-whole.go | newWholeBitrotReader | func newWholeBitrotReader(disk StorageAPI, volume, filePath string, algo BitrotAlgorithm, tillOffset int64, sum []byte) *wholeBitrotReader {
return &wholeBitrotReader{
disk: disk,
volume: volume,
filePath: filePath,
verifier: &BitrotVerifier{algo, sum},
tillOffset: tillOffset,
buf: nil... | go | func newWholeBitrotReader(disk StorageAPI, volume, filePath string, algo BitrotAlgorithm, tillOffset int64, sum []byte) *wholeBitrotReader {
return &wholeBitrotReader{
disk: disk,
volume: volume,
filePath: filePath,
verifier: &BitrotVerifier{algo, sum},
tillOffset: tillOffset,
buf: nil... | [
"func",
"newWholeBitrotReader",
"(",
"disk",
"StorageAPI",
",",
"volume",
",",
"filePath",
"string",
",",
"algo",
"BitrotAlgorithm",
",",
"tillOffset",
"int64",
",",
"sum",
"[",
"]",
"byte",
")",
"*",
"wholeBitrotReader",
"{",
"return",
"&",
"wholeBitrotReader",... | // Returns whole-file bitrot reader. | [
"Returns",
"whole",
"-",
"file",
"bitrot",
"reader",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/bitrot-whole.go#L89-L98 |
125,251 | minio/minio | cmd/metrics-router.go | registerMetricsRouter | func registerMetricsRouter(router *mux.Router) {
// metrics router
metricsRouter := router.NewRoute().PathPrefix(minioReservedBucketPath).Subrouter()
metricsRouter.Handle(prometheusMetricsPath, metricsHandler())
} | go | func registerMetricsRouter(router *mux.Router) {
// metrics router
metricsRouter := router.NewRoute().PathPrefix(minioReservedBucketPath).Subrouter()
metricsRouter.Handle(prometheusMetricsPath, metricsHandler())
} | [
"func",
"registerMetricsRouter",
"(",
"router",
"*",
"mux",
".",
"Router",
")",
"{",
"// metrics router",
"metricsRouter",
":=",
"router",
".",
"NewRoute",
"(",
")",
".",
"PathPrefix",
"(",
"minioReservedBucketPath",
")",
".",
"Subrouter",
"(",
")",
"\n",
"met... | // registerMetricsRouter - add handler functions for metrics. | [
"registerMetricsRouter",
"-",
"add",
"handler",
"functions",
"for",
"metrics",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/metrics-router.go#L28-L32 |
125,252 | minio/minio | cmd/format-disk-cache.go | newFormatCacheV1 | func newFormatCacheV1(drives []string) []*formatCacheV1 {
diskCount := len(drives)
var disks = make([]string, diskCount)
var formats = make([]*formatCacheV1, diskCount)
for i := 0; i < diskCount; i++ {
format := &formatCacheV1{}
format.Version = formatMetaVersion1
format.Format = formatCache
format.Cache.... | go | func newFormatCacheV1(drives []string) []*formatCacheV1 {
diskCount := len(drives)
var disks = make([]string, diskCount)
var formats = make([]*formatCacheV1, diskCount)
for i := 0; i < diskCount; i++ {
format := &formatCacheV1{}
format.Version = formatMetaVersion1
format.Format = formatCache
format.Cache.... | [
"func",
"newFormatCacheV1",
"(",
"drives",
"[",
"]",
"string",
")",
"[",
"]",
"*",
"formatCacheV1",
"{",
"diskCount",
":=",
"len",
"(",
"drives",
")",
"\n",
"var",
"disks",
"=",
"make",
"(",
"[",
"]",
"string",
",",
"diskCount",
")",
"\n\n",
"var",
"... | // Return a slice of format, to be used to format uninitialized disks. | [
"Return",
"a",
"slice",
"of",
"format",
"to",
"be",
"used",
"to",
"format",
"uninitialized",
"disks",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L67-L88 |
125,253 | minio/minio | cmd/format-disk-cache.go | createFormatCache | func createFormatCache(fsFormatPath string, format *formatCacheV1) error {
// open file using READ & WRITE permission
var file, err = os.OpenFile(fsFormatPath, os.O_RDWR|os.O_CREATE, 0600)
if err != nil {
return err
}
// Close the locked file upon return.
defer file.Close()
fi, err := file.Stat()
if err != n... | go | func createFormatCache(fsFormatPath string, format *formatCacheV1) error {
// open file using READ & WRITE permission
var file, err = os.OpenFile(fsFormatPath, os.O_RDWR|os.O_CREATE, 0600)
if err != nil {
return err
}
// Close the locked file upon return.
defer file.Close()
fi, err := file.Stat()
if err != n... | [
"func",
"createFormatCache",
"(",
"fsFormatPath",
"string",
",",
"format",
"*",
"formatCacheV1",
")",
"error",
"{",
"// open file using READ & WRITE permission",
"var",
"file",
",",
"err",
"=",
"os",
".",
"OpenFile",
"(",
"fsFormatPath",
",",
"os",
".",
"O_RDWR",
... | // Creates a new cache format.json if unformatted. | [
"Creates",
"a",
"new",
"cache",
"format",
".",
"json",
"if",
"unformatted",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L91-L109 |
125,254 | minio/minio | cmd/format-disk-cache.go | initFormatCache | func initFormatCache(ctx context.Context, drives []string) (formats []*formatCacheV1, err error) {
nformats := newFormatCacheV1(drives)
for _, drive := range drives {
_, err = os.Stat(drive)
if err == nil {
continue
}
if !os.IsNotExist(err) {
logger.GetReqInfo(ctx).AppendTags("drive", drive)
logger.L... | go | func initFormatCache(ctx context.Context, drives []string) (formats []*formatCacheV1, err error) {
nformats := newFormatCacheV1(drives)
for _, drive := range drives {
_, err = os.Stat(drive)
if err == nil {
continue
}
if !os.IsNotExist(err) {
logger.GetReqInfo(ctx).AppendTags("drive", drive)
logger.L... | [
"func",
"initFormatCache",
"(",
"ctx",
"context",
".",
"Context",
",",
"drives",
"[",
"]",
"string",
")",
"(",
"formats",
"[",
"]",
"*",
"formatCacheV1",
",",
"err",
"error",
")",
"{",
"nformats",
":=",
"newFormatCacheV1",
"(",
"drives",
")",
"\n",
"for"... | // This function creates a cache format file on disk and returns a slice
// of format cache config | [
"This",
"function",
"creates",
"a",
"cache",
"format",
"file",
"on",
"disk",
"and",
"returns",
"a",
"slice",
"of",
"format",
"cache",
"config"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L113-L148 |
125,255 | minio/minio | cmd/format-disk-cache.go | formatMetaCacheV1 | func formatMetaCacheV1(r io.ReadSeeker) (*formatCacheV1, error) {
format := &formatCacheV1{}
if err := jsonLoad(r, format); err != nil {
return nil, err
}
return format, nil
} | go | func formatMetaCacheV1(r io.ReadSeeker) (*formatCacheV1, error) {
format := &formatCacheV1{}
if err := jsonLoad(r, format); err != nil {
return nil, err
}
return format, nil
} | [
"func",
"formatMetaCacheV1",
"(",
"r",
"io",
".",
"ReadSeeker",
")",
"(",
"*",
"formatCacheV1",
",",
"error",
")",
"{",
"format",
":=",
"&",
"formatCacheV1",
"{",
"}",
"\n",
"if",
"err",
":=",
"jsonLoad",
"(",
"r",
",",
"format",
")",
";",
"err",
"!=... | // unmarshalls the cache format.json into formatCacheV1 | [
"unmarshalls",
"the",
"cache",
"format",
".",
"json",
"into",
"formatCacheV1"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L173-L179 |
125,256 | minio/minio | cmd/format-disk-cache.go | checkCacheDiskConsistency | func checkCacheDiskConsistency(formats []*formatCacheV1) error {
var disks = make([]string, len(formats))
// Collect currently available disk uuids.
for index, format := range formats {
if format == nil {
disks[index] = ""
continue
}
disks[index] = format.Cache.This
}
for i, format := range formats {
... | go | func checkCacheDiskConsistency(formats []*formatCacheV1) error {
var disks = make([]string, len(formats))
// Collect currently available disk uuids.
for index, format := range formats {
if format == nil {
disks[index] = ""
continue
}
disks[index] = format.Cache.This
}
for i, format := range formats {
... | [
"func",
"checkCacheDiskConsistency",
"(",
"formats",
"[",
"]",
"*",
"formatCacheV1",
")",
"error",
"{",
"var",
"disks",
"=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"formats",
")",
")",
"\n",
"// Collect currently available disk uuids.",
"for",
"inde... | // checkCacheDisksConsistency - checks if "This" disk uuid on each disk is consistent with all "Disks" slices
// across disks. | [
"checkCacheDisksConsistency",
"-",
"checks",
"if",
"This",
"disk",
"uuid",
"on",
"each",
"disk",
"is",
"consistent",
"with",
"all",
"Disks",
"slices",
"across",
"disks",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L213-L236 |
125,257 | minio/minio | cmd/format-disk-cache.go | checkCacheDisksSliceConsistency | func checkCacheDisksSliceConsistency(formats []*formatCacheV1) error {
var sentinelDisks []string
// Extract first valid Disks slice.
for _, format := range formats {
if format == nil {
continue
}
sentinelDisks = format.Cache.Disks
break
}
for _, format := range formats {
if format == nil {
continu... | go | func checkCacheDisksSliceConsistency(formats []*formatCacheV1) error {
var sentinelDisks []string
// Extract first valid Disks slice.
for _, format := range formats {
if format == nil {
continue
}
sentinelDisks = format.Cache.Disks
break
}
for _, format := range formats {
if format == nil {
continu... | [
"func",
"checkCacheDisksSliceConsistency",
"(",
"formats",
"[",
"]",
"*",
"formatCacheV1",
")",
"error",
"{",
"var",
"sentinelDisks",
"[",
"]",
"string",
"\n",
"// Extract first valid Disks slice.",
"for",
"_",
",",
"format",
":=",
"range",
"formats",
"{",
"if",
... | // checkCacheDisksSliceConsistency - validate cache Disks order if they are consistent. | [
"checkCacheDisksSliceConsistency",
"-",
"validate",
"cache",
"Disks",
"order",
"if",
"they",
"are",
"consistent",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L239-L259 |
125,258 | minio/minio | cmd/format-disk-cache.go | findCacheDiskIndex | func findCacheDiskIndex(disk string, disks []string) int {
for index, uuid := range disks {
if uuid == disk {
return index
}
}
return -1
} | go | func findCacheDiskIndex(disk string, disks []string) int {
for index, uuid := range disks {
if uuid == disk {
return index
}
}
return -1
} | [
"func",
"findCacheDiskIndex",
"(",
"disk",
"string",
",",
"disks",
"[",
"]",
"string",
")",
"int",
"{",
"for",
"index",
",",
"uuid",
":=",
"range",
"disks",
"{",
"if",
"uuid",
"==",
"disk",
"{",
"return",
"index",
"\n",
"}",
"\n",
"}",
"\n",
"return"... | // findCacheDiskIndex returns position of cache disk in JBOD. | [
"findCacheDiskIndex",
"returns",
"position",
"of",
"cache",
"disk",
"in",
"JBOD",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L262-L269 |
125,259 | minio/minio | cmd/format-disk-cache.go | validateCacheFormats | func validateCacheFormats(ctx context.Context, formats []*formatCacheV1) error {
count := 0
for _, format := range formats {
if format == nil {
count++
}
}
if count == len(formats) {
return errors.New("Cache format files missing on all drives")
}
if _, err := checkFormatCacheValues(formats); err != nil {... | go | func validateCacheFormats(ctx context.Context, formats []*formatCacheV1) error {
count := 0
for _, format := range formats {
if format == nil {
count++
}
}
if count == len(formats) {
return errors.New("Cache format files missing on all drives")
}
if _, err := checkFormatCacheValues(formats); err != nil {... | [
"func",
"validateCacheFormats",
"(",
"ctx",
"context",
".",
"Context",
",",
"formats",
"[",
"]",
"*",
"formatCacheV1",
")",
"error",
"{",
"count",
":=",
"0",
"\n",
"for",
"_",
",",
"format",
":=",
"range",
"formats",
"{",
"if",
"format",
"==",
"nil",
"... | // validate whether cache drives order has changed | [
"validate",
"whether",
"cache",
"drives",
"order",
"has",
"changed"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L272-L293 |
125,260 | minio/minio | cmd/format-disk-cache.go | cacheDrivesUnformatted | func cacheDrivesUnformatted(drives []string) bool {
count := 0
for _, drive := range drives {
cacheFormatPath := pathJoin(drive, minioMetaBucket, formatConfigFile)
if _, err := os.Stat(cacheFormatPath); os.IsNotExist(err) {
count++
}
}
return count == len(drives)
} | go | func cacheDrivesUnformatted(drives []string) bool {
count := 0
for _, drive := range drives {
cacheFormatPath := pathJoin(drive, minioMetaBucket, formatConfigFile)
if _, err := os.Stat(cacheFormatPath); os.IsNotExist(err) {
count++
}
}
return count == len(drives)
} | [
"func",
"cacheDrivesUnformatted",
"(",
"drives",
"[",
"]",
"string",
")",
"bool",
"{",
"count",
":=",
"0",
"\n",
"for",
"_",
",",
"drive",
":=",
"range",
"drives",
"{",
"cacheFormatPath",
":=",
"pathJoin",
"(",
"drive",
",",
"minioMetaBucket",
",",
"format... | // return true if all of the list of cache drives are
// fresh disks | [
"return",
"true",
"if",
"all",
"of",
"the",
"list",
"of",
"cache",
"drives",
"are",
"fresh",
"disks"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L297-L306 |
125,261 | minio/minio | cmd/format-disk-cache.go | loadAndValidateCacheFormat | func loadAndValidateCacheFormat(ctx context.Context, drives []string) (formats []*formatCacheV1, err error) {
if cacheDrivesUnformatted(drives) {
formats, err = initFormatCache(ctx, drives)
} else {
formats, err = loadFormatCache(ctx, drives)
}
if err != nil {
return nil, err
}
if err = validateCacheFormats... | go | func loadAndValidateCacheFormat(ctx context.Context, drives []string) (formats []*formatCacheV1, err error) {
if cacheDrivesUnformatted(drives) {
formats, err = initFormatCache(ctx, drives)
} else {
formats, err = loadFormatCache(ctx, drives)
}
if err != nil {
return nil, err
}
if err = validateCacheFormats... | [
"func",
"loadAndValidateCacheFormat",
"(",
"ctx",
"context",
".",
"Context",
",",
"drives",
"[",
"]",
"string",
")",
"(",
"formats",
"[",
"]",
"*",
"formatCacheV1",
",",
"err",
"error",
")",
"{",
"if",
"cacheDrivesUnformatted",
"(",
"drives",
")",
"{",
"fo... | // create format.json for each cache drive if fresh disk or load format from disk
// Then validate the format for all drives in the cache to ensure order
// of cache drives has not changed. | [
"create",
"format",
".",
"json",
"for",
"each",
"cache",
"drive",
"if",
"fresh",
"disk",
"or",
"load",
"format",
"from",
"disk",
"Then",
"validate",
"the",
"format",
"for",
"all",
"drives",
"in",
"the",
"cache",
"to",
"ensure",
"order",
"of",
"cache",
"d... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/format-disk-cache.go#L311-L324 |
125,262 | minio/minio | cmd/ui-errors-utils.go | Error | func (u uiErr) Error() string {
if u.detail == "" {
return u.msg
}
return u.detail
} | go | func (u uiErr) Error() string {
if u.detail == "" {
return u.msg
}
return u.detail
} | [
"func",
"(",
"u",
"uiErr",
")",
"Error",
"(",
")",
"string",
"{",
"if",
"u",
".",
"detail",
"==",
"\"",
"\"",
"{",
"return",
"u",
".",
"msg",
"\n",
"}",
"\n",
"return",
"u",
".",
"detail",
"\n",
"}"
] | // Return the error message | [
"Return",
"the",
"error",
"message"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/ui-errors-utils.go#L37-L42 |
125,263 | minio/minio | cmd/ui-errors-utils.go | Msg | func (u uiErr) Msg(m string, args ...interface{}) uiErr {
return uiErr{
msg: fmt.Sprintf(m, args...),
detail: u.detail,
action: u.action,
help: u.help,
}
} | go | func (u uiErr) Msg(m string, args ...interface{}) uiErr {
return uiErr{
msg: fmt.Sprintf(m, args...),
detail: u.detail,
action: u.action,
help: u.help,
}
} | [
"func",
"(",
"u",
"uiErr",
")",
"Msg",
"(",
"m",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"uiErr",
"{",
"return",
"uiErr",
"{",
"msg",
":",
"fmt",
".",
"Sprintf",
"(",
"m",
",",
"args",
"...",
")",
",",
"detail",
":",
"u",
".",... | // Replace the current error's message | [
"Replace",
"the",
"current",
"error",
"s",
"message"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/ui-errors-utils.go#L45-L52 |
125,264 | minio/minio | cmd/ui-errors-utils.go | newUIErrFn | func newUIErrFn(msg, action, help string) uiErrFn {
return func(err error) uiErr {
u := uiErr{
msg: msg,
action: action,
help: help,
}
if err != nil {
u.detail = err.Error()
}
return u
}
} | go | func newUIErrFn(msg, action, help string) uiErrFn {
return func(err error) uiErr {
u := uiErr{
msg: msg,
action: action,
help: help,
}
if err != nil {
u.detail = err.Error()
}
return u
}
} | [
"func",
"newUIErrFn",
"(",
"msg",
",",
"action",
",",
"help",
"string",
")",
"uiErrFn",
"{",
"return",
"func",
"(",
"err",
"error",
")",
"uiErr",
"{",
"u",
":=",
"uiErr",
"{",
"msg",
":",
"msg",
",",
"action",
":",
"action",
",",
"help",
":",
"help... | // Create a UI error generator, this is needed to simplify
// the update of the detailed error message in several places
// in MinIO code | [
"Create",
"a",
"UI",
"error",
"generator",
"this",
"is",
"needed",
"to",
"simplify",
"the",
"update",
"of",
"the",
"detailed",
"error",
"message",
"in",
"several",
"places",
"in",
"MinIO",
"code"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/ui-errors-utils.go#L59-L71 |
125,265 | minio/minio | cmd/ui-errors-utils.go | errorToUIErr | func errorToUIErr(err error) uiErr {
// If this is already a uiErr, do nothing
if e, ok := err.(uiErr); ok {
return e
}
// Show a generic message for known golang errors
switch e := err.(type) {
case *net.OpError:
if e.Op == "listen" {
return uiErrPortAlreadyInUse(e).Msg("Port " + e.Addr.String() + " is a... | go | func errorToUIErr(err error) uiErr {
// If this is already a uiErr, do nothing
if e, ok := err.(uiErr); ok {
return e
}
// Show a generic message for known golang errors
switch e := err.(type) {
case *net.OpError:
if e.Op == "listen" {
return uiErrPortAlreadyInUse(e).Msg("Port " + e.Addr.String() + " is a... | [
"func",
"errorToUIErr",
"(",
"err",
"error",
")",
"uiErr",
"{",
"// If this is already a uiErr, do nothing",
"if",
"e",
",",
"ok",
":=",
"err",
".",
"(",
"uiErr",
")",
";",
"ok",
"{",
"return",
"e",
"\n",
"}",
"\n\n",
"// Show a generic message for known golang ... | // errorToUIError inspects the passed error and transforms it
// to the appropriate UI error. | [
"errorToUIError",
"inspects",
"the",
"passed",
"error",
"and",
"transforms",
"it",
"to",
"the",
"appropriate",
"UI",
"error",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/ui-errors-utils.go#L75-L102 |
125,266 | minio/minio | pkg/s3select/sql/utils.go | String | func (e *JSONPath) String() string {
parts := make([]string, len(e.PathExpr)+1)
parts[0] = e.BaseKey.String()
for i, pe := range e.PathExpr {
parts[i+1] = pe.String()
}
return strings.Join(parts, "")
} | go | func (e *JSONPath) String() string {
parts := make([]string, len(e.PathExpr)+1)
parts[0] = e.BaseKey.String()
for i, pe := range e.PathExpr {
parts[i+1] = pe.String()
}
return strings.Join(parts, "")
} | [
"func",
"(",
"e",
"*",
"JSONPath",
")",
"String",
"(",
")",
"string",
"{",
"parts",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"e",
".",
"PathExpr",
")",
"+",
"1",
")",
"\n",
"parts",
"[",
"0",
"]",
"=",
"e",
".",
"BaseKey",
".",... | // String functions
// String - returns the JSONPath representation | [
"String",
"functions",
"String",
"-",
"returns",
"the",
"JSONPath",
"representation"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/s3select/sql/utils.go#L27-L34 |
125,267 | minio/minio | pkg/s3select/sql/utils.go | String | func (i *Identifier) String() string {
if i.Unquoted != nil {
return *i.Unquoted
}
return string(*i.Quoted)
} | go | func (i *Identifier) String() string {
if i.Unquoted != nil {
return *i.Unquoted
}
return string(*i.Quoted)
} | [
"func",
"(",
"i",
"*",
"Identifier",
")",
"String",
"(",
")",
"string",
"{",
"if",
"i",
".",
"Unquoted",
"!=",
"nil",
"{",
"return",
"*",
"i",
".",
"Unquoted",
"\n",
"}",
"\n",
"return",
"string",
"(",
"*",
"i",
".",
"Quoted",
")",
"\n",
"}"
] | // Removes double quotes in quoted identifiers | [
"Removes",
"double",
"quotes",
"in",
"quoted",
"identifiers"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/s3select/sql/utils.go#L51-L56 |
125,268 | minio/minio | pkg/s3select/sql/utils.go | getLastKeypathComponent | func getLastKeypathComponent(e *Expression) (string, bool) {
if len(e.And) > 1 ||
len(e.And[0].Condition) > 1 ||
e.And[0].Condition[0].Not != nil ||
e.And[0].Condition[0].Operand.ConditionRHS != nil {
return "", false
}
operand := e.And[0].Condition[0].Operand.Operand
if operand.Right != nil ||
operand.L... | go | func getLastKeypathComponent(e *Expression) (string, bool) {
if len(e.And) > 1 ||
len(e.And[0].Condition) > 1 ||
e.And[0].Condition[0].Not != nil ||
e.And[0].Condition[0].Operand.ConditionRHS != nil {
return "", false
}
operand := e.And[0].Condition[0].Operand.Operand
if operand.Right != nil ||
operand.L... | [
"func",
"getLastKeypathComponent",
"(",
"e",
"*",
"Expression",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"len",
"(",
"e",
".",
"And",
")",
">",
"1",
"||",
"len",
"(",
"e",
".",
"And",
"[",
"0",
"]",
".",
"Condition",
")",
">",
"1",
"||"... | // getLastKeypathComponent checks if the given expression is a path
// expression, and if so extracts the last dot separated component of
// the path. Otherwise it returns false. | [
"getLastKeypathComponent",
"checks",
"if",
"the",
"given",
"expression",
"is",
"a",
"path",
"expression",
"and",
"if",
"so",
"extracts",
"the",
"last",
"dot",
"separated",
"component",
"of",
"the",
"path",
".",
"Otherwise",
"it",
"returns",
"false",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/s3select/sql/utils.go#L75-L100 |
125,269 | minio/minio | cmd/update-notifier.go | prepareUpdateMessage | func prepareUpdateMessage(downloadURL string, older time.Duration) string {
if downloadURL == "" || older <= 0 {
return ""
}
// Compute friendly duration string to indicate time
// difference between newer and current release.
t := time.Time{}
newerThan := humanize.RelTime(t, t.Add(older), "ago", "")
// Retu... | go | func prepareUpdateMessage(downloadURL string, older time.Duration) string {
if downloadURL == "" || older <= 0 {
return ""
}
// Compute friendly duration string to indicate time
// difference between newer and current release.
t := time.Time{}
newerThan := humanize.RelTime(t, t.Add(older), "ago", "")
// Retu... | [
"func",
"prepareUpdateMessage",
"(",
"downloadURL",
"string",
",",
"older",
"time",
".",
"Duration",
")",
"string",
"{",
"if",
"downloadURL",
"==",
"\"",
"\"",
"||",
"older",
"<=",
"0",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"// Compute friendly durat... | // prepareUpdateMessage - prepares the update message, only if a
// newer version is available. | [
"prepareUpdateMessage",
"-",
"prepares",
"the",
"update",
"message",
"only",
"if",
"a",
"newer",
"version",
"is",
"available",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/update-notifier.go#L32-L44 |
125,270 | minio/minio | cmd/admin-heal-ops.go | initAllHealState | func initAllHealState(isErasureMode bool) {
if !isErasureMode {
return
}
globalAllHealState = allHealState{
healSeqMap: make(map[string]*healSequence),
}
go globalAllHealState.periodicHealSeqsClean()
} | go | func initAllHealState(isErasureMode bool) {
if !isErasureMode {
return
}
globalAllHealState = allHealState{
healSeqMap: make(map[string]*healSequence),
}
go globalAllHealState.periodicHealSeqsClean()
} | [
"func",
"initAllHealState",
"(",
"isErasureMode",
"bool",
")",
"{",
"if",
"!",
"isErasureMode",
"{",
"return",
"\n",
"}",
"\n\n",
"globalAllHealState",
"=",
"allHealState",
"{",
"healSeqMap",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"healSequence",
... | // initAllHealState - initialize healing apparatus | [
"initAllHealState",
"-",
"initialize",
"healing",
"apparatus"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L105-L115 |
125,271 | minio/minio | cmd/admin-heal-ops.go | getHealSequence | func (ahs *allHealState) getHealSequence(path string) (h *healSequence, exists bool) {
ahs.Lock()
defer ahs.Unlock()
h, exists = ahs.healSeqMap[path]
return h, exists
} | go | func (ahs *allHealState) getHealSequence(path string) (h *healSequence, exists bool) {
ahs.Lock()
defer ahs.Unlock()
h, exists = ahs.healSeqMap[path]
return h, exists
} | [
"func",
"(",
"ahs",
"*",
"allHealState",
")",
"getHealSequence",
"(",
"path",
"string",
")",
"(",
"h",
"*",
"healSequence",
",",
"exists",
"bool",
")",
"{",
"ahs",
".",
"Lock",
"(",
")",
"\n",
"defer",
"ahs",
".",
"Unlock",
"(",
")",
"\n",
"h",
","... | // getHealSequence - Retrieve a heal sequence by path. The second
// argument returns if a heal sequence actually exists. | [
"getHealSequence",
"-",
"Retrieve",
"a",
"heal",
"sequence",
"by",
"path",
".",
"The",
"second",
"argument",
"returns",
"if",
"a",
"heal",
"sequence",
"actually",
"exists",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L143-L148 |
125,272 | minio/minio | cmd/admin-heal-ops.go | LaunchNewHealSequence | func (ahs *allHealState) LaunchNewHealSequence(h *healSequence) (
respBytes []byte, apiErr APIError, errMsg string) {
existsAndLive := false
he, exists := ahs.getHealSequence(h.path)
if exists {
if !he.hasEnded() || len(he.currentStatus.Items) > 0 {
existsAndLive = true
}
}
if existsAndLive {
// A heal... | go | func (ahs *allHealState) LaunchNewHealSequence(h *healSequence) (
respBytes []byte, apiErr APIError, errMsg string) {
existsAndLive := false
he, exists := ahs.getHealSequence(h.path)
if exists {
if !he.hasEnded() || len(he.currentStatus.Items) > 0 {
existsAndLive = true
}
}
if existsAndLive {
// A heal... | [
"func",
"(",
"ahs",
"*",
"allHealState",
")",
"LaunchNewHealSequence",
"(",
"h",
"*",
"healSequence",
")",
"(",
"respBytes",
"[",
"]",
"byte",
",",
"apiErr",
"APIError",
",",
"errMsg",
"string",
")",
"{",
"existsAndLive",
":=",
"false",
"\n",
"he",
",",
... | // LaunchNewHealSequence - launches a background routine that performs
// healing according to the healSequence argument. For each heal
// sequence, state is stored in the `globalAllHealState`, which is a
// map of the heal path to `healSequence` which holds state about the
// heal sequence.
//
// Heal results are pers... | [
"LaunchNewHealSequence",
"-",
"launches",
"a",
"background",
"routine",
"that",
"performs",
"healing",
"according",
"to",
"the",
"healSequence",
"argument",
".",
"For",
"each",
"heal",
"sequence",
"state",
"is",
"stored",
"in",
"the",
"globalAllHealState",
"which",
... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L189-L248 |
125,273 | minio/minio | cmd/admin-heal-ops.go | PopHealStatusJSON | func (ahs *allHealState) PopHealStatusJSON(path string,
clientToken string) ([]byte, APIErrorCode) {
// fetch heal state for given path
h, exists := ahs.getHealSequence(path)
if !exists {
// If there is no such heal sequence, return error.
return nil, ErrHealNoSuchProcess
}
// Check if client-token is valid... | go | func (ahs *allHealState) PopHealStatusJSON(path string,
clientToken string) ([]byte, APIErrorCode) {
// fetch heal state for given path
h, exists := ahs.getHealSequence(path)
if !exists {
// If there is no such heal sequence, return error.
return nil, ErrHealNoSuchProcess
}
// Check if client-token is valid... | [
"func",
"(",
"ahs",
"*",
"allHealState",
")",
"PopHealStatusJSON",
"(",
"path",
"string",
",",
"clientToken",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"APIErrorCode",
")",
"{",
"// fetch heal state for given path",
"h",
",",
"exists",
":=",
"ahs",
".",
"ge... | // PopHealStatusJSON - Called by heal-status API. It fetches the heal
// status results from global state and returns its JSON
// representation. The clientToken helps ensure there aren't
// conflicting clients fetching status. | [
"PopHealStatusJSON",
"-",
"Called",
"by",
"heal",
"-",
"status",
"API",
".",
"It",
"fetches",
"the",
"heal",
"status",
"results",
"from",
"global",
"state",
"and",
"returns",
"its",
"JSON",
"representation",
".",
"The",
"clientToken",
"helps",
"ensure",
"there... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L254-L297 |
125,274 | minio/minio | cmd/admin-heal-ops.go | newHealSequence | func newHealSequence(bucket, objPrefix, clientAddr string,
numDisks int, hs madmin.HealOpts, forceStart bool) *healSequence {
reqInfo := &logger.ReqInfo{RemoteHost: clientAddr, API: "Heal", BucketName: bucket}
reqInfo.AppendTags("prefix", objPrefix)
ctx := logger.SetReqInfo(context.Background(), reqInfo)
return ... | go | func newHealSequence(bucket, objPrefix, clientAddr string,
numDisks int, hs madmin.HealOpts, forceStart bool) *healSequence {
reqInfo := &logger.ReqInfo{RemoteHost: clientAddr, API: "Heal", BucketName: bucket}
reqInfo.AppendTags("prefix", objPrefix)
ctx := logger.SetReqInfo(context.Background(), reqInfo)
return ... | [
"func",
"newHealSequence",
"(",
"bucket",
",",
"objPrefix",
",",
"clientAddr",
"string",
",",
"numDisks",
"int",
",",
"hs",
"madmin",
".",
"HealOpts",
",",
"forceStart",
"bool",
")",
"*",
"healSequence",
"{",
"reqInfo",
":=",
"&",
"logger",
".",
"ReqInfo",
... | // NewHealSequence - creates healSettings, assumes bucket and
// objPrefix are already validated. | [
"NewHealSequence",
"-",
"creates",
"healSettings",
"assumes",
"bucket",
"and",
"objPrefix",
"are",
"already",
"validated",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L343-L369 |
125,275 | minio/minio | cmd/admin-heal-ops.go | hasEnded | func (h *healSequence) hasEnded() bool {
h.currentStatus.updateLock.RLock()
summary := h.currentStatus.Summary
h.currentStatus.updateLock.RUnlock()
return summary == healStoppedStatus || summary == healFinishedStatus
} | go | func (h *healSequence) hasEnded() bool {
h.currentStatus.updateLock.RLock()
summary := h.currentStatus.Summary
h.currentStatus.updateLock.RUnlock()
return summary == healStoppedStatus || summary == healFinishedStatus
} | [
"func",
"(",
"h",
"*",
"healSequence",
")",
"hasEnded",
"(",
")",
"bool",
"{",
"h",
".",
"currentStatus",
".",
"updateLock",
".",
"RLock",
"(",
")",
"\n",
"summary",
":=",
"h",
".",
"currentStatus",
".",
"Summary",
"\n",
"h",
".",
"currentStatus",
".",... | // check if the heal sequence has ended | [
"check",
"if",
"the",
"heal",
"sequence",
"has",
"ended"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L383-L388 |
125,276 | minio/minio | cmd/admin-heal-ops.go | pushHealResultItem | func (h *healSequence) pushHealResultItem(r madmin.HealResultItem) error {
// start a timer to keep an upper time limit to find an empty
// slot to add the given heal result - if no slot is found it
// means that the server is holding the maximum amount of
// heal-results in memory and the client has not consumed i... | go | func (h *healSequence) pushHealResultItem(r madmin.HealResultItem) error {
// start a timer to keep an upper time limit to find an empty
// slot to add the given heal result - if no slot is found it
// means that the server is holding the maximum amount of
// heal-results in memory and the client has not consumed i... | [
"func",
"(",
"h",
"*",
"healSequence",
")",
"pushHealResultItem",
"(",
"r",
"madmin",
".",
"HealResultItem",
")",
"error",
"{",
"// start a timer to keep an upper time limit to find an empty",
"// slot to add the given heal result - if no slot is found it",
"// means that the serve... | // pushHealResultItem - pushes a heal result item for consumption in
// the heal-status API. It blocks if there are
// maxUnconsumedHealResultItems. When it blocks, the heal sequence
// routine is effectively paused - this happens when the server has
// accumulated the maximum number of heal records per heal
// sequenc... | [
"pushHealResultItem",
"-",
"pushes",
"a",
"heal",
"result",
"item",
"for",
"consumption",
"in",
"the",
"heal",
"-",
"status",
"API",
".",
"It",
"blocks",
"if",
"there",
"are",
"maxUnconsumedHealResultItems",
".",
"When",
"it",
"blocks",
"the",
"heal",
"sequenc... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L407-L471 |
125,277 | minio/minio | cmd/admin-heal-ops.go | traverseAndHeal | func (h *healSequence) traverseAndHeal() {
var err error
checkErr := func(f func() error) {
switch {
case err != nil:
return
case h.isQuitting():
err = errHealStopSignalled
return
}
err = f()
}
// Start with format healing
checkErr(h.healDiskFormat)
// Start healing the config prefix.
checkE... | go | func (h *healSequence) traverseAndHeal() {
var err error
checkErr := func(f func() error) {
switch {
case err != nil:
return
case h.isQuitting():
err = errHealStopSignalled
return
}
err = f()
}
// Start with format healing
checkErr(h.healDiskFormat)
// Start healing the config prefix.
checkE... | [
"func",
"(",
"h",
"*",
"healSequence",
")",
"traverseAndHeal",
"(",
")",
"{",
"var",
"err",
"error",
"\n",
"checkErr",
":=",
"func",
"(",
"f",
"func",
"(",
")",
"error",
")",
"{",
"switch",
"{",
"case",
"err",
"!=",
"nil",
":",
"return",
"\n",
"cas... | // traverseAndHeal - traverses on-disk data and performs healing
// according to settings. At each "safe" point it also checks if an
// external quit signal has been received and quits if so. Since the
// healing traversal may be mutating on-disk data when an external
// quit signal is received, this routine cannot qui... | [
"traverseAndHeal",
"-",
"traverses",
"on",
"-",
"disk",
"data",
"and",
"performs",
"healing",
"according",
"to",
"settings",
".",
"At",
"each",
"safe",
"point",
"it",
"also",
"checks",
"if",
"an",
"external",
"quit",
"signal",
"has",
"been",
"received",
"and... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L529-L559 |
125,278 | minio/minio | cmd/admin-heal-ops.go | healMinioSysMeta | func (h *healSequence) healMinioSysMeta(metaPrefix string) func() error {
return func() error {
// Get current object layer instance.
objectAPI := newObjectLayerFn()
if objectAPI == nil {
return errServerNotInitialized
}
// NOTE: Healing on meta is run regardless
// of any bucket being selected, this i... | go | func (h *healSequence) healMinioSysMeta(metaPrefix string) func() error {
return func() error {
// Get current object layer instance.
objectAPI := newObjectLayerFn()
if objectAPI == nil {
return errServerNotInitialized
}
// NOTE: Healing on meta is run regardless
// of any bucket being selected, this i... | [
"func",
"(",
"h",
"*",
"healSequence",
")",
"healMinioSysMeta",
"(",
"metaPrefix",
"string",
")",
"func",
"(",
")",
"error",
"{",
"return",
"func",
"(",
")",
"error",
"{",
"// Get current object layer instance.",
"objectAPI",
":=",
"newObjectLayerFn",
"(",
")",
... | // healMinioSysMeta - heals all files under a given meta prefix, returns a function
// which in-turn heals the respective meta directory path and any files in int. | [
"healMinioSysMeta",
"-",
"heals",
"all",
"files",
"under",
"a",
"given",
"meta",
"prefix",
"returns",
"a",
"function",
"which",
"in",
"-",
"turn",
"heals",
"the",
"respective",
"meta",
"directory",
"path",
"and",
"any",
"files",
"in",
"int",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L563-L591 |
125,279 | minio/minio | cmd/admin-heal-ops.go | healDiskFormat | func (h *healSequence) healDiskFormat() error {
if h.isQuitting() {
return errHealStopSignalled
}
// Get current object layer instance.
objectAPI := newObjectLayerFn()
if objectAPI == nil {
return errServerNotInitialized
}
res, err := objectAPI.HealFormat(h.ctx, h.settings.DryRun)
// return any error, ign... | go | func (h *healSequence) healDiskFormat() error {
if h.isQuitting() {
return errHealStopSignalled
}
// Get current object layer instance.
objectAPI := newObjectLayerFn()
if objectAPI == nil {
return errServerNotInitialized
}
res, err := objectAPI.HealFormat(h.ctx, h.settings.DryRun)
// return any error, ign... | [
"func",
"(",
"h",
"*",
"healSequence",
")",
"healDiskFormat",
"(",
")",
"error",
"{",
"if",
"h",
".",
"isQuitting",
"(",
")",
"{",
"return",
"errHealStopSignalled",
"\n",
"}",
"\n\n",
"// Get current object layer instance.",
"objectAPI",
":=",
"newObjectLayerFn",
... | // healDiskFormat - heals format.json, return value indicates if a
// failure error occurred. | [
"healDiskFormat",
"-",
"heals",
"format",
".",
"json",
"return",
"value",
"indicates",
"if",
"a",
"failure",
"error",
"occurred",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L595-L626 |
125,280 | minio/minio | cmd/admin-heal-ops.go | healBuckets | func (h *healSequence) healBuckets() error {
if h.isQuitting() {
return errHealStopSignalled
}
// 1. If a bucket was specified, heal only the bucket.
if h.bucket != "" {
return h.healBucket(h.bucket)
}
// Get current object layer instance.
objectAPI := newObjectLayerFn()
if objectAPI == nil {
return err... | go | func (h *healSequence) healBuckets() error {
if h.isQuitting() {
return errHealStopSignalled
}
// 1. If a bucket was specified, heal only the bucket.
if h.bucket != "" {
return h.healBucket(h.bucket)
}
// Get current object layer instance.
objectAPI := newObjectLayerFn()
if objectAPI == nil {
return err... | [
"func",
"(",
"h",
"*",
"healSequence",
")",
"healBuckets",
"(",
")",
"error",
"{",
"if",
"h",
".",
"isQuitting",
"(",
")",
"{",
"return",
"errHealStopSignalled",
"\n",
"}",
"\n\n",
"// 1. If a bucket was specified, heal only the bucket.",
"if",
"h",
".",
"bucket... | // healBuckets - check for all buckets heal or just particular bucket. | [
"healBuckets",
"-",
"check",
"for",
"all",
"buckets",
"heal",
"or",
"just",
"particular",
"bucket",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L629-L657 |
125,281 | minio/minio | cmd/admin-heal-ops.go | healBucket | func (h *healSequence) healBucket(bucket string) error {
// Get current object layer instance.
objectAPI := newObjectLayerFn()
if objectAPI == nil {
return errServerNotInitialized
}
result, err := objectAPI.HealBucket(h.ctx, bucket, h.settings.DryRun, h.settings.Remove)
// handle heal-bucket error
if err != n... | go | func (h *healSequence) healBucket(bucket string) error {
// Get current object layer instance.
objectAPI := newObjectLayerFn()
if objectAPI == nil {
return errServerNotInitialized
}
result, err := objectAPI.HealBucket(h.ctx, bucket, h.settings.DryRun, h.settings.Remove)
// handle heal-bucket error
if err != n... | [
"func",
"(",
"h",
"*",
"healSequence",
")",
"healBucket",
"(",
"bucket",
"string",
")",
"error",
"{",
"// Get current object layer instance.",
"objectAPI",
":=",
"newObjectLayerFn",
"(",
")",
"\n",
"if",
"objectAPI",
"==",
"nil",
"{",
"return",
"errServerNotInitia... | // healBucket - traverses and heals given bucket | [
"healBucket",
"-",
"traverses",
"and",
"heals",
"given",
"bucket"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L660-L697 |
125,282 | minio/minio | cmd/admin-heal-ops.go | healObject | func (h *healSequence) healObject(bucket, object string) error {
if h.isQuitting() {
return errHealStopSignalled
}
if globalHTTPServer != nil {
// Wait at max 1 minute for an inprogress request
// before proceeding to heal
waitCount := 60
// Any requests in progress, delay the heal.
for globalHTTPServer... | go | func (h *healSequence) healObject(bucket, object string) error {
if h.isQuitting() {
return errHealStopSignalled
}
if globalHTTPServer != nil {
// Wait at max 1 minute for an inprogress request
// before proceeding to heal
waitCount := 60
// Any requests in progress, delay the heal.
for globalHTTPServer... | [
"func",
"(",
"h",
"*",
"healSequence",
")",
"healObject",
"(",
"bucket",
",",
"object",
"string",
")",
"error",
"{",
"if",
"h",
".",
"isQuitting",
"(",
")",
"{",
"return",
"errHealStopSignalled",
"\n",
"}",
"\n\n",
"if",
"globalHTTPServer",
"!=",
"nil",
... | // healObject - heal the given object and record result | [
"healObject",
"-",
"heal",
"the",
"given",
"object",
"and",
"record",
"result"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/admin-heal-ops.go#L700-L729 |
125,283 | minio/minio | pkg/event/rules.go | Add | func (rules Rules) Add(pattern string, targetID TargetID) {
rules[pattern] = NewTargetIDSet(targetID).Union(rules[pattern])
} | go | func (rules Rules) Add(pattern string, targetID TargetID) {
rules[pattern] = NewTargetIDSet(targetID).Union(rules[pattern])
} | [
"func",
"(",
"rules",
"Rules",
")",
"Add",
"(",
"pattern",
"string",
",",
"targetID",
"TargetID",
")",
"{",
"rules",
"[",
"pattern",
"]",
"=",
"NewTargetIDSet",
"(",
"targetID",
")",
".",
"Union",
"(",
"rules",
"[",
"pattern",
"]",
")",
"\n",
"}"
] | // Add - adds pattern and target ID. | [
"Add",
"-",
"adds",
"pattern",
"and",
"target",
"ID",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/event/rules.go#L52-L54 |
125,284 | minio/minio | pkg/event/rules.go | Match | func (rules Rules) Match(objectName string) TargetIDSet {
targetIDs := NewTargetIDSet()
for pattern, targetIDSet := range rules {
if wildcard.MatchSimple(pattern, objectName) {
targetIDs = targetIDs.Union(targetIDSet)
}
}
return targetIDs
} | go | func (rules Rules) Match(objectName string) TargetIDSet {
targetIDs := NewTargetIDSet()
for pattern, targetIDSet := range rules {
if wildcard.MatchSimple(pattern, objectName) {
targetIDs = targetIDs.Union(targetIDSet)
}
}
return targetIDs
} | [
"func",
"(",
"rules",
"Rules",
")",
"Match",
"(",
"objectName",
"string",
")",
"TargetIDSet",
"{",
"targetIDs",
":=",
"NewTargetIDSet",
"(",
")",
"\n\n",
"for",
"pattern",
",",
"targetIDSet",
":=",
"range",
"rules",
"{",
"if",
"wildcard",
".",
"MatchSimple",... | // Match - returns TargetIDSet matching object name in rules. | [
"Match",
"-",
"returns",
"TargetIDSet",
"matching",
"object",
"name",
"in",
"rules",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/event/rules.go#L57-L67 |
125,285 | minio/minio | pkg/event/rules.go | Clone | func (rules Rules) Clone() Rules {
rulesCopy := make(Rules)
for pattern, targetIDSet := range rules {
rulesCopy[pattern] = targetIDSet.Clone()
}
return rulesCopy
} | go | func (rules Rules) Clone() Rules {
rulesCopy := make(Rules)
for pattern, targetIDSet := range rules {
rulesCopy[pattern] = targetIDSet.Clone()
}
return rulesCopy
} | [
"func",
"(",
"rules",
"Rules",
")",
"Clone",
"(",
")",
"Rules",
"{",
"rulesCopy",
":=",
"make",
"(",
"Rules",
")",
"\n\n",
"for",
"pattern",
",",
"targetIDSet",
":=",
"range",
"rules",
"{",
"rulesCopy",
"[",
"pattern",
"]",
"=",
"targetIDSet",
".",
"Cl... | // Clone - returns copy of this rules. | [
"Clone",
"-",
"returns",
"copy",
"of",
"this",
"rules",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/event/rules.go#L70-L78 |
125,286 | minio/minio | pkg/event/rules.go | Union | func (rules Rules) Union(rules2 Rules) Rules {
nrules := rules.Clone()
for pattern, targetIDSet := range rules2 {
nrules[pattern] = nrules[pattern].Union(targetIDSet)
}
return nrules
} | go | func (rules Rules) Union(rules2 Rules) Rules {
nrules := rules.Clone()
for pattern, targetIDSet := range rules2 {
nrules[pattern] = nrules[pattern].Union(targetIDSet)
}
return nrules
} | [
"func",
"(",
"rules",
"Rules",
")",
"Union",
"(",
"rules2",
"Rules",
")",
"Rules",
"{",
"nrules",
":=",
"rules",
".",
"Clone",
"(",
")",
"\n\n",
"for",
"pattern",
",",
"targetIDSet",
":=",
"range",
"rules2",
"{",
"nrules",
"[",
"pattern",
"]",
"=",
"... | // Union - returns union with given rules as new rules. | [
"Union",
"-",
"returns",
"union",
"with",
"given",
"rules",
"as",
"new",
"rules",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/event/rules.go#L81-L89 |
125,287 | minio/minio | pkg/event/rules.go | Difference | func (rules Rules) Difference(rules2 Rules) Rules {
nrules := make(Rules)
for pattern, targetIDSet := range rules {
if nv := targetIDSet.Difference(rules2[pattern]); len(nv) > 0 {
nrules[pattern] = nv
}
}
return nrules
} | go | func (rules Rules) Difference(rules2 Rules) Rules {
nrules := make(Rules)
for pattern, targetIDSet := range rules {
if nv := targetIDSet.Difference(rules2[pattern]); len(nv) > 0 {
nrules[pattern] = nv
}
}
return nrules
} | [
"func",
"(",
"rules",
"Rules",
")",
"Difference",
"(",
"rules2",
"Rules",
")",
"Rules",
"{",
"nrules",
":=",
"make",
"(",
"Rules",
")",
"\n\n",
"for",
"pattern",
",",
"targetIDSet",
":=",
"range",
"rules",
"{",
"if",
"nv",
":=",
"targetIDSet",
".",
"Di... | // Difference - returns diffrence with given rules as new rules. | [
"Difference",
"-",
"returns",
"diffrence",
"with",
"given",
"rules",
"as",
"new",
"rules",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/event/rules.go#L92-L102 |
125,288 | minio/minio | pkg/policy/principal.go | Intersection | func (p Principal) Intersection(principal Principal) set.StringSet {
return p.AWS.Intersection(principal.AWS)
} | go | func (p Principal) Intersection(principal Principal) set.StringSet {
return p.AWS.Intersection(principal.AWS)
} | [
"func",
"(",
"p",
"Principal",
")",
"Intersection",
"(",
"principal",
"Principal",
")",
"set",
".",
"StringSet",
"{",
"return",
"p",
".",
"AWS",
".",
"Intersection",
"(",
"principal",
".",
"AWS",
")",
"\n",
"}"
] | // Intersection - returns principals available in both Principal. | [
"Intersection",
"-",
"returns",
"principals",
"available",
"in",
"both",
"Principal",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/principal.go#L38-L40 |
125,289 | minio/minio | pkg/policy/principal.go | MarshalJSON | func (p Principal) MarshalJSON() ([]byte, error) {
if !p.IsValid() {
return nil, fmt.Errorf("invalid principal %v", p)
}
// subtype to avoid recursive call to MarshalJSON()
type subPrincipal Principal
sp := subPrincipal(p)
return json.Marshal(sp)
} | go | func (p Principal) MarshalJSON() ([]byte, error) {
if !p.IsValid() {
return nil, fmt.Errorf("invalid principal %v", p)
}
// subtype to avoid recursive call to MarshalJSON()
type subPrincipal Principal
sp := subPrincipal(p)
return json.Marshal(sp)
} | [
"func",
"(",
"p",
"Principal",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"!",
"p",
".",
"IsValid",
"(",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"p",
")",
"\n",
"}",
... | // MarshalJSON - encodes Principal to JSON data. | [
"MarshalJSON",
"-",
"encodes",
"Principal",
"to",
"JSON",
"data",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/principal.go#L43-L52 |
125,290 | minio/minio | pkg/policy/principal.go | Match | func (p Principal) Match(principal string) bool {
for _, pattern := range p.AWS.ToSlice() {
if wildcard.MatchSimple(pattern, principal) {
return true
}
}
return false
} | go | func (p Principal) Match(principal string) bool {
for _, pattern := range p.AWS.ToSlice() {
if wildcard.MatchSimple(pattern, principal) {
return true
}
}
return false
} | [
"func",
"(",
"p",
"Principal",
")",
"Match",
"(",
"principal",
"string",
")",
"bool",
"{",
"for",
"_",
",",
"pattern",
":=",
"range",
"p",
".",
"AWS",
".",
"ToSlice",
"(",
")",
"{",
"if",
"wildcard",
".",
"MatchSimple",
"(",
"pattern",
",",
"principa... | // Match - matches given principal is wildcard matching with Principal. | [
"Match",
"-",
"matches",
"given",
"principal",
"is",
"wildcard",
"matching",
"with",
"Principal",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/principal.go#L55-L63 |
125,291 | minio/minio | pkg/policy/principal.go | UnmarshalJSON | func (p *Principal) UnmarshalJSON(data []byte) error {
// subtype to avoid recursive call to UnmarshalJSON()
type subPrincipal Principal
var sp subPrincipal
if err := json.Unmarshal(data, &sp); err != nil {
var s string
if err = json.Unmarshal(data, &s); err != nil {
return err
}
if s != "*" {
retur... | go | func (p *Principal) UnmarshalJSON(data []byte) error {
// subtype to avoid recursive call to UnmarshalJSON()
type subPrincipal Principal
var sp subPrincipal
if err := json.Unmarshal(data, &sp); err != nil {
var s string
if err = json.Unmarshal(data, &s); err != nil {
return err
}
if s != "*" {
retur... | [
"func",
"(",
"p",
"*",
"Principal",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"// subtype to avoid recursive call to UnmarshalJSON()",
"type",
"subPrincipal",
"Principal",
"\n",
"var",
"sp",
"subPrincipal",
"\n\n",
"if",
"err",
":=",
... | // UnmarshalJSON - decodes JSON data to Principal. | [
"UnmarshalJSON",
"-",
"decodes",
"JSON",
"data",
"to",
"Principal",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/principal.go#L66-L87 |
125,292 | minio/minio | cmd/logger/target/http/http.go | New | func New(endpoint string, transport *gohttp.Transport) *Target {
h := Target{
endpoint: endpoint,
client: gohttp.Client{
Transport: transport,
},
logCh: make(chan interface{}, 10000),
}
h.startHTTPLogger()
return &h
} | go | func New(endpoint string, transport *gohttp.Transport) *Target {
h := Target{
endpoint: endpoint,
client: gohttp.Client{
Transport: transport,
},
logCh: make(chan interface{}, 10000),
}
h.startHTTPLogger()
return &h
} | [
"func",
"New",
"(",
"endpoint",
"string",
",",
"transport",
"*",
"gohttp",
".",
"Transport",
")",
"*",
"Target",
"{",
"h",
":=",
"Target",
"{",
"endpoint",
":",
"endpoint",
",",
"client",
":",
"gohttp",
".",
"Client",
"{",
"Transport",
":",
"transport",
... | // New initializes a new logger target which
// sends log over http to the specified endpoint | [
"New",
"initializes",
"a",
"new",
"logger",
"target",
"which",
"sends",
"log",
"over",
"http",
"to",
"the",
"specified",
"endpoint"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/logger/target/http/http.go#L71-L82 |
125,293 | minio/minio | cmd/logger/target/http/http.go | Send | func (h *Target) Send(entry interface{}) error {
select {
case h.logCh <- entry:
default:
// log channel is full, do not wait and return
// an error immediately to the caller
return errors.New("log buffer full")
}
return nil
} | go | func (h *Target) Send(entry interface{}) error {
select {
case h.logCh <- entry:
default:
// log channel is full, do not wait and return
// an error immediately to the caller
return errors.New("log buffer full")
}
return nil
} | [
"func",
"(",
"h",
"*",
"Target",
")",
"Send",
"(",
"entry",
"interface",
"{",
"}",
")",
"error",
"{",
"select",
"{",
"case",
"h",
".",
"logCh",
"<-",
"entry",
":",
"default",
":",
"// log channel is full, do not wait and return",
"// an error immediately to the ... | // Send log message 'e' to http target. | [
"Send",
"log",
"message",
"e",
"to",
"http",
"target",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/logger/target/http/http.go#L85-L95 |
125,294 | minio/minio | cmd/hasher.go | getMD5Sum | func getMD5Sum(data []byte) []byte {
hash := md5.New()
hash.Write(data)
return hash.Sum(nil)
} | go | func getMD5Sum(data []byte) []byte {
hash := md5.New()
hash.Write(data)
return hash.Sum(nil)
} | [
"func",
"getMD5Sum",
"(",
"data",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"hash",
":=",
"md5",
".",
"New",
"(",
")",
"\n",
"hash",
".",
"Write",
"(",
"data",
")",
"\n",
"return",
"hash",
".",
"Sum",
"(",
"nil",
")",
"\n",
"}"
] | // getMD5Sum returns MD5 sum of given data. | [
"getMD5Sum",
"returns",
"MD5",
"sum",
"of",
"given",
"data",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/hasher.go#L39-L43 |
125,295 | minio/minio | cmd/gateway/hdfs/gateway-hdfs.go | hdfsGatewayMain | func hdfsGatewayMain(ctx *cli.Context) {
// Validate gateway arguments.
if !ctx.Args().Present() || ctx.Args().First() == "help" {
cli.ShowCommandHelpAndExit(ctx, hdfsBackend, 1)
}
minio.StartGateway(ctx, &HDFS{args: ctx.Args()})
} | go | func hdfsGatewayMain(ctx *cli.Context) {
// Validate gateway arguments.
if !ctx.Args().Present() || ctx.Args().First() == "help" {
cli.ShowCommandHelpAndExit(ctx, hdfsBackend, 1)
}
minio.StartGateway(ctx, &HDFS{args: ctx.Args()})
} | [
"func",
"hdfsGatewayMain",
"(",
"ctx",
"*",
"cli",
".",
"Context",
")",
"{",
"// Validate gateway arguments.",
"if",
"!",
"ctx",
".",
"Args",
"(",
")",
".",
"Present",
"(",
")",
"||",
"ctx",
".",
"Args",
"(",
")",
".",
"First",
"(",
")",
"==",
"\"",
... | // Handler for 'minio gateway hdfs' command line. | [
"Handler",
"for",
"minio",
"gateway",
"hdfs",
"command",
"line",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/hdfs/gateway-hdfs.go#L103-L110 |
125,296 | minio/minio | cmd/gateway/hdfs/gateway-hdfs.go | NewGatewayLayer | func (g *HDFS) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) {
dialFunc := (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext
var addresses []string
for _, s := range g.args {
u, err := xnet.ParseURL(s)
if err != nil {
return ni... | go | func (g *HDFS) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) {
dialFunc := (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext
var addresses []string
for _, s := range g.args {
u, err := xnet.ParseURL(s)
if err != nil {
return ni... | [
"func",
"(",
"g",
"*",
"HDFS",
")",
"NewGatewayLayer",
"(",
"creds",
"auth",
".",
"Credentials",
")",
"(",
"minio",
".",
"ObjectLayer",
",",
"error",
")",
"{",
"dialFunc",
":=",
"(",
"&",
"net",
".",
"Dialer",
"{",
"Timeout",
":",
"30",
"*",
"time",
... | // NewGatewayLayer returns hdfs gatewaylayer. | [
"NewGatewayLayer",
"returns",
"hdfs",
"gatewaylayer",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/hdfs/gateway-hdfs.go#L123-L161 |
125,297 | minio/minio | cmd/gateway/hdfs/gateway-hdfs.go | ListObjects | func (n *hdfsObjects) ListObjects(ctx context.Context, bucket, prefix, marker, delimiter string, maxKeys int) (loi minio.ListObjectsInfo, err error) {
getObjectInfo := func(ctx context.Context, bucket, entry string) (minio.ObjectInfo, error) {
return n.GetObjectInfo(ctx, bucket, entry, minio.ObjectOptions{})
}
re... | go | func (n *hdfsObjects) ListObjects(ctx context.Context, bucket, prefix, marker, delimiter string, maxKeys int) (loi minio.ListObjectsInfo, err error) {
getObjectInfo := func(ctx context.Context, bucket, entry string) (minio.ObjectInfo, error) {
return n.GetObjectInfo(ctx, bucket, entry, minio.ObjectOptions{})
}
re... | [
"func",
"(",
"n",
"*",
"hdfsObjects",
")",
"ListObjects",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"prefix",
",",
"marker",
",",
"delimiter",
"string",
",",
"maxKeys",
"int",
")",
"(",
"loi",
"minio",
".",
"ListObjectsInfo",
",",
"err",... | // ListObjects lists all blobs in HDFS bucket filtered by prefix. | [
"ListObjects",
"lists",
"all",
"blobs",
"in",
"HDFS",
"bucket",
"filtered",
"by",
"prefix",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/hdfs/gateway-hdfs.go#L323-L329 |
125,298 | minio/minio | cmd/gateway/hdfs/gateway-hdfs.go | deleteObject | func (n *hdfsObjects) deleteObject(basePath, deletePath string) error {
if basePath == deletePath {
return nil
}
// Attempt to remove path.
if err := n.clnt.Remove(deletePath); err != nil {
switch {
case err == syscall.ENOTEMPTY:
case isSysErrNotEmpty(err):
// Ignore errors if the directory is not empty... | go | func (n *hdfsObjects) deleteObject(basePath, deletePath string) error {
if basePath == deletePath {
return nil
}
// Attempt to remove path.
if err := n.clnt.Remove(deletePath); err != nil {
switch {
case err == syscall.ENOTEMPTY:
case isSysErrNotEmpty(err):
// Ignore errors if the directory is not empty... | [
"func",
"(",
"n",
"*",
"hdfsObjects",
")",
"deleteObject",
"(",
"basePath",
",",
"deletePath",
"string",
")",
"error",
"{",
"if",
"basePath",
"==",
"deletePath",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"// Attempt to remove path.",
"if",
"err",
":=",
"n",
... | // deleteObject deletes a file path if its empty. If it's successfully deleted,
// it will recursively move up the tree, deleting empty parent directories
// until it finds one with files in it. Returns nil for a non-empty directory. | [
"deleteObject",
"deletes",
"a",
"file",
"path",
"if",
"its",
"empty",
".",
"If",
"it",
"s",
"successfully",
"deleted",
"it",
"will",
"recursively",
"move",
"up",
"the",
"tree",
"deleting",
"empty",
"parent",
"directories",
"until",
"it",
"finds",
"one",
"wit... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/hdfs/gateway-hdfs.go#L348-L376 |
125,299 | minio/minio | cmd/gateway/hdfs/gateway-hdfs.go | ListObjectsV2 | func (n *hdfsObjects) ListObjectsV2(ctx context.Context, bucket, prefix, continuationToken, delimiter string, maxKeys int,
fetchOwner bool, startAfter string) (loi minio.ListObjectsV2Info, err error) {
// fetchOwner is not supported and unused.
marker := continuationToken
if marker == "" {
marker = startAfter
}
... | go | func (n *hdfsObjects) ListObjectsV2(ctx context.Context, bucket, prefix, continuationToken, delimiter string, maxKeys int,
fetchOwner bool, startAfter string) (loi minio.ListObjectsV2Info, err error) {
// fetchOwner is not supported and unused.
marker := continuationToken
if marker == "" {
marker = startAfter
}
... | [
"func",
"(",
"n",
"*",
"hdfsObjects",
")",
"ListObjectsV2",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"prefix",
",",
"continuationToken",
",",
"delimiter",
"string",
",",
"maxKeys",
"int",
",",
"fetchOwner",
"bool",
",",
"startAfter",
"strin... | // ListObjectsV2 lists all blobs in HDFS bucket filtered by prefix | [
"ListObjectsV2",
"lists",
"all",
"blobs",
"in",
"HDFS",
"bucket",
"filtered",
"by",
"prefix"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/hdfs/gateway-hdfs.go#L379-L397 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.