Top Description Inners Fields Constructors Methods
org.eclipse.jgit.transport

public abstract Class BasePackFetchConnection

extends BasePackConnection
implements FetchConnection
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.transport.FetchConnection, org.eclipse.jgit.transport.Connection, java.lang.AutoCloseable
Known Direct Subclasses
org.eclipse.jgit.transport.InternalFetchConnection, org.eclipse.jgit.transport.TransportGitAnon.TcpFetchConnection, org.eclipse.jgit.transport.TransportGitSsh.SshFetchConnection, org.eclipse.jgit.transport.TransportHttp.SmartHttpFetchConnection, org.eclipse.jgit.transport.TransportLocal.ForkLocalFetchConnection
Static Imports
org.eclipse.jgit.transport.GitProtocolConstants.PACKET_DEEPEN, .GitProtocolConstants.PACKET_DEEPEN_NOT, .GitProtocolConstants.PACKET_DEEPEN_SINCE, .GitProtocolConstants.PACKET_DELIM, .GitProtocolConstants.PACKET_DONE, .GitProtocolConstants.PACKET_END, .GitProtocolConstants.PACKET_ERR, .GitProtocolConstants.PACKET_HAVE, .GitProtocolConstants.PACKET_SHALLOW, .GitProtocolConstants.PACKET_UNSHALLOW, .GitProtocolConstants.PACKET_WANT

Fetch implementation using the native Git pack transfer service.

This is the canonical implementation for transferring objects from the remote repository to the local repository by talking to the 'git-upload-pack' service. Objects are packed on the remote side into a pack file and then sent down the pipe to us.

This connection requires only a bi-directional pipe or socket, and thus is easily wrapped up into a local process pipe, anonymous TCP socket, or a command executed through an SSH tunnel.

If org.eclipse.jgit.transport.BasePackConnection#statelessRPC is true, this connection can be tunneled over a request-response style RPC system like HTTP. The RPC call boundary is determined by this class switching from writing to the OutputStream to reading from the InputStream.

Concrete implementations should just call init(java.io.InputStream, java.io.OutputStream) and readAdvertisedRefs() methods in constructor or before any use. They should also handle resources releasing in close() method if needed.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static class
private static class

Field Summary

Modifier and TypeField and Description
pack-priv final RevFlag
ADVERTISED

Marks a commit listed in the advertised refs.

private boolean
pack-priv final RevFlag
COMMON

Marks a commit known to both sides of the connection.

private List<String>
private Instant
private Integer
private final FilterSpec
filterSpec

Either FilterSpec.NO_FILTER for a filter that doesn't filter anything, or a filter that indicates what and what not to send to the server.

private boolean
private String
private static final int
MAX_HAVES

Maximum number of 'have' lines to send before giving up.

private int
protected static final int
MIN_CLIENT_BUFFER

Amount of data the client sends before starting to read.

private GitProtocolConstants.MultiAck
private boolean
private boolean
public static final String
OPTION_ALLOW_REACHABLE_SHA1_IN_WANT

The client supports fetching objects that are reachable from a tip of a ref that is allowed to fetch.

public static final String
OPTION_ALLOW_TIP_SHA1_IN_WANT

The client supports fetching objects at the tip of any ref, even if not advertised.

public static final String
OPTION_FILTER

The client specified a filter expression.

public static final String
OPTION_INCLUDE_TAG

Include tags if we are also including the referenced objects.

public static final String
OPTION_MULTI_ACK

Multi-ACK support for improved negotiation.

public static final String
OPTION_MULTI_ACK_DETAILED

Multi-ACK detailed support for improved negotiation.

public static final String
OPTION_NO_DONE

The client supports receiving a pack before it has sent "done".

public static final String
OPTION_NO_PROGRESS

The client does not want progress messages and will ignore them.

public static final String
OPTION_OFS_DELTA

The client supports packs with OFS deltas.

public static final String
OPTION_SHALLOW

The client supports shallow fetches.

public static final String
OPTION_SIDE_BAND

The client supports using the side-band for progress messages.

public static final String
OPTION_SIDE_BAND_64K

