Record Class DrawBatchResult
- Record Components:
applied- commands the producer accepteddropped- commands the producer refusedfirstError- the producer's message for the first refusal, or""when nothing was refused. There is no second message: the wire does not carry one.
Read this, do not assume a batch succeeded. debug_draw_set_batch
answers a normal success envelope even when it applied nothing: the per-item
failures come back as a count and the first error string only, never as
per-item {key, error}. A caller that checks only for a thrown RPC error
will read a 256-item batch that drew nothing as a success. That is why
DrawFrame.flush() returns this and why DrawFrame.close() logs a
warning rather than swallowing it — a script that believes it has a highlight
it does not have is the worst outcome available.
The mirror of that is worth knowing too: a batch that does fail at
the envelope level is not a clean failure. The producer applies items to its
store as it walks them, so you get no result at all while part of the batch may
already be drawn. There is deliberately no DrawBatchResult for that case,
because the wire carries no count with the error — see DrawFrame.flush()
for what is recoverable and how.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDrawBatchResult(int applied, int dropped, String firstError) Creates an instance of aDrawBatchResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintapplied()Returns the value of theappliedrecord component.intdropped()Returns the value of thedroppedrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstErrorrecord component.final inthashCode()Returns a hash code value for this object.booleanTrue when every command in the batch was accepted.merge(DrawBatchResult next) This result combined with a later one, for a frame large enough to need more than oneDrawLimits.MAX_BATCH_ITEMS-item batch.intTotal commands the batch carried.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
The result of flushing nothing.
-
-
Constructor Details
-
DrawBatchResult
Creates an instance of aDrawBatchResultrecord class.- Parameters:
applied- the value for theappliedrecord componentdropped- the value for thedroppedrecord componentfirstError- the value for thefirstErrorrecord component
-
-
Method Details
-
isComplete
public boolean isComplete()True when every command in the batch was accepted. -
submitted
public int submitted()Total commands the batch carried. -
merge
This result combined with a later one, for a frame large enough to need more than oneDrawLimits.MAX_BATCH_ITEMS-item batch. The earliest non-empty error wins, matching the single-batch contract that you are told about the first refusal only. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
applied
-
dropped
-
firstError
Returns the value of thefirstErrorrecord component.- Returns:
- the value of the
firstErrorrecord component
-