- // We don't want the shard to become the leader so prevent shard election from completing
- // by setting the election timeout, which is based on the heartbeat interval, really high.
-
- datastoreContextBuilder.shardHeartbeatIntervalInMillis(30000);
- datastoreContextBuilder.shardInitializationTimeout(300, TimeUnit.MILLISECONDS);
+ // We don't want the shard to become the leader so prevent shard elections.
+ datastoreContextBuilder.customRaftPolicyImplementation(
+ "org.opendaylight.controller.cluster.raft.policy.DisableElectionsRaftPolicy");