The client supports using the 64K side-band for progress messages.

public static final String
OPTION_THIN_PACK

The client supports packs with deltas but not their bases.

private PackLock
private PacketLineOut
pack-priv final RevFlag
REACHABLE

Marks an object as having all its dependencies.

private RevCommitList<RevCommit>
reachableCommits

All commits that are immediately reachable by a local ref.

private boolean
private final RevFlag
STATE

Like COMMON but means its also in pckState.

private TemporaryBuffer.Heap
state

RPC state, if BasePackConnection#statelessRPC is true or protocol V2 is used.

private boolean
private boolean
private final RevWalk
Inherited from org.eclipse.jgit.transport.BasePackConnection:
additionalHavesCAPABILITY_SYMREF_PREFIXinlocaloutoutNeedsEndpckInpckOutstatelessRPCtimeoutIntimeoutOuttransporturi

Constructor Summary

AccessConstructor and Description
public
BasePackFetchConnection(PackTransport
the transport.
packTransport
)

Create a new connection to fetch using the native git transport.

Method Summary

Modifier and TypeMethod and Description
private void
public void
close()

Overrides org.eclipse.jgit.transport.BasePackConnection.close.

Implements org.eclipse.jgit.transport.Connection.close.

Closes this resource, relinquishing any underlying resources.

public boolean
public boolean
protected void
doFetch(final ProgressMonitor
progress monitor to receive status updates. If the monitor is the org.eclipse.jgit.lib.NullProgressMonitor#INSTANCE, then the no-progress option enabled.
monitor
,
final Collection<Ref>
the advertised remote references the caller wants to fetch.
want
,
final Set<ObjectId>
additional objects to assume that already exist locally. This will be added to the set of objects reachable from the destination repository's references.
have
,
OutputStream
ouputStream to write sideband messages to
outputStream
)

Execute common ancestor negotiation and fetch the objects.

private void
doFetchV2(ProgressMonitor monitor, Collection<Ref> want, OutputStream outputStream, boolean hasObjects)

private String
public final void
fetch(final ProgressMonitor
progress monitor to inform the end-user about the amount of work completed, or to indicate cancellation. Implementations should poll the monitor at regular intervals to look for cancellation requests from the user.
monitor
,
final Collection<Ref>
one or more refs advertised by this connection that the caller wants to store locally.
want
,
final Set<ObjectId>
additional objects known to exist in the destination repository, especially if they aren't yet reachable by the ref database. Connections should take this set as an addition to what is reachable through all Refs, not in replace of it.
have
)

Implements org.eclipse.jgit.transport.FetchConnection.fetch.

Fetch objects we don't have but that are reachable from advertised refs.

public final void
fetch(final ProgressMonitor
progress monitor to inform the end-user about the amount of work completed, or to indicate cancellation. Implementations should poll the monitor at regular intervals to look for cancellation requests from the user.
monitor
,
final Collection<Ref>
one or more refs advertised by this connection that the caller wants to store locally.
want
,
final Set<ObjectId>
additional objects known to exist in the destination repository, especially if they aren't yet reachable by the ref database. Connections should take this set as an addition to what is reachable through all Refs, not in replace of it.
have
,
OutputStream
OutputStream to write sideband messages to
outputStream
)

Implements org.eclipse.jgit.transport.FetchConnection.fetch.

Fetch objects we don't have but that are reachable from advertised refs.

private Set<String>
getCapabilitiesV2(Set<String> advertisedCapabilities)

pack-priv BasePackFetchConnection.FetchConfig
public Collection<PackLock>
private static ObjectId
private String
handleShallowUnshallow(Set<ObjectId> advertisedShallowCommits, PacketLineIn input)

private void
private void
markCommon(RevObject obj, PacketLineIn.AckNackResult anr, boolean useState)

private void
markReachable(Collection<Ref> want, Set<ObjectId> have, int maxTime)

private void
private void
markReachableRefTips(Collection<Ref>
references that client is requesting to be marked.
refsToMark
)

Marks commits reachable.

