InstanceDesc is the top-level type used to model per-instance information in a ring.
| 105 | |
| 106 | // InstanceDesc is the top-level type used to model per-instance information in a ring. |
| 107 | type InstanceDesc struct { |
| 108 | Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` |
| 109 | // Unix timestamp (with seconds precision) of the last heartbeat sent |
| 110 | // by this instance. |
| 111 | Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` |
| 112 | State InstanceState `protobuf:"varint,3,opt,name=state,proto3,enum=ring.InstanceState" json:"state,omitempty"` |
| 113 | Tokens []uint32 `protobuf:"varint,6,rep,packed,name=tokens,proto3" json:"tokens,omitempty"` |
| 114 | Zone string `protobuf:"bytes,7,opt,name=zone,proto3" json:"zone,omitempty"` |
| 115 | // Unix timestamp (with seconds precision) of when the instance has been registered |
| 116 | // to the ring. This field has not been called "joined_timestamp" intentionally, in order |
| 117 | // to not introduce any misunderstanding with the instance's "joining" state. |
| 118 | // |
| 119 | // This field is used to find out subset of instances that could have possibly owned a |
| 120 | // specific token in the past. Because of this, it's important that either this timestamp |
| 121 | // is set to the real time the instance has been registered to the ring or it's left |
| 122 | // 0 (which means unknown). |
| 123 | // |
| 124 | // When an instance is already registered in the ring with a value of 0 it's NOT safe to |
| 125 | // update the timestamp to "now" because it would break the contract, given the instance |
| 126 | // was already registered before "now". If unknown (0), it should be left as is, and the |
| 127 | // code will properly deal with that. |
| 128 | RegisteredTimestamp int64 `protobuf:"varint,8,opt,name=registered_timestamp,json=registeredTimestamp,proto3" json:"registered_timestamp,omitempty"` |
| 129 | // ID of the instance. This value is the same as the key in the ingesters map in Desc. |
| 130 | Id string `protobuf:"bytes,9,opt,name=id,proto3" json:"id,omitempty"` |
| 131 | // Unix timestamp (with seconds precision) of when the read_only flag was updated. This |
| 132 | // is used to find other instances that could have possibly owned a specific token in |
| 133 | // the past on the write path, due to *this* instance being read-only. This value should |
| 134 | // only increase. |
| 135 | ReadOnlyUpdatedTimestamp int64 `protobuf:"varint,10,opt,name=read_only_updated_timestamp,json=readOnlyUpdatedTimestamp,proto3" json:"read_only_updated_timestamp,omitempty"` |
| 136 | // Indicates whether this instance is read only. |
| 137 | // Read-only instances go through standard state changes, and special handling is applied to them |
| 138 | // during shuffle shards. |
| 139 | ReadOnly bool `protobuf:"varint,11,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` |
| 140 | // Map of component / feature identifiers to version number. |
| 141 | // The component / feature identifiers are specific to the application (ie. aren't defined in dskit). |
| 142 | // We use a uint64 for the version number itself as versions are expected to increase and be |
| 143 | // sortable. |
| 144 | Versions map[uint64]uint64 `protobuf:"bytes,12,rep,name=versions,proto3" json:"versions,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` |
| 145 | } |
| 146 | |
| 147 | func (m *InstanceDesc) Reset() { *m = InstanceDesc{} } |
| 148 | func (*InstanceDesc) ProtoMessage() {} |
nothing calls this directly
no outgoing calls
no test coverage detected