Interface BatchResource (2.46.1)

  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.

Parameter
Name
Description
resource
Returns
Type
Description

getByteCount()

  public 
  
 abstract 
  
 long 
  
 getByteCount 
 () 
 

Returns the byte count of this resource.

Returns
Type
Description

getElementCount()

  public 
  
 abstract 
  
 long 
  
 getElementCount 
 () 
 

Returns the element count of this resource.

Returns
Type
Description

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
maxBytesThreshold
Returns
Type
Description
Design a Mobile Site
View Site in Mobile | Classic
Share by: