public class LocalReplica extends KetchReplica
KetchLeader
.KetchReplica.CommitMethod, KetchReplica.CommitSpeed, KetchReplica.Participation, KetchReplica.State
Constructor and Description |
---|
LocalReplica(KetchLeader leader,
String name,
ReplicaConfig cfg)
Configure a local replica.
|
Modifier and Type | Method and 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.
|
getCommitMethod, getCommitSpeed, getLeader, getName, getParticipation, getSystem, prepareCommit, shutdown
public LocalReplica(KetchLeader leader, String name, ReplicaConfig cfg)
leader
- instance this replica follows.name
- unique-ish name identifying this replica for debugging.cfg
- how Ketch should treat the local system.protected String describeForLog()
describeForLog
in class KetchReplica
protected void startPush(ReplicaPushRequest req)
This method must move processing onto another thread. Called with
KetchLeader.lock
held by caller.
startPush
in class KetchReplica
req
- the request to send to the replica.protected void blockingFetch(Repository repo, ReplicaFetchRequest req) throws IOException
Called without KetchLeader.lock
.
blockingFetch
in class KetchReplica
repo
- local repository to fetch objects into.req
- the request to fetch from a replica.IOException
- communication with the replica was not possible.Copyright © 2019 Eclipse JGit Project. All rights reserved.