public final class PortSettings extends Object
PortSetting
objects.Modifier and Type | Method and Description |
---|---|
static EngineConfig |
apply(EngineConfig config,
PortSetting... settings)
Specifies the default properties for ports in the graph.
|
static PortSetting |
batchSize(int size)
Specifies the port should publish pushed data in batches
of the specified size.
|
static PortSetting |
immediate()
Specifies that the port should immediately publish data
when pushed.
|
static PortSetting |
noSpooling()
Disables writers writing published batches to disk.
|
static PortSetting |
sizeByReaders(boolean enabled)
Specifies whether the initial writeahead for a port should
be automatically determined based on the number of readers.
|
static PortSetting |
spoolThreshold(int size)
Specifies the threshold at which the writer begins writing
published batches to disk.
|
static PortSetting |
writeahead(int size)
Specifies the number of unread batches which a port
can publish before blocking.
|
public static EngineConfig apply(EngineConfig config, PortSetting... settings)
config
- the original EngineConfig
settings
- the desired port settingsEngineConfig
with the settings modifiedpublic static PortSetting immediate()
batched(1)
.
This option should only be used on a port-by-port basis and not globally.
batchSize(int)
public static PortSetting batchSize(int size)
flush()
method is called on the port.
Batching reduces overhead due to synchronization between dataflow processes, as they need to synchronize less frequently. However, large batch sizes can also be detrimental as it increases both memory usage and latency. Batch size should only be modified with care.
size
- the batch sizepublic static PortSetting writeahead(int size)
Writeahead allows variation in writer performance to be smoothed out by buffering "fast" writers. Increasing this value can also decrease contention between readers, as access is spread across more batches. However, this also increases memory usage.
size
- the number of batchespublic static PortSetting sizeByReaders(boolean enabled)
Enabling this can help reduce contention on queues having a large number of readers.
enabled
- whether to enablewriteahead(int)
public static PortSetting spoolThreshold(int size)
This setting can be used to place an upper bound on the
memory used for data queues between dataflow processes.
Performance will possibly degrade, but OutOfMemoryError
s
which kill the graph will be avoided.
size
- the number of unread batches at which overflow
spooling behavior is triggeredwriteahead(int)
public static PortSetting noSpooling()
OutOfMemoryError
s when
queue expansion is occurring, but avoids the performance
overhead of disk I/O when memory buffers are full.spoolThreshold(int)
Copyright © 2024 Actian Corporation. All rights reserved.