rantav/hector — Issue #425: Provide More Granular Control Over Failover Behavior
Author: cherron
Created: 2012-02-23 20:43:13+00:00
State: open

It would be useful to have more control over retry behavior.

An example scenario: if timeouts occur, counter increments are retried and so counter values are unpredictable. However, using FailoverPolicy.FAIL_FAST to avoid retries for timeouts means that retry will not occur for other exceptions where retry *is* desirable (e.g. HectorTransportException).

One solution would be to enhance FailoverPolicy to have (optional) pluggable behavior. Since behavior only varies based on exception types, a very simple option would be to have a property that lists exception types for which retry should/should not occur.

A more complete solution would be to relocate most of HConnectionManager.operateWithFailover's behavior into a strategy pattern with default implementation and appropriate override points. An instance of this strategy could then be attached to the FailoverPolicy.