Replies: 4 comments 14 replies
-
@MSPigl Thank you for sharing your use case. Let's see if anyone else has anything to say and/or ideas to share. The inspiration behind the removal of those methods is that the |
Beta Was this translation helpful? Give feedback.
-
Essentially we have some batching logic to reduce writes. We use a Essentially an abstraction layer where for example incrementing will either just add it to the queue, or also flush the queue. A queue exists by shard. public void incrementBy(IncrementOperation incrementOperation) {
String shard;
try (ShardedJedis jedis = shardInfoPool.getResource()) {
Client client = jedis.getShard(getKey(incrementOperation)).getClient();
shard = client.getHost() + ":" + client.getPort();
}
batchedUpdates.putIfAbsent(shard, new BatchedItem(DateTime.now(), new LinkedBlockingQueue<>()));
BlockingQueue<IncrementOperation> queue = batchedUpdates.get(shard).getQueue();
queue.add(incrementOperation);
maybeFlushQueue(shard, queue);
} So if we could replace host and port with another unique identifier of the shard, I think we'd be fine. |
Beta Was this translation helpful? Give feedback.
-
@MSPigl @YNedderhoff PTAL at #3137 and let me whether it fulfills your purposes. You'd be able to do |
Beta Was this translation helpful? Give feedback.
-
#3745 is just merged which could be useful in OP's use case. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm currently upgrading my team's codebase from Jedis 2.X to 4.X. In our existing code, we use
Jedis.getClient().getPort()/getHost()
, which is used for logging/unit testing to verify that external configuration matches what the application's internal configuration expects.However, 4.X switched
Jedis.getClient()
to just passthrough togetConnection()
, so I'm not seeing how I would get the host and port for a Jedis instance after the upgrade. The logic that leveragesgetHost()/getPort()
isn't application critical and could be reworked if there really is no way to get that data anymore, however I'd definitely prefer that the logic be kept.Any thoughts on how to retrieve that data in 4.X?
Beta Was this translation helpful? Give feedback.
All reactions