Interface DiskManagerReadRequest
- All Superinterfaces:
DiskManagerRequest, PeerReadRequest
- All Known Implementing Classes:
DiskManagerReadRequestImpl
This class represents a Bittorrent Request.
and a time stamp to know when it was created.
Request may expire after some time, which is used to determine who is snubbed.
-
Field Summary
Fields inherited from interface PeerReadRequest
NORMAL_REQUEST_SIZE -
Method Summary
Modifier and TypeMethodDescriptionbooleanWe override the equals method 2 requests are equals if all their bt fields (piece number, offset, length) are equalbooleangetFlush()intintintlonglongbooleaninthashCode()booleanvoidsetFlush(boolean flush) If flush is set then data held in memory will be flushed to disk during the read operationvoidvoidsetTimeSent(long time) voidsetUseCache(boolean cache) Methods inherited from interface DiskManagerRequest
getErrorIsFatal, requestEnds, requestStarts, setErrorIsFatalMethods inherited from interface PeerReadRequest
cancel, isCancelled, isExpired, resetTimeMono
-
Method Details
-
getPieceNumber
int getPieceNumber()- Specified by:
getPieceNumberin interfacePeerReadRequest
-
getOffset
int getOffset()- Specified by:
getOffsetin interfacePeerReadRequest
-
getLength
int getLength()- Specified by:
getLengthin interfacePeerReadRequest
-
getTimeCreatedMono
long getTimeCreatedMono() -
setTimeSent
void setTimeSent(long time) -
getTimeSent
long getTimeSent() -
setFlush
void setFlush(boolean flush) If flush is set then data held in memory will be flushed to disk during the read operation- Parameters:
flush-
-
getFlush
boolean getFlush() -
setUseCache
void setUseCache(boolean cache) -
getUseCache
boolean getUseCache() -
setLatencyTest
void setLatencyTest() -
isLatencyTest
boolean isLatencyTest() -
equals
-
hashCode
-