public S getShardInfo(String key) { return getShardInfo(SafeEncoder.encode(getKeyTag(key))); }
public static byte[][] encodeMany(final String... strs) { byte[][] many = new byte[strs.length][]; for (int i = 0; i < strs.length; i++) { many[i] = encode(strs[i]); } return many; }
@Override public void close() { destroy(); }
@Override protected void returnResource(Jedis resource) { super.returnResource(resource); } }
@Override protected void returnBrokenResource(Jedis resource) { super.returnBrokenResource(resource); }
public ClusterNodeInformation parse(String nodeInfo, HostAndPort current) { String[] nodeInfoPartArray = nodeInfo.split(" "); HostAndPort node = getHostAndPortFromNodeLine(nodeInfoPartArray, current); ClusterNodeInformation info = new ClusterNodeInformation(node); if (nodeInfoPartArray.length >= SLOT_INFORMATIONS_START_INDEX) { String[] slotInfoPartArray = extractSlotParts(nodeInfoPartArray); fillSlotInformation(slotInfoPartArray, info); } return info; }
protected void returnResource(final T resource) { if (resource != null) { returnResourceObject(resource); } }
public void write(final byte b) throws IOException { if (count == buf.length) { flushBuffer(); } buf[count++] = b; }
private void fillSlotInformation(String[] slotInfoPartArray, ClusterNodeInformation info) { for (String slotRange : slotInfoPartArray) { fillSlotInformationFromSlotRange(slotRange, info); } }
protected void returnBrokenResource(final T resource) { if (resource != null) { returnBrokenResourceObject(resource); } }
public Sharded(List<S> shards, Hashing algo, Pattern tagPattern) { this.algo = algo; this.tagPattern = tagPattern; initialize(shards); }
public byte readByte() throws JedisConnectionException { ensureFill(); return buf[count++]; }
public Tuple(String element, Double score) { super(); this.element = SafeEncoder.encode(element); this.score = score; }
public void writeCrLf() throws IOException { if (2 >= buf.length - count) { flushBuffer(); } buf[count++] = '\r'; buf[count++] = '\n'; }
private byte[][] getByteParams(String... params) { byte[][] p = new byte[params.length][]; for (int i = 0; i < params.length; i++) p[i] = SafeEncoder.encode(params[i]); return p; }
public String getElement() { if (null != element) { return SafeEncoder.encode(element); } else { return null; } }