Package org.eclipse.jgit.internal.ketch
Class ReplicaConfig
- java.lang.Object
-
- org.eclipse.jgit.internal.ketch.ReplicaConfig
-
public class ReplicaConfig extends java.lang.Object
Configures aKetchReplica
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ReplicaConfig.UnitMap
-
Field Summary
Fields Modifier and Type Field Description private KetchReplica.CommitMethod
commitMethod
private KetchReplica.CommitSpeed
commitSpeed
private long
maxRetry
private long
minRetry
private KetchReplica.Participation
participation
-
Constructor Summary
Constructors Constructor Description ReplicaConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ReplicaConfig
fromConfig(Config cfg, java.lang.String name)
Update the configuration from a config block.KetchReplica.CommitMethod
getCommitMethod()
Get how Ketch should apply committed changes.KetchReplica.CommitSpeed
getCommitSpeed()
Get how quickly should Ketch commit.long
getMaxRetry(java.util.concurrent.TimeUnit unit)
Returns the maximum wait delay before retrying a failure.private static long
getMillis(Config cfg, java.lang.String name, java.lang.String key, long defaultValue)
long
getMinRetry(java.util.concurrent.TimeUnit unit)
Returns the minimum wait delay before retrying a failure.KetchReplica.Participation
getParticipation()
Get participation of the replica in the system.static ReplicaConfig
newFromConfig(Config cfg, java.lang.String name)
Read a configuration from a config block.
-
-
-
Field Detail
-
participation
private KetchReplica.Participation participation
-
commitMethod
private KetchReplica.CommitMethod commitMethod
-
commitSpeed
private KetchReplica.CommitSpeed commitSpeed
-
minRetry
private long minRetry
-
maxRetry
private long maxRetry
-
-
Method Detail
-
newFromConfig
public static ReplicaConfig newFromConfig(Config cfg, java.lang.String name)
Read a configuration from a config block.- Parameters:
cfg
- configuration to read.name
- of the replica being configured.- Returns:
- replica configuration for
name
.
-
getParticipation
public KetchReplica.Participation getParticipation()
Get participation of the replica in the system.- Returns:
- participation of the replica in the system.
-
getCommitMethod
public KetchReplica.CommitMethod getCommitMethod()
Get how Ketch should apply committed changes.- Returns:
- how Ketch should apply committed changes.
-
getCommitSpeed
public KetchReplica.CommitSpeed getCommitSpeed()
Get how quickly should Ketch commit.- Returns:
- how quickly should Ketch commit.
-
getMinRetry
public long getMinRetry(java.util.concurrent.TimeUnit unit)
Returns the minimum wait delay before retrying a failure.- Parameters:
unit
- to get retry delay in.- Returns:
- minimum delay before retrying a failure.
-
getMaxRetry
public long getMaxRetry(java.util.concurrent.TimeUnit unit)
Returns the maximum wait delay before retrying a failure.- Parameters:
unit
- to get retry delay in.- Returns:
- maximum delay before retrying a failure.
-
fromConfig
public ReplicaConfig fromConfig(Config cfg, java.lang.String name)
Update the configuration from a config block.- Parameters:
cfg
- configuration to read.name
- of the replica being configured.- Returns:
this
-
getMillis
private static long getMillis(Config cfg, java.lang.String name, java.lang.String key, long defaultValue)
-
-