github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/cmn/cifl/info.go (about)

     1  // Package cifl: cluster information and flags
     2  /*
     3   * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
     4   */
     5  package cifl
     6  
     7  import "fmt"
     8  
     9  type (
    10  	Info struct {
    11  		Smap struct {
    12  			Primary struct {
    13  				PubURL  string `json:"pub_url"`
    14  				CtrlURL string `json:"control_url"`
    15  				ID      string `json:"id"`
    16  			}
    17  			Version int64  `json:"version,string"`
    18  			UUID    string `json:"uuid"`
    19  		} `json:"smap"`
    20  		BMD struct {
    21  			UUID    string `json:"uuid"`
    22  			Version int64  `json:"version,string"`
    23  		} `json:"bmd"`
    24  		RMD struct {
    25  			Version int64 `json:"version,string"`
    26  		} `json:"rmd"`
    27  		Config struct {
    28  			Version int64 `json:"version,string"`
    29  		} `json:"config"`
    30  		EtlMD struct {
    31  			Version int64 `json:"version,string"`
    32  		} `json:"etlmd"`
    33  		Flags Flags `json:"flags"`
    34  	}
    35  )
    36  
    37  func (cii *Info) String() string { return fmt.Sprintf("%+v", *cii) }
    38  
    39  func (cii *Info) SmapEqual(other *Info) (ok bool) {
    40  	if cii == nil || other == nil {
    41  		return false
    42  	}
    43  	return cii.Smap.Version == other.Smap.Version && cii.Smap.Primary.ID == other.Smap.Primary.ID
    44  }