public abstract class SlavePriorities extends Object
SlavePriority implementations.| Modifier and Type | Method and Description |
|---|---|
static SlavePriority |
fixedAscending() |
static SlavePriority |
fixedDescending() |
static SlavePriority |
givenOrder() |
static SlavePriority |
roundRobin() |
public static SlavePriority givenOrder()
SlavePriority which returns the slaves in the order that
they are given in the slaves array.public static SlavePriority roundRobin()
SlavePriority which returns the slaves in a round robin
fashion, more precisely the start index in the array increments with
each prioritization, ordered
by server id in ascending.public static SlavePriority fixedDescending()
SlavePriority which returns the slaves in the same fixed order
sorted by server id in descending order.public static SlavePriority fixedAscending()
SlavePriority which returns the slaves in the same fixed order
sorted by server id in ascending order. This is generally preferrable to fixedDescending(),
because this aligns with the tie-breaker aspect of the lowest server id becoming master.
Eg. if you want to ensure that failover most likely will happen in a specific datacenter, you would place low-id instances in that datacenter and choose this strategy. That way, most of the time the most up-to-date instance will be in this data center, and if there is a tie, the tie-break will also end up electing a master in the same data center.
This is in contrast to fixedDescending(), where a high-id server is likely to be most
up-to-date if the master fails, but a low-id server is likely to be elected if there is a tie.
This makes the two scenarios consistently choose a low-id server as the new master.
Copyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.