private void
private int
maxTimeWanted(Collection<Ref> wants, boolean hasObjects)

private void
negotiate(ProgressMonitor monitor, boolean mayHaveShallow, Set<ObjectId> shallowCommits)

private void
protected void
onReceivePack()

Notification event delivered just before the pack is received from the network.

private boolean

Returns:

true if a "ready" was received and a packfile is expected next
readAcknowledgments
(BasePackFetchConnection.FetchStateV2
to update
fetchState
,
PacketLineIn
to read from
input
,
ProgressMonitor
for progress reporting and cancellation
monitor
)

Reads and processes acknowledgments, adding ACKed objects as "have"s to the global state TemporaryBuffer.

private void
receivePack(final ProgressMonitor monitor, OutputStream outputStream)

private boolean

Returns:

true if a "done" was written and we should thus expect a packfile next
sendNextHaveBatch
(BasePackFetchConnection.FetchStateV2
is updated with information about the number of items written, and whether to expect a packfile next
fetchState
,
PacketLineOut
to write to
output
,
ProgressMonitor
for progress reporting and cancellation
monitor
)

Sends the next batch of "have"s and terminates the output.

private void
sendShallow(Set<ObjectId> shallowCommits, PacketLineOut output)

private boolean
sendWants(Collection<Ref> want, PacketLineOut p, boolean hasObjects)

public void
setPackLockMessage(String
message to use when holding a pack in place.
message
)

Implements org.eclipse.jgit.transport.FetchConnection.setPackLockMessage.

Set the lock message used when holding a pack out of garbage collection.

private Collection<Ref>
Inherited from org.eclipse.jgit.transport.BasePackConnection:
addUserAgentCapabilityendOutgetCapabilitygetPeerUserAgentgetProtocolVersioninitisCapableOflsRefsnoRepositoryreadAdvertisedRefssetProtocolVersionupdateWithSymRefswantCapability

Field Detail

ADVERTISEDback to summary
pack-priv final RevFlag ADVERTISED

Marks a commit listed in the advertised refs.

allowOfsDeltaback to summary
private boolean allowOfsDelta
COMMONback to summary
pack-priv final RevFlag COMMON

Marks a commit known to both sides of the connection.

deepenNotsback to summary
private List<String> deepenNots
deepenSinceback to summary
private Instant deepenSince
depthback to summary
private Integer depth
filterSpecback to summary
private final FilterSpec filterSpec

Either FilterSpec.NO_FILTER for a filter that doesn't filter anything, or a filter that indicates what and what not to send to the server.

includeTagsback to summary
private boolean includeTags
lockMessageback to summary
private String lockMessage
MAX_HAVESback to summary
private static final int MAX_HAVES

Maximum number of 'have' lines to send before giving up.

During negotiate(ProgressMonitor, boolean, Set) we send at most this many commits to the remote peer as 'have' lines without an ACK response before we give up.

maxHavesback to summary
private int maxHaves
MIN_CLIENT_BUFFERback to summary
protected static final int MIN_CLIENT_BUFFER

Amount of data the client sends before starting to read.

Any output stream given to the client must be able to buffer this many bytes before the client will stop writing and start reading from the input stream. If the output stream blocks before this many bytes are in the send queue, the system will deadlock.

multiAckback to summary
private GitProtocolConstants.MultiAck multiAck
noDoneback to summary
private boolean noDone
noProgressback to summary
private boolean noProgress
OPTION_ALLOW_REACHABLE_SHA1_IN_WANTback to summary
public static final String OPTION_ALLOW_REACHABLE_SHA1_IN_WANT

The client supports fetching objects that are reachable from a tip of a ref that is allowed to fetch.

Since
4.1
OPTION_ALLOW_TIP_SHA1_IN_WANTback to summary
public static final String OPTION_ALLOW_TIP_SHA1_IN_WANT

The client supports fetching objects at the tip of any ref, even if not advertised.

Since
3.1
OPTION_FILTERback to summary
public static final String OPTION_FILTER

The client specified a filter expression.

Since
5.0
OPTION_INCLUDE_TAGback to summary
public static final String OPTION_INCLUDE_TAG

