Documentation
¶
Overview ¶
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2026, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2026, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2026, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2026, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2026, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2026, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
Package core provides core metadata and in-cluster API
- Copyright (c) 2018-2026, NVIDIA CORPORATION. All rights reserved.
Index ¶
- Constants
- func DrainLIF(workCh chan LIF) (n int)
- func FreeLOM(lom *LOM)
- func FreePutParams(a *PutParams)
- func HrwFQN(bck *cmn.Bck, contentType, objName string) (fqn string, digest uint64, err error)
- func InMaintOrDecomm(smap *meta.Smap, tsi *meta.Snode, xact Xact) error
- func LcacheClear()
- func LcacheClearBcks(wg *sync.WaitGroup, bcks ...*meta.Bck) bool
- func LcacheClearMpath(mi *fs.Mountpath)
- func NewBID(serial uint64, isAis bool) uint64
- func ParseObjLoc(loc string) (tname, mpname string)
- func Pinit()
- func ResolveFQN(fqn string, parsed *fs.ParsedFQN) (hrwFQN string, err error)
- func Term()
- func Tinit(t Target, config *cmn.Config, runHK bool)
- type AllRunningInOut
- type Backend
- type BlobParams
- type CRMD
- type CT
- func NewCTFromBO(bck *meta.Bck, objName, ctType string, extras ...string) (ct *CT, err error)
- func NewCTFromFQN(fqn string, b meta.Bowner) (ct *CT, err error)
- func NewCTFromLOM(lom *LOM, ctType string, extras ...string) (ct *CT)
- func NewCTFromParsed(parsed *fs.ParsedFQN, fqn string) *CT
- func NewDsortCT(bck *cmn.Bck, objName string) (ct *CT, err error)
- func (ct *CT) Bck() *meta.Bck
- func (ct *CT) Bucket() *cmn.Bck
- func (ct *CT) Clone(ctType string) (clone *CT)
- func (ct *CT) Cname() string
- func (ct *CT) ContentType() string
- func (ct *CT) Digest() uint64
- func (ct *CT) FQN() string
- func (ct *CT) GenFQN(cttype string, extras ...string) string
- func (ct *CT) LoadSliceFromFS() error
- func (ct *CT) Lock(exclusive bool)
- func (ct *CT) Lsize() int64
- func (ct *CT) Mountpath() *fs.Mountpath
- func (ct *CT) MtimeUnix() int64
- func (ct *CT) ObjectName() string
- func (ct *CT) UnamePtr() *string
- func (ct *CT) Unlock(exclusive bool)
- func (ct *CT) Write(reader io.Reader, size int64, workFQN string) (err error)
- type ETLArgs
- type GetROC
- type GetReaderResult
- type GetStats
- type GfnParams
- type LIF
- type LOM
- func (lom *LOM) AddCopy(copyFQN string, mpi *fs.Mountpath) error
- func (*LOM) AppendWork(wfqn string) (fh cos.LomWriter, err error)
- func (lom *LOM) Atime() time.Time
- func (lom *LOM) AtimeUnix() int64
- func (lom *LOM) Bck() *meta.Bck
- func (lom *LOM) Bprops() *cmn.Bprops
- func (lom *LOM) Bucket() *cmn.Bck
- func (lom *LOM) CacheIdx() int
- func (lom *LOM) CheckEq(rem cos.OAH) error
- func (lom *LOM) CheckRemoteMD(locked, sync bool, origReq *http.Request) (res CRMD)
- func (lom *LOM) Checksum() *cos.Cksum
- func (lom *LOM) CksumConf() *cmn.CksumConf
- func (lom *LOM) CksumType() string
- func (lom *LOM) CleanupCopies(avail fs.MPI) (exp, got int)
- func (lom *LOM) Clone() *LOM
- func (lom *LOM) CloneTo(fqn string) *LOM
- func (lom *LOM) Cname() string
- func (lom *LOM) CompleteUfest(u *Ufest, locked bool) (err error)
- func (lom *LOM) ComputeCksum(cksumType string, locked bool) (cksum *cos.CksumHash, _ error)
- func (lom *LOM) ComputeSetCksum(locked bool) (*cos.Cksum, error)
- func (lom *LOM) Copy(mi *fs.Mountpath, buf []byte) error
- func (lom *LOM) Copy2FQN(dstFQN string, buf []byte) (dst *LOM, err error)
- func (lom *LOM) CopyAttrs(oah cos.OAH, skipCksum bool)
- func (lom *LOM) CopyVersion(oah cos.OAH)
- func (lom *LOM) Create() (cos.LomWriter, error)
- func (lom *LOM) CreatePart(wfqn string) (*os.File, error)
- func (lom *LOM) CreateSlice(wfqn string) (*os.File, error)
- func (lom *LOM) CreateWork(wfqn string) (cos.LomWriter, error)
- func (lom *LOM) DelAllCopies() (err error)
- func (lom *LOM) DelCopies(copiesFQN ...string) (err error)
- func (lom *LOM) DelCustomKey(key string)
- func (lom *LOM) DelExtraCopies(fqn ...string) (removed bool, err error)
- func (lom *LOM) Digest() uint64
- func (lom *LOM) DowngradeLock()
- func (lom *LOM) ECEnabled() bool
- func (lom *LOM) ETag(mtime time.Time, allowSyscall bool) string
- func (lom *LOM) EqCksum(cksum *cos.Cksum) bool
- func (lom *LOM) FromFS() error
- func (lom *LOM) Fstat(getAtime bool) (size, atimefs int64, mtime time.Time, _ error)
- func (lom *LOM) GenFQN(cttype string, extras ...string) string
- func (lom *LOM) GetCopies() fs.MPI
- func (lom *LOM) GetCustomKey(key string) (string, bool)
- func (lom *LOM) GetCustomMD() cos.StrKVs
- func (lom *LOM) GetROC(latestVer, sync bool) (resp ReadResp)
- func (lom *LOM) GetXattr(buf []byte) ([]byte, error)
- func (lom *LOM) GetXattrN(name string) ([]byte, error)
- func (lom *LOM) HasCopies() bool
- func (lom *LOM) HrwTarget(smap *meta.Smap) (tsi *meta.Snode, local bool, err error)
- func (lom *LOM) IncVersion() error
- func (lom *LOM) InitBck(bck *meta.Bck) (err error)
- func (lom *LOM) InitCT(ct *CT)
- func (lom *LOM) InitCmnBck(bck *cmn.Bck) (err error)
- func (lom *LOM) InitFQN(fqn string, expbck *cmn.Bck) error
- func (lom *LOM) IsChunked(special ...bool) bool
- func (lom *LOM) IsCopy() bool
- func (lom *LOM) IsFeatureSet(f feat.Flags) bool
- func (lom *LOM) IsFntl() bool
- func (lom *LOM) IsHRW() bool
- func (lom *LOM) IsLocked() int
- func (lom *LOM) IsPrimaryCopy(avail fs.MPI, hmi *fs.Mountpath, sentinel string) (isPrimary, mainExists bool)
- func (lom *LOM) LIF() (lif LIF)
- func (lom *LOM) LastModified() (time.Time, error)
- func (lom *LOM) LastModifiedLso() (string, time.Time)
- func (lom *LOM) LastModifiedStr() (string, time.Time)
- func (lom *LOM) LeastUtilNoCopy() (mi *fs.Mountpath)
- func (lom *LOM) Load(cacheit, locked bool) error
- func (lom *LOM) LoadLatest(latest bool) (oa *cmn.ObjAttrs, deleted bool, err error)
- func (lom *LOM) LoadMetaFromFS() error
- func (lom *LOM) Location() string
- func (lom *LOM) Lock(exclusive bool)
- func (lom *LOM) Lsize(special ...bool) int64
- func (lom *LOM) MirrorConf() *cmn.MirrorConf
- func (lom *LOM) MirrorPaths() []string
- func (lom *LOM) Mountpath() *fs.Mountpath
- func (lom *LOM) NewArchpathReader(lh cos.LomReader, archpath, mime string) (csl cos.ReadCloseSizer, err error)
- func (lom *LOM) NewDeferROC(loaded bool) (cos.ReadOpenCloser, error)
- func (lom *LOM) NewHandle(loaded bool) (*LomHandle, error)
- func (lom *LOM) NewUfestReader() (cos.LomReader, error)
- func (lom *LOM) NumCopies() int
- func (lom *LOM) ObjAttrs() *cmn.ObjAttrs
- func (lom *LOM) ObjectName() string
- func (lom *LOM) Open() (lh cos.LomReader, err error)
- func (lom *LOM) OpenCopy() (cos.LomReader, string)
- func (lom *LOM) OrigFntl() []string
- func (lom *LOM) Persist() error
- func (lom *LOM) PersistMain(isChunked bool) error
- func (lom *LOM) PopFntl(saved []string)
- func (lom *LOM) PostInit() error
- func (lom *LOM) PreInit(fqn string) error
- func (lom *LOM) PushFntl(short []string) (saved []string)
- func (lom *LOM) Recache()
- func (lom *LOM) RemoveMain() error
- func (lom *LOM) RemoveObj(force ...bool) (err error)
- func (lom *LOM) RenameFinalize(wfqn string) error
- func (lom *LOM) RenameMainTo(wfqn string) error
- func (lom *LOM) RenameToMain(wfqn string) error
- func (lom *LOM) RestoreToLocation() (exists bool)
- func (lom *LOM) SetAtimeUnix(tu int64)
- func (lom *LOM) SetCksum(cksum *cos.Cksum)
- func (lom *LOM) SetCustomKey(key, value string)
- func (lom *LOM) SetCustomMD(md cos.StrKVs)
- func (lom *LOM) SetSize(size int64)
- func (lom *LOM) SetVersion(ver string)
- func (lom *LOM) SetXattr(data []byte) error
- func (lom *LOM) SetXattrN(name string, data []byte) error
- func (lom *LOM) ShortenFntl() []string
- func (lom *LOM) String() string
- func (lom *LOM) TestAtime() error
- func (lom *LOM) ToMpath(avail fs.MPI) (*fs.Mountpath, bool)
- func (lom *LOM) TryLock(exclusive bool) bool
- func (lom *LOM) Uname() string
- func (lom *LOM) UnamePtr() *string
- func (lom *LOM) Uncache()
- func (lom *LOM) UncacheDel()
- func (lom *LOM) UncacheUnless()
- func (lom *LOM) Unlock(exclusive bool)
- func (lom *LOM) UpgradeLock() (finished bool)
- func (lom *LOM) ValidateColdGet() bool
- func (lom *LOM) ValidateContentChecksum(locked bool) (err error)
- func (lom *LOM) ValidateMetaChecksum() error
- func (lom *LOM) ValidateWarmGet() bool
- func (lom *LOM) Version(special ...bool) string
- func (lom *LOM) VersionConf() cmn.VersionConf
- func (lom *LOM) VersionPtr() *string
- func (lom *LOM) WritePolicy() (p apc.WritePolicy)
- type LomHandle
- type LsoInvCtx
- type NLP
- type Node
- type Notif
- type NotifMsg
- type PromoteParams
- type PutParams
- type PutWOC
- type QuiCB
- type QuiRes
- type ReadResp
- type Snap
- func (xsnap *Snap) IsAborted() bool
- func (xsnap *Snap) IsFinished() bool
- func (xsnap *Snap) IsIdle() bool
- func (xsnap *Snap) IsRunning() bool
- func (xsnap *Snap) Pack(njoggers, nworkers int, chanFull int64)
- func (xsnap *Snap) Started() bool
- func (xsnap *Snap) Unpack() (njoggers, nworkers, chanFull int)
- type Stats
- type Target
- type TargetLoc
- type TargetPut
- type Uchunk
- type Ufest
- func (u *Ufest) Abort(lom *LOM)
- func (u *Ufest) Add(c *Uchunk, size, num int64) error
- func (u *Ufest) Check(completed bool) error
- func (u *Ufest) Completed() bool
- func (u *Ufest) ComputeWholeChecksum(cksumH *cos.CksumHash) error
- func (u *Ufest) Count() int
- func (u *Ufest) Created() time.Time
- func (u *Ufest) ETagS3() (string, error)
- func (u *Ufest) GetChunk(num int) (*Uchunk, error)
- func (u *Ufest) ID() string
- func (u *Ufest) IsHRW(avail fs.MPI) (bool, error)
- func (u *Ufest) LoadCompleted(lom *LOM) error
- func (u *Ufest) LoadPartial(lom *LOM) error
- func (u *Ufest) Lock()
- func (u *Ufest) Lom() *LOM
- func (u *Ufest) NewChunk(num int, lom *LOM) (*Uchunk, error)
- func (u *Ufest) NewReader() (*UfestReader, error)
- func (u *Ufest) Relocate(hrwMi *fs.Mountpath, buf []byte) (*LOM, error)
- func (u *Ufest) Size() int64
- func (u *Ufest) StorePartial(lom *LOM, locked bool) error
- func (u *Ufest) Unlock()
- func (u *Ufest) ValidateChunkLocations(completed bool) error
- type UfestReader
- type Upon
- type Xact
Constants ¶
const ( RemoteDeletedDelCount = "remote.deleted.del.n" // lcache stats LcacheCollisionCount = "lcache.collision.n" LcacheEvictedCount = "lcache.evicted.n" LcacheErrCount = "err.lcache.n" // errPrefix + "lcache.n" LcacheFlushColdCount = "lcache.flush.cold.n" )
core stats
const ( // backward compat v3.31 and prior MetaverLOM_V1 = 1 //nolint:revive // readability // current MetaverLOM = 2 )
LOM
const ( Targets = iota // 0 (core.Targets) used as default value for NewStreamBundle Proxies AllNodes SelectedNodes )
const ( UponTerm = Upon(1 << iota) // success or fail is separately provided via error UponProgress // periodic (BytesCount, ObjCount) )
enum: when to notify
const ( QuiInactiveCB = QuiRes(iota) // e.g., no pending requests (NOTE: used exclusively by `quicb` callbacks) QuiActive // active (e.g., receiving data) QuiActiveRet // active that immediately breaks waiting for quiecscence QuiActiveDontBump // active that does not increase inactivity duration (ie., keeps initial setting) QuiDone // all done QuiAborted // aborted QuiTimeout // timeout Quiescent // idle => quiescent )
const (
AisBID = cos.MSB64
)
const (
DumpLomEnvVar = "AIS_DUMP_LOM"
)
cmd/xmeta support
const (
// MaxChunkCount is the maximum number of chunks allowed per object (limited by uint16 chunk numbering)
MaxChunkCount = 9999
)
Variables ¶
This section is empty.
Functions ¶
func FreePutParams ¶
func FreePutParams(a *PutParams)
func LcacheClear ¶ added in v1.3.28
func LcacheClear()
func LcacheClearBcks ¶ added in v1.3.28
func LcacheClearMpath ¶ added in v1.3.28
func ParseObjLoc ¶
Types ¶
type AllRunningInOut ¶
type Backend ¶ added in v1.3.23
type Backend interface {
Provider() string
MetricName(string) string
CreateBucket(bck *meta.Bck) (ecode int, err error)
ListBuckets(qbck cmn.QueryBcks) (bcks cmn.Bcks, ecode int, err error)
// list-objects
ListObjects(bck *meta.Bck, msg *apc.LsoMsg, lst *cmn.LsoRes) (ecode int, err error)
ListObjectsInv(bck *meta.Bck, msg *apc.LsoMsg, lst *cmn.LsoRes, ctx *LsoInvCtx) error
PutObj(ctx context.Context, r io.ReadCloser, lom *LOM, origReq *http.Request) (ecode int, err error)
DeleteObj(ctx context.Context, lom *LOM) (ecode int, err error)
// head
HeadBucket(ctx context.Context, bck *meta.Bck) (bckProps cos.StrKVs, ecode int, err error)
HeadObj(ctx context.Context, lom *LOM, origReq *http.Request) (objAttrs *cmn.ObjAttrs, ecode int, err error)
// get (exclusively via GetCold; calls GetObjReader)
GetObj(ctx context.Context, lom *LOM, owt cmn.OWT, origReq *http.Request) (ecode int, err error)
// get (jobs; REST)
GetObjReader(ctx context.Context, lom *LOM, offset, length int64) GetReaderResult
// bucket inventory
GetBucketInv(bck *meta.Bck, ctx *LsoInvCtx) (ecode int, err error)
// multipart upload
StartMpt(lom *LOM, r *http.Request) (uploadID string, ecode int, err error)
PutMptPart(lom *LOM, reader cos.ReadOpenCloser, r *http.Request, uploadID string, size int64, partNum int32) (etag string, ecode int, err error)
CompleteMpt(lom *LOM, r *http.Request, uploadID string, body []byte, parts apc.MptCompletedParts) (version, etag string, ecode int, err error)
AbortMpt(lom *LOM, r *http.Request, uploadID string) (ecode int, err error)
}
type BlobParams ¶ added in v1.3.23
type BlobParams struct {
Lom *LOM
Msg *apc.BlobMsg
// When `RespWriter` is set, `XactBlobDl` not only downloads chunks into the cluster,
// but also stitches them together and sequentially writes to `RespWriter`.
// This makes the blob downloading job synchronous and blocking until all chunks are written.
// Only set this if you need to simultaneously download and write to the response writer (e.g., for streaming blob GET).
RespWriter io.Writer
}
intra-cluster data path: control structures and types
type CT ¶
type CT struct {
// contains filtered or unexported fields
}
func NewCTFromBO ¶
construct, init bucket and compute HRW (similar to lom.InitBck())
func NewCTFromFQN ¶
full construction and init, including: - parse fqn - init bucket - HRW
func NewCTFromLOM ¶
bare minimum: from LOM
func NewCTFromParsed ¶ added in v1.4.0
bare minimum: from fs.ParsedFQN
func NewDsortCT ¶ added in v1.4.0
usage: dsort only
func (*CT) ContentType ¶
func (*CT) LoadSliceFromFS ¶ added in v1.3.24
func (*CT) ObjectName ¶
type ETLArgs ¶ added in v1.3.31
type ETLArgs struct {
TransformArgs string // optional and ETL-specific; can be used to indicate transformation on a per-object basis
Pipeline apc.ETLPipeline // intermediate ETL pod's address or destination target's address for direct put
}
GetROC defines a function that retrieves an object based on the given `lom` and flags. If `Pipeline` are provided, the implementation may choose to deliver the object directly, in which case the returned ReadResp will have R = nil and Ecode = 204.
Implementations include: - `core.DefaultGetROC`: fetches from local or remote backend - `etl.HTTPCommunicator.OfflineTransform`: fetches transformed object from ETL pod through HTTP response - `etl.statefulCommnicator.Transform`: fetches transformed object from ETL pod through WebSocket message
type GetReaderResult ¶
type LIF ¶
type LIF struct {
// contains filtered or unexported fields
}
LOM In Flight (LIF)
type LOM ¶
type LOM struct {
ObjName string
FQN string
HrwFQN *string // (=> main replica)
// contains filtered or unexported fields
}
func (*LOM) AppendWork ¶ added in v1.3.24
append
func (*LOM) CheckRemoteMD ¶
NOTE: - [PRECONDITION]: `versioning.validate_warm_get` || QparamLatestVer - [Sync] when Sync option is used (via bucket config and/or `sync` argument) caller MUST take wlock or rlock - [MAY] delete remotely-deleted (non-existing) object and increment associated stats counter
also returns `NotFound` after removing local replica - the Sync option
func (*LOM) CleanupCopies ¶ added in v1.4.2
remove stale copy metadata entries (copies on unavailable or disabled mountpaths) and return the expected number of copies per config and the actual number of valid copies remaining; must be called under w-lock (usage: resilvering)
func (*LOM) CloneTo ¶ added in v1.3.30
allocates and copies metadata (in particular, atime and uname) NOTE: cloned lom.bid() == 0 is possible - copying/transforming scenarios
func (*LOM) CompleteUfest ¶ added in v1.4.0
func (*LOM) ComputeCksum ¶
func (*LOM) Copy ¶
increment the object's num copies by (well) copying the former (compare with lom.Copy2FQN below) TODO: add T.FSHC() calls _after_ having disambiguated source vs destination (to blame)
func (*LOM) Copy2FQN ¶
copy object => any local destination usage: copying between different buckets (compare with lom.Copy() above) compare w/ Ufest.Relocate(lom)
func (*LOM) CopyVersion ¶ added in v1.3.24
func (*LOM) CreateSlice ¶ added in v1.3.24
func (*LOM) CreateWork ¶ added in v1.3.24
func (*LOM) DelAllCopies ¶
func (*LOM) DelCustomKey ¶ added in v1.4.0
func (*LOM) DelExtraCopies ¶
DelExtraCopies deletes obj replicas that are not part of the lom.md.copies metadata (cleanup)
func (*LOM) DowngradeLock ¶
func (lom *LOM) DowngradeLock()
func (*LOM) ETag ¶ added in v1.4.2
allowGen=false: return only existing (custom or MD5) values allowGen=true: as the name implies
func (*LOM) GetCopies ¶
GetCopies returns all copies - copies include lom.FQN aka "main repl." - caller must take a lock
func (*LOM) IncVersion ¶
func (*LOM) IsCopy ¶
given an existing (on-disk) object, determines whether it is a _copy_ (compare with isMirror below)
func (*LOM) IsPrimaryCopy ¶ added in v1.4.2
func (lom *LOM) IsPrimaryCopy(avail fs.MPI, hmi *fs.Mountpath, sentinel string) (isPrimary, mainExists bool)
deterministically pick a copy to restore any missing ones must be called under w-lock (usage: resilvering)
func (*LOM) LastModifiedLso ¶ added in v1.4.2
NOTE:
- (list-objects, S3): prefer stored RFC3339 (cmn.LsoLastModified);
- else convert Last-Modified (http.TimeFormat) to RFC3339;
- else (perf) fall back to atime when available
- clients requiring strict S3 semantics with ais:// buckets must use HEAD(object) (which is allowed to execute syscalls)
func (*LOM) LastModifiedStr ¶ added in v1.4.2
(same as above when callers want a string)
func (*LOM) LeastUtilNoCopy ¶
returns the least-utilized mountpath that does _not_ have a copy of this `lom` yet (compare with leastUtilCopy())
func (*LOM) Load ¶
no lock is taken when locked by an immediate caller, or otherwise is known to be locked otherwise, try Rlock temporarily _if and only when_ reading from fs
(compare w/ LoadUnsafe() below)
func (*LOM) LoadLatest ¶
NOTE: Sync is false (ie., not deleting)
func (*LOM) LoadMetaFromFS ¶
NOTE usage: tests and `xmeta` only; ignores `dirty`
func (*LOM) Lsize ¶ added in v1.3.24
special a) when a new version is being created b) for usage in unit tests
func (*LOM) MirrorConf ¶
func (lom *LOM) MirrorConf() *cmn.MirrorConf
func (*LOM) MirrorPaths ¶ added in v1.3.30
func (*LOM) NewArchpathReader ¶ added in v1.3.30
func (lom *LOM) NewArchpathReader(lh cos.LomReader, archpath, mime string) (csl cos.ReadCloseSizer, err error)
extract a single file from a (.tar, .tgz or .tar.gz, .zip, .tar.lz4) shard uses the provided `mime` or lom.ObjName to detect formatting (empty = auto-detect)
func (*LOM) NewDeferROC ¶
func (lom *LOM) NewDeferROC(loaded bool) (cos.ReadOpenCloser, error)
is called under rlock; unlocks on fail NOTE: compare w/ lom.Open() returning cos.LomReader
func (*LOM) NewUfestReader ¶ added in v1.4.0
func (*LOM) Open ¶ added in v1.3.24
open read-only, return a reader see also: lom.NewDeferROC() see also: lom.GetROC()
func (*LOM) OpenCopy ¶ added in v1.4.0
load-balanced GET from replicated lom - picks least-utilized mountpath - returns (open reader + its FQN) or (nil, "")
func (*LOM) PersistMain ¶
func (*LOM) RemoveMain ¶ added in v1.3.24
func (*LOM) RenameFinalize ¶ added in v1.3.24
func (*LOM) RenameMainTo ¶ added in v1.3.24
func (*LOM) RenameToMain ¶ added in v1.3.24
func (*LOM) RestoreToLocation ¶
RestoreObjectFromAny tries to restore the object at its default location. Returns true if object exists, false otherwise TODO: locking vs concurrent restore: consider (read-lock object + write-lock meta) split
func (*LOM) SetAtimeUnix ¶
func (*LOM) SetCustomKey ¶
func (*LOM) SetCustomMD ¶
func (*LOM) SetVersion ¶
func (*LOM) ShortenFntl ¶ added in v1.3.26
(compare with fs/content Gen())
func (*LOM) ToMpath ¶
must be called under w-lock returns mountpath to relocate or copy this lom, or nil if none required/available return fixHrw = true when lom is currently misplaced - checks hrw location first, and - checks copies (if any) against the current configuration and available mountpaths; - does not check `fstat` in either case (usage: resilvering)
func (*LOM) UpgradeLock ¶
func (*LOM) ValidateColdGet ¶ added in v1.4.0
func (*LOM) ValidateContentChecksum ¶
ValidateDiskChecksum validates if checksum stored in lom's in-memory metadata matches object's content checksum. Use lom.ValidateMetaChecksum() to check lom's checksum vs on-disk metadata.
func (*LOM) ValidateMetaChecksum ¶
ValidateMetaChecksum validates whether checksum stored in lom's in-memory metadata matches checksum stored on disk. Use lom.ValidateContentChecksum() to recompute and check object's content checksum.
func (*LOM) ValidateWarmGet ¶
func (*LOM) VersionConf ¶
func (lom *LOM) VersionConf() cmn.VersionConf
func (*LOM) VersionPtr ¶ added in v1.3.24
func (*LOM) WritePolicy ¶
func (lom *LOM) WritePolicy() (p apc.WritePolicy)
type NLP ¶
type NLP interface {
Lock()
TryLock(timeout time.Duration) bool
TryRLock(timeout time.Duration) bool
Unlock()
}
pair
type Node ¶
type Node interface {
SID() string
String() string
Snode() *meta.Snode
Bowner() meta.Bowner
Sowner() meta.Sowner
ClusterStarted() bool
NodeStarted() bool
StatsUpdater() cos.StatsUpdater
// Memory allocators
PageMM() *memsys.MMSA
ByteMM() *memsys.MMSA
}
cluster node
type Notif ¶
type Notif interface {
OnFinishedCB() func(Notif, error, bool)
OnProgressCB() func(Notif)
NotifyInterval() time.Duration // notify interval in secs
LastNotifTime() int64 // time last notified
SetLastNotified(now int64)
Upon(u Upon) bool
Subscribers() []string
ToNotifMsg(aborted bool) NotifMsg
}
intra-cluster notification interface
type NotifMsg ¶
type NotifMsg struct {
UUID string `json:"uuid"` // xaction UUID
NodeID string `json:"node_id"` // notifier node ID
Kind string `json:"kind"` // xaction `Kind`
ErrMsg string `json:"err"` // error.Error()
Data []byte `json:"message"` // (e.g. usage: custom progress stats)
AbortedX bool `json:"aborted"` // true if aborted (see related: Snap.AbortedX)
}
intra-cluster notification message
type PromoteParams ¶
type PromoteParams struct {
Bck *meta.Bck // destination bucket
Cksum *cos.Cksum // checksum to validate
Config *cmn.Config // during xaction
Xact Xact // responsible xaction
apc.PromoteArgs // all of the above
}
intra-cluster data path: control structures and types
type PutParams ¶
type PutParams struct {
Reader io.ReadCloser
Cksum *cos.Cksum // checksum to check
Atime time.Time
Xact Xact
WorkTag string // (=> work fqn)
Size int64
ChunkSize int64 // if set, the object will be chunked with this size regardless of the bucket's chunk properties
OWT cmn.OWT
SkipEC bool // don't erasure-code when finalizing
ColdGET bool // this PUT is in fact a cold-GET
Locked bool // true if the LOM is already locked by the caller
}
intra-cluster data path: control structures and types
func AllocPutParams ¶
func AllocPutParams() (a *PutParams)
type ReadResp ¶ added in v1.3.28
type ReadResp struct {
R cos.ReadOpenCloser // Reader for the object content, may be nil if already delivered
OAH cos.OAH
Err error
Ecode int
Remote bool
}
ReadResp represents the status, attributes, and reader of an object from the source provider - Ecode 200 (http.StatusOK): the object is successfully retrieved; content available in `R`. - Ecode 204 (http.StatusNoContent): object has already been delivered directly to `daddr`, R is nil.
type Snap ¶
type Snap struct {
// xaction-specific stats counters
Ext any `json:"ext"`
// common static props
StartTime time.Time `json:"start-time"`
EndTime time.Time `json:"end-time"`
Bck cmn.Bck `json:"bck"`
SrcBck cmn.Bck `json:"src-bck"`
DstBck cmn.Bck `json:"dst-bck"`
ID string `json:"id"`
Kind string `json:"kind"`
CtlMsg string `json:"ctlmsg,omitempty"` // initiating control msg (a.k.a. "run options"; added v3.26)
// extended error info
AbortErr string `json:"abort-err"`
Err string `json:"err"`
// packed field: number of workers, et al.
Packed int64 `json:"glob.id,string"`
// common runtime: stats counters (above) and state
Stats Stats `json:"stats"`
AbortedX bool `json:"aborted"`
IdleX bool `json:"is_idle"`
}
func (*Snap) IsFinished ¶ added in v1.4.1
type Stats ¶
type Stats struct {
Objs int64 `json:"loc-objs,string"` // locally processed
Bytes int64 `json:"loc-bytes,string"` //
OutObjs int64 `json:"out-objs,string"` // transmit
OutBytes int64 `json:"out-bytes,string"` //
InObjs int64 `json:"in-objs,string"` // receive
InBytes int64 `json:"in-bytes,string"`
}
type Target ¶
type Target interface {
TargetLoc
// target <=> target & target => backend (no streams)
DataClient() *http.Client
// core object (+ PutObject above)
FinalizeObj(lom *LOM, workFQN string, xctn Xact, owt cmn.OWT) (ecode int, err error)
EvictObject(lom *LOM) (ecode int, err error)
DeleteObject(lom *LOM, evict bool) (ecode int, err error)
GetCold(ctx context.Context, lom *LOM, xkind string, owt cmn.OWT) (ecode int, err error)
HeadCold(lom *LOM, origReq *http.Request) (objAttrs *cmn.ObjAttrs, ecode int, err error)
Promote(params *PromoteParams) (ecode int, err error)
HeadObjT2T(lom *LOM, si *meta.Snode) bool
ECRestoreReq(ct *CT, si *meta.Snode, uuid string) error
BMDVersionFixup(r *http.Request, bck ...cmn.Bck)
GetFromNeighbor(params *GfnParams) (*http.Response, error)
}
all of the above; for implementations, see `ais/tgtimpl.go` and `ais/htrun.go`
var (
T Target
)
target only
type TargetLoc ¶
type TargetLoc interface {
TargetPut
fs.HC
// backend
Backend(*meta.Bck) Backend
// Node health
Health(si *meta.Snode, timeout time.Duration, query url.Values) (body []byte, ecode int, err error)
}
local target node
type TargetPut ¶
type TargetPut interface {
Node
// Space
OOS(*fs.CapStatus, *cmn.Config, *fs.Tcdf) fs.CapStatus
// xactions (jobs) now
GetAllRunning(inout *AllRunningInOut, periodic bool)
// PUT params.Reader => lom
PutObject(lom *LOM, params *PutParams) (err error)
// utilize blob downloader to cold-GET => (lom | custom write callback)
GetColdBlob(params *BlobParams, oa *cmn.ObjAttrs) (xctn Xact, err error)
}
a node that can also write objects
type Uchunk ¶ added in v1.4.0
type Uchunk struct {
ETag string // S3/legacy
MD5 []byte // ditto
// contains filtered or unexported fields
}
type Ufest ¶ added in v1.4.0
type Ufest struct {
// contains filtered or unexported fields
}
func (*Ufest) Add ¶ added in v1.4.0
(when manifest may be shared: locking is caller's responsibility)
func (*Ufest) ComputeWholeChecksum ¶ added in v1.4.0
reread all chunk payloads to compute a checksum of the given type TODO: avoid the extra pass by accumulating during AddPart/StorePartial or by caching a tree-hash see also: s3/mpt for ListParts
func (*Ufest) GetChunk ¶ added in v1.4.0
(when manifest may be shared: locking is caller's responsibility)
func (*Ufest) LoadCompleted ¶ added in v1.4.0
must be called under lom (r)lock
func (*Ufest) LoadPartial ¶ added in v1.4.0
func (*Ufest) NewChunk ¶ added in v1.4.0
construct a new chunk and its pathname - arg `num` is chunk.num (starts from 1) - chunk #1 stays on the object's mountpath - see chunk1Path() - other chunks get HRW distributed
func (*Ufest) NewReader ¶ added in v1.4.0
func (u *Ufest) NewReader() (*UfestReader, error)
func (*Ufest) StorePartial ¶ added in v1.4.0
func (*Ufest) ValidateChunkLocations ¶ added in v1.4.2
note: used only in tests and asserts
type UfestReader ¶ added in v1.4.0
type UfestReader struct {
// contains filtered or unexported fields
}
func (*UfestReader) Close ¶ added in v1.4.0
func (r *UfestReader) Close() error
func (*UfestReader) ReadAt ¶ added in v1.4.0
func (r *UfestReader) ReadAt(p []byte, off int64) (n int, err error)
consistent with io.ReaderAt semantics: - do not use or modify reader's offset (r.goff) or any other state - open the needed chunk(s) transiently and close them immediately - return io.EOF when less than len(p)
type Xact ¶
type Xact interface {
Run(*sync.WaitGroup)
ID() string
Kind() string
Bck() *meta.Bck
FromTo() (*meta.Bck, *meta.Bck)
StartTime() time.Time
EndTime() time.Time
IsDone() bool
IsRunning() bool
IsIdle() bool
Quiesce(time.Duration, QuiCB) QuiRes
// abrt
IsAborted() bool
AbortErr() error
AbortedAfter(time.Duration) error
ChanAbort() <-chan error
// err (info)
AddErr(error, ...int)
// to support api.QueryXactionSnaps
CtlMsg() string
Snap() *Snap // (struct below)
// reporting: log, err
String() string
Name() string
Cname() string
// modifiers
Finish()
Abort(error) bool
AddNotif(n Notif)
// common stats
GetStats
}