Package com.biglybt.pifimpl.local.disk
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 interface
protected static class
protected class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private long
private Average
private int
private static int
private static final String
private int
private static final int
private static final Comparator
<DiskManagerChannelImpl.dataEntry> private DiskManagerFileInfo
private long
private DiskManagerChannelImpl.request
private Set
<DiskManagerChannelImpl.dataEntry> private static int
private static int
private boolean
private DownloadImpl
private long
private static CopyOnWriteList
<DiskManagerChannelImpl.channelCreateListener> private static final int
private PEPeerManager
private long
private DiskManagerFileInfoImpl
private long[]
private long
private long
private static final boolean
private List
<AESemaphore> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DiskManagerChannelImpl
(DownloadImpl _download, DiskManagerFileInfoImpl _plugin_file) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
dataChecked
(long offset, long length) void
dataWritten
(long offset, long length, Object originator) void
destroy()
long
long
getFile()
long
long
long
Returns the user-agent associated with this RTA activity, if knownboolean
void
void
peerManagerAdded
(PEPeerManager manager) void
peerManagerRemoved
(PEPeerManager manager) void
peerManagerWillBeAdded
(PEPeerManager manager) Called when a peer manager is created but not yet startedvoid
peerRemoved
(PEPeer peer) static void
protected static void
reportCreated
(DiskManagerChannel channel) void
setBufferMillis
(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:
getFile
in interfaceDiskManagerChannel
-
createRequest
- Specified by:
createRequest
in interfaceDiskManagerChannel
-
getPosition
public long getPosition()- Specified by:
getPosition
in interfaceDiskManagerChannel
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyed
in interfaceDiskManagerChannel
-
dataWritten
- Specified by:
dataWritten
in interfaceDiskManagerFileInfoListener
-
dataChecked
public void dataChecked(long offset, long length) - Specified by:
dataChecked
in interfaceDiskManagerFileInfoListener
-
peerManagerWillBeAdded
Description copied from interface:DownloadManagerPeerListener
Called when a peer manager is created but not yet started- Specified by:
peerManagerWillBeAdded
in interfaceDownloadManagerPeerListener
- Parameters:
manager
-
-
peerManagerAdded
- Specified by:
peerManagerAdded
in interfaceDownloadManagerPeerListener
-
peerManagerRemoved
- Specified by:
peerManagerRemoved
in interfaceDownloadManagerPeerListener
-
peerAdded
- Specified by:
peerAdded
in interfaceDownloadManagerPeerListener
-
peerRemoved
- Specified by:
peerRemoved
in interfaceDownloadManagerPeerListener
-
updateRTAs
- Specified by:
updateRTAs
in interfacePieceRTAProvider
-
getStartTime
public long getStartTime()- Specified by:
getStartTime
in interfacePieceRTAProvider
-
getStartPosition
public long getStartPosition()- Specified by:
getStartPosition
in interfacePieceRTAProvider
-
getCurrentPosition
public long getCurrentPosition()- Specified by:
getCurrentPosition
in interfacePieceRTAProvider
-
getBlockingPosition
public long getBlockingPosition()- Specified by:
getBlockingPosition
in interfacePieceRTAProvider
-
setBufferMillis
public void setBufferMillis(long millis, long delay_millis) Description copied from interface:PieceRTAProvider
Sets an external view of how much buffer is being maintained by an external source. This reduces piece urgency and therefore reduces discard.- Specified by:
setBufferMillis
in interfacePieceRTAProvider
-
getUserAgent
Description copied from interface:PieceRTAProvider
Returns the user-agent associated with this RTA activity, if known- Specified by:
getUserAgent
in interfacePieceRTAProvider
- Returns:
-
destroy
public void destroy()- Specified by:
destroy
in interfaceDiskManagerChannel
-