Include tags if we are also including the referenced objects.

Since
2.0
OPTION_MULTI_ACKback to summary
public static final String OPTION_MULTI_ACK

Multi-ACK support for improved negotiation.

Since
2.0
OPTION_MULTI_ACK_DETAILEDback to summary
public static final String OPTION_MULTI_ACK_DETAILED

Multi-ACK detailed support for improved negotiation.

Since
2.0
OPTION_NO_DONEback to summary
public static final String OPTION_NO_DONE

The client supports receiving a pack before it has sent "done".

Since
2.0
OPTION_NO_PROGRESSback to summary
public static final String OPTION_NO_PROGRESS

The client does not want progress messages and will ignore them.

Since
2.0
OPTION_OFS_DELTAback to summary
public static final String OPTION_OFS_DELTA

The client supports packs with OFS deltas.

Since
2.0
OPTION_SHALLOWback to summary
public static final String OPTION_SHALLOW

The client supports shallow fetches.

Since
2.0
OPTION_SIDE_BANDback to summary
public static final String OPTION_SIDE_BAND

The client supports using the side-band for progress messages.

Since
2.0
OPTION_SIDE_BAND_64Kback to summary
public static final String OPTION_SIDE_BAND_64K

The client supports using the 64K side-band for progress messages.

Since
2.0
OPTION_THIN_PACKback to summary
public static final String OPTION_THIN_PACK

The client supports packs with deltas but not their bases.

Since
2.0
packLockback to summary
private PackLock packLock
pckStateback to summary
private PacketLineOut pckState
REACHABLEback to summary
pack-priv final RevFlag REACHABLE

Marks an object as having all its dependencies.

reachableCommitsback to summary
private RevCommitList<RevCommit> reachableCommits

All commits that are immediately reachable by a local ref.

sidebandback to summary
private boolean sideband
STATEback to summary
private final RevFlag STATE

Like COMMON but means its also in pckState.

stateback to summary
private TemporaryBuffer.Heap state

RPC state, if BasePackConnection#statelessRPC is true or protocol V2 is used.

thinPackback to summary
private boolean thinPack
useNegotiationTipback to summary
private boolean useNegotiationTip
walkback to summary
private final RevWalk walk

Constructor Detail

BasePackFetchConnectionback to summary
public BasePackFetchConnection(PackTransport packTransport)

Create a new connection to fetch using the native git transport.

Parameters
packTransport:PackTransport

the transport.

Method Detail

clearStateback to summary
private void clearState()
closeback to summary
public void close()

Overrides org.eclipse.jgit.transport.BasePackConnection.close.

Implements org.eclipse.jgit.transport.Connection.close.

Doc from org.eclipse.jgit.transport.Connection.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Close any resources used by this connection.

If the remote repository is contacted by a network socket this method must close that network socket, disconnecting the two peers. If the remote repository is actually local (same system) this method must close any open file handles used to read the "remote" repository.

If additional messages were produced by the remote peer, these should still be retained in the connection instance for getMessages().

AutoClosable.close() declares that it throws Exception. Implementers shouldn't throw checked exceptions. This override narrows the signature to prevent them from doing so.

Annotations
@Override
didFetchIncludeTagsback to summary
public boolean didFetchIncludeTags()

Implements org.eclipse.jgit.transport.FetchConnection.didFetchIncludeTags.

Doc from org.eclipse.jgit.transport.FetchConnection.didFetchIncludeTags.

Did the last fetch(ProgressMonitor, Collection, Set) get tags?

Some Git aware transports are able to implicitly grab an annotated tag if org.eclipse.jgit.transport.TagOpt#AUTO_FOLLOW or org.eclipse.jgit.transport.TagOpt#FETCH_TAGS was selected and the object the tag peels to (references) was transferred as part of the last fetch(ProgressMonitor, Collection, Set) call. If it is possible for such tags to have been included in the transfer this method returns true, allowing the caller to attempt tag discovery.

By returning only true/false (and not the actual list of tags obtained) the transport itself does not need to be aware of whether or not tags were included in the transfer.

