/// <summary> /// Gets the <see cref="Server"/> or node that a key has been mapped to. /// </summary> /// <param name="key">The key to get or set.</param> /// <param name="vBucket">The VBucket the key belongs to.</param> /// <returns>The <see cref="IServer"/> that the key is mapped to.</returns> public IServer GetServer(string key, out IVBucket vBucket) { var keyMapper = ConfigInfo.GetKeyMapper(); vBucket = (IVBucket)keyMapper.MapKey(key); return(vBucket.LocatePrimary()); }
public void TestLocatePrimary() { var primary = _vBucket.LocatePrimary(); var expected = _servers.First(); Assert.Equal(expected, primary); }
public void TestLocatePrimary() { var primary = _vBucket.LocatePrimary(); Assert.IsNotNull(primary); var expected = _servers.First(); Assert.AreSame(expected.Value, primary); }