Package io.netty.channel.uring
Class WriteOperation
- java.lang.Object
-
- io.netty.channel.uring.WriteOperation
-
final class WriteOperation extends java.lang.ObjectA slot tracking the references a submitted SQE handed to the kernel. Recording does not retain: the outbound buffer owns them until the write completes orretainReferences()takes over. Slots are reused and the backing array is kept across reuses, so a slot allocates only on its first use and when a write hands it more references than any earlier use did.abandon()is how a slot is ended outside of a completion CQE -- see its javadoc for the three situations that call it.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanactiveprivate intcountprivate static ReferenceCounted[]EMPTY_REFERENCESprivate byteopCodeprivate ReferenceCounted[]referencesprivate intretainedCount
-
Constructor Summary
Constructors Constructor Description WriteOperation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidabandon()Ends this slot without it ever seeing a completion CQE.(package private) voidcomplete(int cqeFlags)Releases the slot on the terminal CQE: a notification, or any completion withoutIORING_CQE_F_MORE.private voidfinish()(package private) booleanisActive()Whether this slot is occupied.(package private) byteopCode()(package private) voidrecord(byte opCode, ReferenceCounted reference)(package private) voidrecord(byte opCode, ReferenceCounted[] references, int count)Copiesreferencesso the caller may reuse the array: a zero-copy slot stays alive from its primary CQE until the follow-upIORING_CQE_F_NOTIF, during which a reused collector array would be overwritten.(package private) voidretainReferences()NOOP once every reference is retained or while the slot is inactive.
-
-
-
Field Detail
-
EMPTY_REFERENCES
private static final ReferenceCounted[] EMPTY_REFERENCES
-
opCode
private byte opCode
-
references
private ReferenceCounted[] references
-
count
private int count
-
active
private boolean active
-
retainedCount
private int retainedCount
-
-
Method Detail
-
record
void record(byte opCode, ReferenceCounted reference)
-
record
void record(byte opCode, ReferenceCounted[] references, int count)Copiesreferencesso the caller may reuse the array: a zero-copy slot stays alive from its primary CQE until the follow-upIORING_CQE_F_NOTIF, during which a reused collector array would be overwritten.
-
retainReferences
void retainReferences()
NOOP once every reference is retained or while the slot is inactive.retainedCountonly advances past an index once itsretain()call actually returns, so aretain()that throws partway leavesfinish()to release exactly the references that were retained, instead of over-releasing the ones that never were.
-
isActive
boolean isActive()
Whether this slot is occupied. A submitted SQE that ended up with zero references still occupies it.
-
opCode
byte opCode()
-
complete
void complete(int cqeFlags)
Releases the slot on the terminal CQE: a notification, or any completion withoutIORING_CQE_F_MORE.
-
abandon
void abandon()
Ends this slot without it ever seeing a completion CQE. Called in three situations: (1) submission itself failed, so the kernel never saw the SQE and no CQE will ever arrive for it; (2) deregistration discards a slot whose completion this channel can no longer observe, andretainReferences()never ran on it, making this call a plain discard; (3) deregistration discards a slot thatretainReferences()did retain before a shutdown, in which case this call is what actually releases those references.
-
finish
private void finish()
-
-