Class: RedisClient::Cluster::Node::Info

Inherits:
Struct
  • Object
show all
Defined in:
lib/redis_client/cluster/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#config_epochObject

Returns the value of attribute config_epoch

Returns:

  • (Object)

    the current value of config_epoch



34
35
36
# File 'lib/redis_client/cluster/node.rb', line 34

def config_epoch
  @config_epoch
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



34
35
36
# File 'lib/redis_client/cluster/node.rb', line 34

def id
  @id
end

Returns the value of attribute link_state

Returns:

  • (Object)

    the current value of link_state



34
35
36
# File 'lib/redis_client/cluster/node.rb', line 34

def link_state
  @link_state
end

#node_keyObject

Returns the value of attribute node_key

Returns:

  • (Object)

    the current value of node_key



34
35
36
# File 'lib/redis_client/cluster/node.rb', line 34

def node_key
  @node_key
end

#ping_sentObject

Returns the value of attribute ping_sent

Returns:

  • (Object)

    the current value of ping_sent



34
35
36
# File 'lib/redis_client/cluster/node.rb', line 34

def ping_sent
  @ping_sent
end

#pong_recvObject

Returns the value of attribute pong_recv

Returns:

  • (Object)

    the current value of pong_recv



34
35
36
# File 'lib/redis_client/cluster/node.rb', line 34

def pong_recv
  @pong_recv
end

#primary_idObject

Returns the value of attribute primary_id

Returns:

  • (Object)

    the current value of primary_id



34
35
36
# File 'lib/redis_client/cluster/node.rb', line 34

def primary_id
  @primary_id
end

#roleObject

Returns the value of attribute role

Returns:

  • (Object)

    the current value of role



34
35
36
# File 'lib/redis_client/cluster/node.rb', line 34

def role
  @role
end

#slotsObject

Returns the value of attribute slots

Returns:

  • (Object)

    the current value of slots



34
35
36
# File 'lib/redis_client/cluster/node.rb', line 34

def slots
  @slots
end

Instance Method Details

#primary?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/redis_client/cluster/node.rb', line 40

def primary?
  role == 'master'
end

#replica?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/redis_client/cluster/node.rb', line 44

def replica?
  role == 'slave'
end

#serialize(str) ⇒ Object



48
49
50
# File 'lib/redis_client/cluster/node.rb', line 48

def serialize(str)
  str << id << node_key << role << primary_id << config_epoch
end