Dmitriy,

I would stop using the word "hashcode" in this context. Hash code has a
special meaning in Ignite and is used to determine key-to-node affinity. I
agree that passing "cache_name" is the best option. I have no idea when
"cache_name" is not going to be known and do not think we need to support
this case at all. My suggestion is to drop the cache_id use case altogether.

Also I am really surprised that we do not have a cache abstraction in
python and need to pass cache name and connection into every method. To be
honest, this smells really bad that such a popular modern language like
Python forces us to have such a clumsy API. Can you please take a look at
the Redis python clients and see if there is a better way to support this?

https://redis.io/clients#python

D.


On Thu, Jul 26, 2018 at 9:51 AM, Dmitry Melnichuk <
dmitry.melnic...@nobitlost.com> wrote:

> Hi, Ilya!
>
> I considered this option. Indeed, the code would look cleaner if only one
> kind of identifier (preferably the human-readable name) was used. But there
> can be a hypothetical situation, when the user is left with hash code only.
> (For example, obtained from some other API.) It would be sad to have an
> identifier and not be able to use it.
>
> Now I really think about using hash codes and names interchangeably, so
> both
>
> ```
> cache_put(conn, 'my-cache', value=1, key='a')
> ```
>
> and
>
>
> ```
> cache_put(conn, my_hash_code, value=1, key='a')
> ```
>
> will be allowed.
>
> This will be a minor complication on my side, and quite reasonable one.
>
>
> On 07/26/2018 10:44 PM, Ilya Kasnacheev wrote:
>
>> Hello!
>>
>> Why not use cache name as string here, instead of cache_id()?
>>
>> cache_put(conn, 'my-cache', value=1, key='a')
>>
>> Regards,
>>
>>

Reply via email to