The interface representing a threshold to be used in ThresholdBatcher. Thresholds do not need to
be thread-safe if they are only used inside ThresholdBatcher.
Type Parameter
Name
Description
E
Methods
accumulate(E e)
publicabstractvoidaccumulate(Ee)
Presents the element to the threshold for the attribute of interest to be accumulated.
Any calls into this function from ThresholdBatcher will be under a lock.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis page provides documentation for the \u003ccode\u003eBatchingThreshold\u003c/code\u003e interface in the Google API Client Library for Java, specifically within the \u003ccode\u003ecom.google.api.gax.batching\u003c/code\u003e package, outlining versions ranging from 2.7.1 to the latest 2.63.1.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBatchingThreshold\u003c/code\u003e interface is used within \u003ccode\u003eThresholdBatcher\u003c/code\u003e and represents a configurable threshold that determines when a batch is considered full, so that the batch can be executed.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaccumulate(E e)\u003c/code\u003e method adds an element to be considered against the threshold, enabling the tracking of batch size.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecopyWithZeroedValue()\u003c/code\u003e method allows for creating a reset version of the current threshold to be used on a new batch.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eisThresholdReached()\u003c/code\u003e method checks if the current batch has reached the defined threshold, determining whether or not it should be processed.\u003c/p\u003e\n"]]],[],null,[]]