diff --git a/cmd/cli/cli/ls.go b/cmd/cli/cli/ls.go index 5fc02c9e225..8e75c992a5c 100644 --- a/cmd/cli/cli/ls.go +++ b/cmd/cli/cli/ls.go @@ -543,8 +543,8 @@ func printLso(c *cli.Context, entries cmn.LsoEntries, lstFilter *lstFilter, prop propsList := splitCsv(props) if isRemote && !addStatusCol { if addCachedCol && !cos.StringInSlice(apc.GetPropsStatus, propsList) { - for _, e := range entries { - if e.IsVerChanged() { + for _, en := range entries { + if en.IsAnyFlagSet(apc.EntryVerChanged | apc.EntryVerRemoved) { addStatusCol = true break } diff --git a/cmd/cli/cli/scrub.go b/cmd/cli/cli/scrub.go index b9c58996f33..b13fb6fb11c 100644 --- a/cmd/cli/cli/scrub.go +++ b/cmd/cli/cli/scrub.go @@ -405,11 +405,11 @@ func (scr *scrBp) upd(parent *scrCtx, en *cmn.LsoEnt) { scr.log(parent, en, teb.ScrLargeSz) } - if en.IsVerChanged() { + if en.IsAnyFlagSet(apc.EntryVerChanged) { scr.Stats[teb.ScrVchanged].Cnt++ scr.Stats[teb.ScrVchanged].Siz += en.Size scr.log(parent, en, teb.ScrVchanged) - } else if en.IsVerRemoved() { + } else if en.IsAnyFlagSet(apc.EntryVerRemoved) { scr.Stats[teb.ScrVremoved].Cnt++ scr.Stats[teb.ScrVremoved].Siz += en.Size scr.log(parent, en, teb.ScrVremoved) diff --git a/cmd/cli/go.mod b/cmd/cli/go.mod index 1d085cc64a2..4ea06dd817a 100644 --- a/cmd/cli/go.mod +++ b/cmd/cli/go.mod @@ -3,7 +3,7 @@ module github.com/NVIDIA/aistore/cmd/cli go 1.23.4 require ( - github.com/NVIDIA/aistore v1.3.26-0.20250108155940-8c676ef07b6d + github.com/NVIDIA/aistore v1.3.26-0.20250115193147-939d7a64d226 github.com/fatih/color v1.18.0 github.com/json-iterator/go v1.1.12 github.com/onsi/ginkgo/v2 v2.21.0 diff --git a/cmd/cli/go.sum b/cmd/cli/go.sum index 250c4d19a58..2a7fe039d21 100644 --- a/cmd/cli/go.sum +++ b/cmd/cli/go.sum @@ -1,7 +1,7 @@ code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= -github.com/NVIDIA/aistore v1.3.26-0.20250108155940-8c676ef07b6d h1:dEWTFT5KVO32GAw68uGfiz4WqOwPP5XVps8l5KZOqa0= -github.com/NVIDIA/aistore v1.3.26-0.20250108155940-8c676ef07b6d/go.mod h1:mjhY9OGIZULaC79+iRfzEUvUZw7aIWklJ8um321QVpw= +github.com/NVIDIA/aistore v1.3.26-0.20250115193147-939d7a64d226 h1:lOtbuxNtpQIx26uh1JYINTu+SsCvpNrZrit3hbW12vk= +github.com/NVIDIA/aistore v1.3.26-0.20250115193147-939d7a64d226/go.mod h1:CqUKZjhqSTocBlK0XMSYRPGMsoNOFKLwHIkyhOto6uc= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= diff --git a/cmd/cli/teb/init.go b/cmd/cli/teb/init.go index 0f5581dc5aa..7223f6793c4 100644 --- a/cmd/cli/teb/init.go +++ b/cmd/cli/teb/init.go @@ -1,6 +1,6 @@ // Package teb contains templates and (templated) tables to format CLI output. /* - * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved. */ package teb @@ -14,16 +14,17 @@ import ( var Writer io.Writer var ( - fred, fcyan, fgreen func(format string, a ...any) string + fred, fcyan, fgreen, fblue func(format string, a ...any) string ) func Init(w io.Writer, noColor bool) { Writer = w if noColor { - fred, fcyan, fgreen = fmt.Sprintf, fmt.Sprintf, fmt.Sprintf + fred, fcyan, fgreen, fblue = fmt.Sprintf, fmt.Sprintf, fmt.Sprintf, fmt.Sprintf } else { fred = color.New(color.FgHiRed).Sprintf fcyan = color.New(color.FgHiCyan).Sprintf fgreen = color.New(color.FgHiGreen).Sprintf + fblue = color.New(color.FgHiBlue).Sprintf } } diff --git a/cmd/cli/teb/lso.go b/cmd/cli/teb/lso.go index 9c36e36e450..8e4ab96829b 100644 --- a/cmd/cli/teb/lso.go +++ b/cmd/cli/teb/lso.go @@ -1,6 +1,6 @@ // Package teb contains templates and (templated) tables to format CLI output. /* - * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved. */ package teb @@ -80,17 +80,19 @@ func LsoTemplate(propsList []string, hideHeader, addCachedCol, addStatusCol bool // formatting // -func fmtLsObjStatus(e *cmn.LsoEnt) string { - switch e.Status() { +func fmtLsObjStatus(en *cmn.LsoEnt) string { + switch en.Status() { case apc.LocOK: - if !e.IsPresent() { + if !en.IsPresent() { return UnknownStatusVal } switch { - case e.IsVerChanged(): + case en.IsAnyFlagSet(apc.EntryVerChanged): return fcyan("version-changed") - case e.IsVerRemoved(): - return fred("deleted") + case en.IsAnyFlagSet(apc.EntryVerRemoved): + return fblue("deleted") // as in note: deleted + case en.IsAnyFlagSet(apc.EntryHeadFail): + return fred("remote-error") default: return "ok" } @@ -103,14 +105,14 @@ func fmtLsObjStatus(e *cmn.LsoEnt) string { case apc.LocIsCopyMissingObj: return "replica(object-is-missing)" default: - debug.Assertf(false, "%#v", e) + debug.Assertf(false, "%#v", en) return "invalid" } } -func fmtLsObjIsCached(e *cmn.LsoEnt) string { - if e.IsDir() { +func fmtLsObjIsCached(en *cmn.LsoEnt) string { + if en.IsDir() { return "" } - return FmtBool(e.IsPresent()) + return FmtBool(en.IsPresent()) } diff --git a/cmd/ishard/go.mod b/cmd/ishard/go.mod index b8e552864fc..930c9980f42 100644 --- a/cmd/ishard/go.mod +++ b/cmd/ishard/go.mod @@ -3,7 +3,7 @@ module github.com/NVIDIA/aistore/cmd/ishard go 1.23.4 require ( - github.com/NVIDIA/aistore v1.3.26-0.20250108155940-8c676ef07b6d + github.com/NVIDIA/aistore v1.3.26-0.20250115193147-939d7a64d226 github.com/json-iterator/go v1.1.12 github.com/vbauerster/mpb/v4 v4.12.2 ) diff --git a/cmd/ishard/go.sum b/cmd/ishard/go.sum index b94f5844b51..36dd55b278e 100644 --- a/cmd/ishard/go.sum +++ b/cmd/ishard/go.sum @@ -1,6 +1,6 @@ code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= -github.com/NVIDIA/aistore v1.3.26-0.20250108155940-8c676ef07b6d h1:dEWTFT5KVO32GAw68uGfiz4WqOwPP5XVps8l5KZOqa0= -github.com/NVIDIA/aistore v1.3.26-0.20250108155940-8c676ef07b6d/go.mod h1:mjhY9OGIZULaC79+iRfzEUvUZw7aIWklJ8um321QVpw= +github.com/NVIDIA/aistore v1.3.26-0.20250115193147-939d7a64d226 h1:lOtbuxNtpQIx26uh1JYINTu+SsCvpNrZrit3hbW12vk= +github.com/NVIDIA/aistore v1.3.26-0.20250115193147-939d7a64d226/go.mod h1:CqUKZjhqSTocBlK0XMSYRPGMsoNOFKLwHIkyhOto6uc= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=