Hi, Roland.

2013/3/8 Roland von Herget <[email protected]>:
>>   public static<K> void insertSubColumn(Mutator<K> mutator, K key,
>> String columnFamily, String superColumnName, ByteBuffer columnName,
>> ByteBuffer columnValue) {
>>
>>   synchronized(mutator){
>>     mutator.insert(key, columnFamily,
>> createSuperColumn(superColumnName, columnName, columnValue));
>>   }
>>
>> }
>
> Why not just do exactly this, but inside CassandraClient (as in my
> patch in GORA-211) ?
> That's the point the mutator is coming from. And everybody who touches
> this in the future will recognize it needs sync.
>
>> Is this right?
> You really ask me? ;)
>
> --Roland

Oh, didn't check GORA-211 patches, sorry :(
Right, do like you did, but make the lock on mutator (not need for a
mutatorLock). Perfect, you nailed it :)

Maybe in HectorUtils should be some notice about not thread safe.

Just as comment, the best solution would be create a new class
MutatorSynchronized extending MutatorImpl, but seems HFactory is not
much configurable, so will be undesirable anyway :( (A factory for
that? ooooh :C )

So, do it in CassandraClient :)

Thank you, good work!

Regards,

Alfonso Nishikawa

Reply via email to