Send feedback
Interface BatchResource (2.37.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version latest keyboard_arrow_down
public interface BatchResource
Represent the resource used by a batch including element and byte. It can also be extended to
other things to determine if adding a new element needs to be flow controlled or if the current
batch needs to be flushed.
Methods
add(BatchResource resource)
public abstract BatchResource add(BatchResource resource)
Adds the additional resource.
getByteCount()
public abstract long getByteCount()
Returns the byte count of this resource.
Returns Type Description long
getElementCount()
public abstract long getElementCount()
Returns the element count of this resource.
Returns Type Description long
shouldFlush(long maxElementThreshold, long maxBytesThreshold)
public abstract boolean shouldFlush(long maxElementThreshold, long maxBytesThreshold)
Checks if the current BatchResource should be flushed based on the maxElementThreshold
and maxBytesThreshold.
Parameters Name Description maxElementThreshold
long
maxBytesThreshold
long
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-06 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?