// MarkOfflineNode marks offline node in the etcd
MarkOfflineNode marks offline node in the etcd
// MarkOfflineNode marks offline node in the etcd
func (r *EtcdRegistry) MarkOfflineNode(pctx context.Context, prefix, nodeID, host string, latestKafkaPos, latestFilePos pb.Pos, latestTS int64) error {
	ctx, cancel := context.WithTimeout(pctx, r.reqTimeout)
	defer cancel()
	obj := &Status{
		NodeID:         nodeID,
		Host:           host,
		IsOffline:      true,
		LatestKafkaPos: latestKafkaPos,
		LatestFilePos:  latestFilePos,
		OfflineTS:      latestTS,
	}
	log.Infof("%s mark offline information %+v", nodeID, obj)
	objstr, err := json.Marshal(obj)
	if err != nil {
		return errors.Annotatef(err, "error marshal NodeStatus(%v)", obj)
	}
	key := r.prefixed(prefix, nodeID, "object")
	err = r.client.Update(ctx, key, string(objstr), 0)
	return errors.Trace(err)
}
func ( r * EtcdRegistry ) MarkOfflineNode ( pctx context . Context , prefix , nodeID , host string , latestKafkaPos , latestFilePos pb . Pos , latestTS int64 ) error { ctx , cancel := context . WithTimeout ( pctx , r . reqTimeout ) defer cancel ( ) obj := & Status { NodeID : nodeID , Host : host , IsOffline : true , LatestKafkaPos : latestKafkaPos , LatestFilePos : latestFilePos , OfflineTS : latestTS , } log . Infof ( " " , nodeID , obj ) objstr , err := json . Marshal ( obj ) if err != nil { return errors . Annotatef ( err , " " , obj ) } key := r . prefixed ( prefix , nodeID , " " ) err = r . client . Update ( ctx , key , string ( objstr ) , 0 ) return errors . Trace ( err ) }
MarkOfflineNode marks offline node in the etcd
MarkOfflineNode marks offline node in the etcd