Package com.google.cloud.storage
Class FlushPolicy.MaxFlushSizeFlushPolicy
java.lang.Object
com.google.cloud.storage.FlushPolicy
com.google.cloud.storage.FlushPolicy.MaxFlushSizeFlushPolicy
- Enclosing class:
- FlushPolicy
@Immutable
@BetaApi
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.
- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.cloud.storage.FlushPolicy
FlushPolicy.MaxFlushSizeFlushPolicy, FlushPolicy.MinFlushSizeFlushPolicy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintThe maximum number of bytes to include in each automatic flushinthashCode()toString()withMaxFlushSize(int maxFlushSize) Return an instance with themaxFlushSizeset to the specified value.Methods inherited from class com.google.cloud.storage.FlushPolicy
maxFlushSize, maxFlushSize, minFlushSize, minFlushSize
-
Constructor Details
-
MaxFlushSizeFlushPolicy
public MaxFlushSizeFlushPolicy(int maxFlushSize)
-
-
Method Details
-
getMaxFlushSize
@BetaApi public int getMaxFlushSize()The maximum number of bytes to include in each automatic flushDefault:
2097152 (2 MiB)- See Also:
-
withMaxFlushSize
Return an instance with themaxFlushSizeset to the specified value.Default:
2097152 (2 MiB)- Parameters:
maxFlushSize- The number of bytes to buffer before flushing.- Returns:
- The new instance
- See Also:
-
equals
- Specified by:
equalsin classFlushPolicy
-
hashCode
public int hashCode()- Specified by:
hashCodein classFlushPolicy
-
toString
- Specified by:
toStringin classFlushPolicy
-