Class WriteOperation
java.lang.Object
io.netty.channel.uring.WriteOperation
A slot tracking the references a submitted SQE handed to the kernel. Recording does not retain: the outbound buffer
owns them until the write completes or
retainReferences() 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
FieldsModifier and TypeFieldDescriptionprivate booleanprivate intprivate static final ReferenceCounted[]private byteprivate ReferenceCounted[]private int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(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) voidNOOP once every reference is retained or while the slot is inactive.
-
Field Details
-
EMPTY_REFERENCES
-
opCode
private byte opCode -
references
-
count
private int count -
active
private boolean active -
retainedCount
private int retainedCount
-
-
Constructor Details
-
WriteOperation
WriteOperation()
-
-
Method Details
-
record
-
record
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()
-