Returns:boolean

true if the last fetch call implicitly included tag objects; false if tags were not implicitly obtained.

Annotations
@Override
didFetchTestConnectivityback to summary
public boolean didFetchTestConnectivity()

Implements org.eclipse.jgit.transport.FetchConnection.didFetchTestConnectivity.

Doc from org.eclipse.jgit.transport.FetchConnection.didFetchTestConnectivity.

Did the last fetch(ProgressMonitor, Collection, Set) validate graph?

Some transports walk the object graph on the client side, with the client looking for what objects it is missing and requesting them individually from the remote peer. By virtue of completing the fetch call the client implicitly tested the object connectivity, as every object in the graph was either already local or was requested successfully from the peer. In such transports this method returns true.

Some transports assume the remote peer knows the Git object graph and is able to supply a fully connected graph to the client (although it may only be transferring the parts the client does not yet have). Its faster to assume such remote peers are well behaved and send the correct response to the client. In such transports this method returns false.

Returns:boolean

true if the last fetch had to perform a connectivity check on the client side in order to succeed; false if the last fetch assumed the remote peer supplied a complete graph.

Annotations
@Override
doFetchback to summary
protected void doFetch(final ProgressMonitor monitor, final Collection<Ref> want, final Set<ObjectId> have, OutputStream outputStream) throws TransportException

Execute common ancestor negotiation and fetch the objects.

Parameters
monitor:ProgressMonitor

progress monitor to receive status updates. If the monitor is the org.eclipse.jgit.lib.NullProgressMonitor#INSTANCE, then the no-progress option enabled.

want:Collection<Ref>

the advertised remote references the caller wants to fetch.

have:Set<ObjectId>

additional objects to assume that already exist locally. This will be added to the set of objects reachable from the destination repository's references.

outputStream:OutputStream

ouputStream to write sideband messages to

Exceptions
TransportException:
if any exception occurs.
Since
3.0
doFetchV2back to summary
private void doFetchV2(ProgressMonitor monitor, Collection<Ref> want, OutputStream outputStream, boolean hasObjects) throws IOException, CancelledException
enableCapabilitiesback to summary
private String enableCapabilities() throws TransportException
fetchback to summary
public final void fetch(final ProgressMonitor monitor, final Collection<Ref> want, final Set<ObjectId> have) throws TransportException

Implements org.eclipse.jgit.transport.FetchConnection.fetch.

Doc from org.eclipse.jgit.transport.FetchConnection.fetch.

Fetch objects we don't have but that are reachable from advertised refs.

Only one call per connection is allowed. Subsequent calls will result in org.eclipse.jgit.errors.TransportException.

Implementations are free to use network connections as necessary to efficiently (for both client and server) transfer objects from the remote repository into this repository. When possible implementations should avoid replacing/overwriting/duplicating an object already available in the local destination repository. Locally available objects and packs should always be preferred over remotely available objects and packs. org.eclipse.jgit.transport.Transport#isFetchThin() should be honored if applicable.

Parameters
monitor:ProgressMonitor

progress monitor to inform the end-user about the amount of work completed, or to indicate cancellation. Implementations should poll the monitor at regular intervals to look for cancellation requests from the user.

want:Collection<Ref>

one or more refs advertised by this connection that the caller wants to store locally.

have:Set<ObjectId>

additional objects known to exist in the destination repository, especially if they aren't yet reachable by the ref database. Connections should take this set as an addition to what is reachable through all Refs, not in replace of it.

Annotations
@Override
Exceptions
TransportException:
objects could not be copied due to a network failure, protocol error, or error on remote side, or connection was already used for fetch.
fetchback to summary
public final void fetch(final ProgressMonitor monitor, final Collection<Ref> want, final Set<ObjectId> have, OutputStream outputStream) throws TransportException

Implements org.eclipse.jgit.transport.FetchConnection.fetch.

Doc from org.eclipse.jgit.transport.FetchConnection.fetch.

Fetch objects we don't have but that are reachable from advertised refs.

