Class DiskManagerChannelImpl
java.lang.Object
com.biglybt.pifimpl.local.disk.DiskManagerChannelImpl
- All Implemented Interfaces:
DiskManagerFileInfoListener, DownloadManagerPeerListener, PieceRTAProvider, DiskManagerChannel
public class DiskManagerChannelImpl
extends Object
implements DiskManagerChannel, DiskManagerFileInfoListener, DownloadManagerPeerListener, PieceRTAProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceprotected static classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate longprivate Averageprivate intprivate static intprivate static final Stringprivate intprivate static final intprivate static final Comparator<DiskManagerChannelImpl.dataEntry> private DiskManagerFileInfoprivate longprivate DiskManagerChannelImpl.requestprivate Set<DiskManagerChannelImpl.dataEntry> private static intprivate static intprivate booleanprivate DownloadImplprivate longprivate static CopyOnWriteList<DiskManagerChannelImpl.channelCreateListener> private static final intprivate PEPeerManagerprivate longprivate DiskManagerFileInfoImplprivate long[]private longprivate longprivate static final booleanprivate List<AESemaphore> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDiskManagerChannelImpl(DownloadImpl _download, DiskManagerFileInfoImpl _plugin_file) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoiddataChecked(long offset, long length) voiddataWritten(long offset, long length, Object originator) voiddestroy()longlonggetFile()longlonglongReturns the user-agent associated with this RTA activity, if knownbooleanvoidvoidpeerManagerAdded(PEPeerManager manager) voidpeerManagerRemoved(PEPeerManager manager) voidpeerManagerWillBeAdded(PEPeerManager manager) Called when a peer manager is created but not yet startedvoidpeerRemoved(PEPeer peer) static voidprotected static voidreportCreated(DiskManagerChannel channel) voidsetBufferMillis(long millis, long delay_millis) Sets an external view of how much buffer is being maintained by an external source.long[]updateRTAs(PiecePicker picker)
-
Field Details
-
DEFAULT_BUFFER_MILLIS
private static int DEFAULT_BUFFER_MILLIS -
DEFAULT_MIN_PIECES_TO_BUFFER
private static int DEFAULT_MIN_PIECES_TO_BUFFER -
TRACE
private static final boolean TRACE- See Also:
-
COMPACT_DELAY
private static final int COMPACT_DELAY- See Also:
-
MAX_READ_CHUNK_DEFAULT
private static final int MAX_READ_CHUNK_DEFAULT- See Also:
-
comparator
-
channel_key
- See Also:
-
channel_id_next
private static int channel_id_next -
listeners
-
download
-
plugin_file
-
core_file
-
data_written
-
compact_delay
private int compact_delay -
waiters
-
file_offset_in_torrent
private long file_offset_in_torrent -
piece_size
private long piece_size -
byte_rate
-
start_position
private long start_position -
start_time
private long start_time -
current_position
private volatile long current_position -
current_request
-
buffer_millis_override
private long buffer_millis_override -
buffer_delay_millis
private long buffer_delay_millis -
peer_manager
-
rtas
private long[] rtas -
channel_id
private int channel_id -
destroyed
private volatile boolean destroyed
-
-
Constructor Details
-
DiskManagerChannelImpl
protected DiskManagerChannelImpl(DownloadImpl _download, DiskManagerFileInfoImpl _plugin_file) throws DownloadException - Throws:
DownloadException
-
-
Method Details
-
addListener
-
removeListener
-
reportCreated
-
getFile
- Specified by:
getFilein interfaceDiskManagerChannel
-
createRequest
- Specified by:
createRequestin interfaceDiskManagerChannel
-
getPosition
public long getPosition()- Specified by:
getPositionin interfaceDiskManagerChannel
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDiskManagerChannel
-
dataWritten
- Specified by:
dataWrittenin interfaceDiskManagerFileInfoListener
-
dataChecked
public void dataChecked(long offset, long length) - Specified by:
dataCheckedin interfaceDiskManagerFileInfoListener
-
peerManagerWillBeAdded
Description copied from interface:DownloadManagerPeerListenerCalled when a peer manager is created but not yet started- Specified by:
peerManagerWillBeAddedin interfaceDownloadManagerPeerListener- Parameters:
manager-
-
peerManagerAdded
- Specified by:
peerManagerAddedin interfaceDownloadManagerPeerListener
-
peerManagerRemoved
- Specified by:
peerManagerRemovedin interfaceDownloadManagerPeerListener
-
peerAdded
- Specified by:
peerAddedin interfaceDownloadManagerPeerListener
-
peerRemoved
- Specified by:
peerRemovedin interfaceDownloadManagerPeerListener
-
updateRTAs
- Specified by:
updateRTAsin interfacePieceRTAProvider
-
getStartTime
public long getStartTime()- Specified by:
getStartTimein interfacePieceRTAProvider
-
getStartPosition
public long getStartPosition()- Specified by:
getStartPositionin interfacePieceRTAProvider
-
getCurrentPosition
public long getCurrentPosition()- Specified by:
getCurrentPositionin interfacePieceRTAProvider
-
getBlockingPosition
public long getBlockingPosition()- Specified by:
getBlockingPositionin interfacePieceRTAProvider
-
setBufferMillis
public void setBufferMillis(long millis, long delay_millis) Description copied from interface:PieceRTAProviderSets an external view of how much buffer is being maintained by an external source. This reduces piece urgency and therefore reduces discard.- Specified by:
setBufferMillisin interfacePieceRTAProvider
-
getUserAgent
Description copied from interface:PieceRTAProviderReturns the user-agent associated with this RTA activity, if known- Specified by:
getUserAgentin interfacePieceRTAProvider- Returns:
-
destroy
public void destroy()- Specified by:
destroyin interfaceDiskManagerChannel
-