Package org.eclipse.jgit.internal.ketch
Class LocalReplica
- java.lang.Object
-
- org.eclipse.jgit.internal.ketch.KetchReplica
-
- org.eclipse.jgit.internal.ketch.LocalReplica
-
public class LocalReplica extends KetchReplica
Ketch replica running on the same system as theKetchLeader
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jgit.internal.ketch.KetchReplica
KetchReplica.CommitMethod, KetchReplica.CommitSpeed, KetchReplica.Participation, KetchReplica.State
-
-
Constructor Summary
Constructors Constructor Description LocalReplica(KetchLeader leader, String name, ReplicaConfig cfg)
Configure a local replica.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
blockingFetch(Repository repo, ReplicaFetchRequest req)
Fetch objects from the remote using the calling thread.protected String
describeForLog()
Get description of this replica for error/debug logging purposes.protected void
startPush(ReplicaPushRequest req)
Begin executing a single push.-
Methods inherited from class org.eclipse.jgit.internal.ketch.KetchReplica
getCommitMethod, getCommitSpeed, getLeader, getName, getParticipation, getSystem, prepareCommit, shutdown
-
-
-
-
Constructor Detail
-
LocalReplica
public LocalReplica(KetchLeader leader, String name, ReplicaConfig cfg)
Configure a local replica.- Parameters:
leader
- instance this replica follows.name
- unique-ish name identifying this replica for debugging.cfg
- how Ketch should treat the local system.
-
-
Method Detail
-
describeForLog
protected String describeForLog()
Get description of this replica for error/debug logging purposes.- Overrides:
describeForLog
in classKetchReplica
- Returns:
- description of this replica for error/debug logging purposes.
-
startPush
protected void startPush(ReplicaPushRequest req)
Begin executing a single push.This method must move processing onto another thread. Called with
KetchLeader.lock
held by caller.- Specified by:
startPush
in classKetchReplica
- Parameters:
req
- the request to send to the replica.
-
blockingFetch
protected void blockingFetch(Repository repo, ReplicaFetchRequest req) throws IOException
Fetch objects from the remote using the calling thread.Called without
KetchLeader.lock
.- Specified by:
blockingFetch
in classKetchReplica
- Parameters:
repo
- local repository to fetch objects into.req
- the request to fetch from a replica.- Throws:
IOException
- communication with the replica was not possible.
-
-