Only one call per connection is allowed. Subsequent calls will result in org.eclipse.jgit.errors.TransportException.

Implementations are free to use network connections as necessary to efficiently (for both client and server) transfer objects from the remote repository into this repository. When possible implementations should avoid replacing/overwriting/duplicating an object already available in the local destination repository. Locally available objects and packs should always be preferred over remotely available objects and packs. org.eclipse.jgit.transport.Transport#isFetchThin() should be honored if applicable.

Parameters
monitor:ProgressMonitor

progress monitor to inform the end-user about the amount of work completed, or to indicate cancellation. Implementations should poll the monitor at regular intervals to look for cancellation requests from the user.

want:Collection<Ref>

one or more refs advertised by this connection that the caller wants to store locally.

have:Set<ObjectId>

additional objects known to exist in the destination repository, especially if they aren't yet reachable by the ref database. Connections should take this set as an addition to what is reachable through all Refs, not in replace of it.

outputStream:OutputStream

OutputStream to write sideband messages to

Annotations
@Override
Exceptions
TransportException:
objects could not be copied due to a network failure, protocol error, or error on remote side, or connection was already used for fetch.
getCapabilitiesV2back to summary
private Set<String> getCapabilitiesV2(Set<String> advertisedCapabilities) throws TransportException
getFetchConfigback to summary
pack-priv BasePackFetchConnection.FetchConfig getFetchConfig()
getPackLocksback to summary
public Collection<PackLock> getPackLocks()

Implements org.eclipse.jgit.transport.FetchConnection.getPackLocks.

Doc from org.eclipse.jgit.transport.FetchConnection.getPackLocks.

All locks created by the last fetch(ProgressMonitor, Collection, Set) call.

Returns:Collection<PackLock>

collection (possibly empty) of locks created by the last call to fetch. The caller must release these after refs are updated in order to safely permit garbage collection.

Annotations
@Override
getRefObjectIdback to summary
private static ObjectId getRefObjectId(Ref ref)
handleShallowUnshallowback to summary
private String handleShallowUnshallow(Set<ObjectId> advertisedShallowCommits, PacketLineIn input) throws IOException
markAdvertisedback to summary
private void markAdvertised(AnyObjectId id)
markCommonback to summary
private void markCommon(RevObject obj, PacketLineIn.AckNackResult anr, boolean useState) throws IOException
markReachableback to summary
private void markReachable(Collection<Ref> want, Set<ObjectId> have, int maxTime) throws IOException
markReachableback to summary
private void markReachable(ObjectId id)
markReachableRefTipsback to summary
private void markReachableRefTips(Collection<Ref> refsToMark)

Marks commits reachable.

Parameters
refsToMark:Collection<Ref>

references that client is requesting to be marked.

markRefsAdvertisedback to summary
private void markRefsAdvertised()
maxTimeWantedback to summary
private int maxTimeWanted(Collection<Ref> wants, boolean hasObjects)
negotiateback to summary
private void negotiate(ProgressMonitor monitor, boolean mayHaveShallow, Set<ObjectId> shallowCommits) throws IOException, CancelledException
negotiateBeginback to summary
private void negotiateBegin() throws IOException
onReceivePackback to summary
protected void onReceivePack()

Notification event delivered just before the pack is received from the network. This event can be used by RPC such as org.eclipse.jgit.transport.TransportHttp to disable its request magic and ensure the pack stream is read correctly.

Since
2.0
readAcknowledgmentsback to summary
private boolean readAcknowledgments(BasePackFetchConnection.FetchStateV2 fetchState, PacketLineIn input, ProgressMonitor monitor) throws IOException, CancelledException

Reads and processes acknowledgments, adding ACKed objects as "have"s to the global state TemporaryBuffer.

Parameters
fetchState:BasePackFetchConnection.FetchStateV2

to update

input:PacketLineIn

to read from

monitor:ProgressMonitor

for progress reporting and cancellation

Returns:boolean

true if a "ready" was received and a packfile is expected next

