Class FlushPolicy.MaxFlushSizeFlushPolicy (2.52.2)

public static final class FlushPolicy.MaxFlushSizeFlushPolicy extends FlushPolicy

Define a FlushPolicy where a max number of bytes will be flushed to GCS per flush.

If there are not enough bytes to trigger a flush, they will be held in memory until there are enough bytes, or an explicit flush is performed by closing the channel. If more bytes are provided than the configured maxFlushSize, multiple flushes will be performed.

Instances of this class are immutable and thread safe.

Inheritance

Object > FlushPolicy > FlushPolicy.MaxFlushSizeFlushPolicy

Constructors

MaxFlushSizeFlushPolicy(int maxFlushSize)

public MaxFlushSizeFlushPolicy(int maxFlushSize)
Parameter
Name Description
maxFlushSize int

Methods

equals(Object o)

public boolean equals(Object o)
Parameter
Name Description
o Object
Returns
Type Description
boolean
Overrides

getMaxFlushSize()

public int getMaxFlushSize()

The maximum number of bytes to include in each automatic flush

Default: 2097152 (2 MiB) See Also: #withMaxFlushSize(int)

Returns
Type Description
int

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides

withMaxFlushSize(int maxFlushSize)

public FlushPolicy.MaxFlushSizeFlushPolicy withMaxFlushSize(int maxFlushSize)

Return an instance with the maxFlushSize set to the specified value.

Default: 2097152 (2 MiB) See Also: #getMaxFlushSize()

Parameter
Name Description
maxFlushSize int

The number of bytes to buffer before flushing.

Returns
Type Description
FlushPolicy.MaxFlushSizeFlushPolicy

The new instance