Interface QueryQueue
- All Known Implementing Classes:
DistributedQueryQueue
,EmbeddedQueryQueue
public interface QueryQueue
Interface which defines a queue implementation for query queues.
Implementations can queue locally, queue distributed, or do
nothing at all.
A queue can report itself as enabled or disabled. When enabled, all queries must obtain a lease prior to starting execution. The lease must be released at the completion of execution.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Exception thrown for all non-timeout error conditions.static interface
The opaque lease returned once a query is admitted for execution.static class
Exception thrown if a query exceeds the configured wait time in the query queue. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
long
defaultQueryMemoryPerNode
(double cost) Return the amount of memory per node when creating a EXPLAIN query plan.boolean
enabled()
Determine if the queue is enabled.enqueue
(UserBitShared.QueryId queryId, double cost) Queue a query.long
Optional floor on the amount of memory assigned per operator.void
setMemoryPerNode
(long memoryPerNode)
-
Method Details
-
setMemoryPerNode
void setMemoryPerNode(long memoryPerNode) -
defaultQueryMemoryPerNode
long defaultQueryMemoryPerNode(double cost) Return the amount of memory per node when creating a EXPLAIN query plan. Plans to be executed should get the query memory from the lease, as the lease may adjust the default amount on a per-query basis. This means that the memory used to execute the query may differ from the amount shown in an EXPLAIN plan.- Returns:
- assumed memory per node, in bytes, to use when creating an EXPLAIN plan
-
minimumOperatorMemory
long minimumOperatorMemory()Optional floor on the amount of memory assigned per operator. This ensures that operators receive a certain amount, separate from any memory slicing. This can oversubscribe node memory if used incorrectly.- Returns:
- minimum per-operator memory, in bytes
-
enabled
boolean enabled()Determine if the queue is enabled.- Returns:
- true if the query is enabled, false otherwise.
-
close
void close()
-