Exceptions
IOException:
on errors
CancelledException:
on cancellation
receivePackback to summary
private void receivePack(final ProgressMonitor monitor, OutputStream outputStream) throws IOException
sendNextHaveBatchback to summary
private boolean sendNextHaveBatch(BasePackFetchConnection.FetchStateV2 fetchState, PacketLineOut output, ProgressMonitor monitor) throws IOException, CancelledException

Sends the next batch of "have"s and terminates the output.

Parameters
fetchState:BasePackFetchConnection.FetchStateV2

is updated with information about the number of items written, and whether to expect a packfile next

output:PacketLineOut

to write to

monitor:ProgressMonitor

for progress reporting and cancellation

Returns:boolean

true if a "done" was written and we should thus expect a packfile next

Exceptions
IOException:
on errors
CancelledException:
on cancellation
sendShallowback to summary
private void sendShallow(Set<ObjectId> shallowCommits, PacketLineOut output) throws IOException
sendWantsback to summary
private boolean sendWants(Collection<Ref> want, PacketLineOut p, boolean hasObjects) throws IOException
setPackLockMessageback to summary
public void setPackLockMessage(String message)

Implements org.eclipse.jgit.transport.FetchConnection.setPackLockMessage.

Doc from org.eclipse.jgit.transport.FetchConnection.setPackLockMessage.

Set the lock message used when holding a pack out of garbage collection.

Callers that set a lock message must ensure they call getPackLocks() after fetch(ProgressMonitor, Collection, Set), even if an exception was thrown, and release the locks that are held.

Parameters
message:String

message to use when holding a pack in place.

Annotations
@Override
translateToLocalTipsback to summary
private Collection<Ref> translateToLocalTips(Collection<Ref> want) throws IOException
org.eclipse.jgit.transport back to summary

private Class BasePackFetchConnection.CancelledException

extends Exception
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
private

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.Exception.serialVersionUID.

Constructor Detail

CancelledExceptionback to summary
private CancelledException()
org.eclipse.jgit.transport back to summary

pack-priv Class BasePackFetchConnection.FetchConfig

extends Object
Class Inheritance
  • java.lang.Object
  • org.eclipse.jgit.transport.BasePackFetchConnection.FetchConfig

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv final int
pack-priv final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
FetchConfig(boolean allowOfsDelta, int maxHaves)

pack-priv
FetchConfig(boolean
when true optimizes the pack size by deltafying base object
allowOfsDelta
,
int
max haves to be sent per negotiation
maxHaves
,
boolean
if true uses the wanted refs instead of all refs as source of the "have" list to send.
useNegotiationTip
)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allowOfsDeltaback to summary
pack-priv final boolean allowOfsDelta
maxHavesback to summary
pack-priv final int maxHaves
useNegotiationTipback to summary
pack-priv final boolean useNegotiationTip

Constructor Detail

FetchConfigback to summary
pack-priv FetchConfig(Config c)
FetchConfigback to summary
pack-priv FetchConfig(boolean allowOfsDelta, int maxHaves)
FetchConfigback to summary
pack-priv FetchConfig(boolean allowOfsDelta, int maxHaves, boolean useNegotiationTip)
Parameters
allowOfsDelta:boolean

when true optimizes the pack size by deltafying base object

maxHaves:int

max haves to be sent per negotiation

useNegotiationTip:boolean

if true uses the wanted refs instead of all refs as source of the "have" list to send.

Since
6.6
org.eclipse.jgit.transport back to summary

private Class BasePackFetchConnection.FetchStateV2

extends Object
Class Inheritance
  • java.lang.Object
  • org.eclipse.jgit.transport.BasePackFetchConnection.FetchStateV2

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv long
pack-priv long
pack-priv long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv void
incHavesToSend(boolean statelessRPC)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hadAcksback to summary
pack-priv boolean hadAcks
havesToSendback to summary
pack-priv long havesToSend
havesTotalback to summary
pack-priv long havesTotal
havesWithoutAckback to summary
pack-priv long havesWithoutAck

Constructor Detail

FetchStateV2back to summary
private FetchStateV2()

Method Detail

incHavesToSendback to summary
pack-priv void incHavesToSend(boolean statelessRPC)