Package org.eclipse.jgit.internal.ketch
Class RemoteGitReplica
- java.lang.Object
-
- org.eclipse.jgit.internal.ketch.KetchReplica
-
- org.eclipse.jgit.internal.ketch.RemoteGitReplica
-
public class RemoteGitReplica extends KetchReplica
Representation of a Git repository on a remote replica system.KetchLeader
will contact the replica using the Git wire protocol.The remote replica may be fully Ketch-aware, or a standard Git server.
-
-
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 RemoteGitReplica(KetchLeader leader, String name, URIish uri, ReplicaConfig cfg, RemoteConfig rc)
Configure a new remote.
-
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 RemoteConfig
getRemoteConfig()
Get optional configuration describing how to contact the peer.URIish
getURI()
Get URI to contact the remote peer repository.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
-
RemoteGitReplica
public RemoteGitReplica(KetchLeader leader, String name, URIish uri, ReplicaConfig cfg, @Nullable RemoteConfig rc)
Configure a new remote.- Parameters:
leader
- instance this replica follows.name
- unique-ish name identifying this remote for debugging.uri
- URI to connect to the follower's repository.cfg
- how Ketch should treat the remote system.rc
- optional remote configuration describing how to contact the peer repository.
-
-
Method Detail
-
getURI
public URIish getURI()
Get URI to contact the remote peer repository.- Returns:
- URI to contact the remote peer repository.
-
getRemoteConfig
@Nullable protected RemoteConfig getRemoteConfig()
Get optional configuration describing how to contact the peer.- Returns:
- optional configuration describing how to contact the peer.
-
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 NotSupportedException, TransportException
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:
NotSupportedException
TransportException
-
-