getMasterFor method

ClusterNodeInfo? getMasterFor(
  1. String key
)

Returns the ClusterNodeInfo of the master node that currently owns key. Returns null if the client is not connected or the map is not loaded.

This relies on the client's cached slot map, which is updated automatically when MOVED redirections occur.

Implementation

ClusterNodeInfo? getMasterFor(String key) => _slotMap?.getNodeForKey(key);