hector-client/hector — pull request #609 by doanduyhai (2013-04-04 11:03:11+00:00)
Title: Make ConfigurableConsistencyLevel thread-safe at runtime by moving the call to consistencyLevelPolicy.get(operationType) and consistencyLevelPolicy.get(operationType,cfName) out of the anonymous class Operation<T>

Right now the call to consistencyLevel.get() is always done inside the anonymous Operation class at runtime, when the operation is EXECUTED, and possibly in a thread different from the calling thread.

This design prevents the ConfigurableConsistencyLevel to set dynamic level at runtime because at the time the operation is executed, consistencyLevel.get() may return a different value.

Ideally the level should be determined and set before creating the anonymous Operation .

This pull request introduces a slight modification to solve this issue