Hi,
I am currently looking at using folsom. One thing I want to do it to implement my own sharding (to match existing impl). To do this, I was planning to implement a class extending AbstractMultiMemcacheClient similar to KetamaMemcacheClient.
Initially I was planning to extend MemcacheClientBuilder, noticing that the MemcacheClientBuilder.connectRaw method is protected, however on closer inspection I noticed that many fields that one might want to use in that method (such as this.addresses) are not accessible. Would you have any objection to a patch that changes the current set of fields from private to protected?
Another possible alternative I was thinking about is addition of a method to the builder that allows one to pass in the code to create an AbstractMultiMemcacheClient given a list of addresses. e.g.
MemcacheClientBuilder<V> withRawClientCreator(Function<List<HostAndPort>, RawMemcacheClient> clientCreationFunction)
Then in connectRaw, use the function if it is not null, otherwise use the existing logic. Either something like this, or being able to extend and override connectRaw would work for me, but I'm wondering if there would be any interest in a solution like withRawClientCreator? Let me know what you think.
Thanks!
Hi,
I am currently looking at using folsom. One thing I want to do it to implement my own sharding (to match existing impl). To do this, I was planning to implement a class extending
AbstractMultiMemcacheClientsimilar toKetamaMemcacheClient.Initially I was planning to extend
MemcacheClientBuilder, noticing that theMemcacheClientBuilder.connectRawmethod is protected, however on closer inspection I noticed that many fields that one might want to use in that method (such as this.addresses) are not accessible. Would you have any objection to a patch that changes the current set of fields from private to protected?Another possible alternative I was thinking about is addition of a method to the builder that allows one to pass in the code to create an
AbstractMultiMemcacheClientgiven a list of addresses. e.g.Then in
connectRaw, use the function if it is not null, otherwise use the existing logic. Either something like this, or being able to extend and overrideconnectRawwould work for me, but I'm wondering if there would be any interest in a solution likewithRawClientCreator? Let me know what you think.Thanks!