Communication Directives
The communication directives are special instructions in conditional queries that modify how the query engine handles data transfer during querying.
The following directives are supported:
Directive | ReductStore Version | Description |
---|---|---|
Communication | ||
#batch_size | v1.17 | Maximum size of a batch of records returned by the query. |
#batch_records | v1.17 | Maximum number of records in a batch returned by the query. |
#batch_metadata_size | v1.17 | Maximum size of metadata in a batch returned by the query. |
#batch_timeout | v1.17 | Maximum time to wait before sending a batch of records. |
#record_timeout | v1.17 | Maximum time to wait for a record to be processed before sending a batch. |
#io_timeout | v1.17 | Maximum time to wait for I/O operations during querying. Reserved for future use. |
#batch_size
The #batch_size
directive sets the maximum size (in bytes) of a batch of records returned by the query.
Syntax
{
"#batch_size": <expression as int | string>
}
If the expression is a string, it can include size suffixes like KB
, MB
, or GB
(e.g. "10MB"
).
Behavior
The querying stops when the batch size is reached but puts the current record in the batch, even if it exceeds the limit. It means that the actual batch size may be larger than the specified limit.
This directive overrides the server's RS_IO_BATCH_MAX_SIZE
setting. See the server configuration documentation for more details.
Example
{
"#batch_size": "5MB"
}
#batch_records
The #batch_records
directive sets the maximum number of records in a batch returned by the query.
Syntax
{
"#batch_records": <expression as int>
}
Behavior
The querying stops when the number of records in the batch reaches the specified limit.
This directive overrides the server's RS_IO_BATCH_MAX_RECORDS
setting. See the server configuration documentation for more details.
Example
{
"#batch_records": 1000
}
#batch_metadata_size
The #batch_metadata_size
directive sets the maximum size (in bytes) of metadata in a batch returned by the query.
Syntax
{
"#batch_metadata_size": <expression as int | string>
}
If the expression is a string, it can include size suffixes like KB
, MB
, or GB
(e.g. "1MB"
).
Behavior
The querying stops when the metadata size in the batch reaches the specified limit but puts the current record in the batch, even if it exceeds the limit. It means that the actual metadata size may be larger than the specified limit.
This directive overrides the server's RS_IO_BATCH_MAX_METADATA_SIZE
setting. See the server configuration documentation for more details.
Example
{
"#batch_metadata_size": "500KB"
}
#batch_timeout
The #batch_timeout
directive sets the maximum time to wait before sending a batch of records.
Syntax
{
"#batch_timeout": <expression as duration literal>
}
Behavior
The querying sends the current batch when the timeout is reached, even if the batch is not full.
This directive overrides the server's RS_IO_BATCH_TIMEOUT
setting. See the server configuration documentation for more details.
Example
{
"#batch_timeout": "200ms"
}
The #batch_timeout
directive is ignored in replication conditional queries.
#record_timeout
The #record_timeout
directive sets the maximum time to wait for a record to be processed before sending a batch.
Syntax
{
"#record_timeout": <expression as duration literal>
}
Behavior
The querying sends the current batch when the timeout is reached, even if the current record is not fully processed.
This directive overrides the server's RS_IO_BATCH_RECORD_TIMEOUT
setting. See the server configuration documentation for more details.
Example
{
"#record_timeout": "100ms"
}
The #record_timeout
directive is ignored in replication conditional queries.
#io_timeout
The #io_timeout
directive sets the maximum time to wait for I/O operations during querying.
Syntax
{
"#io_timeout": <expression as duration literal>
}
Behavior
The querying aborts if an I/O operation takes longer than the specified timeout.
This directive is reserved for future use and currently has no effect.
Example
{
"#io_timeout": "5s"
}