Apache Ignite SQL Documentation

The Apache Ignite SQL Developer Hub

Welcome to the Apache Ignite SQL developer hub. You'll find comprehensive guides and documentation to help you start working with Apache Ignite SQL as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

System Views

Ignite provides a number of built-in views that contain information about cluster nodes and node metrics. These views are contained in the SYS schema. See the Ignite Schemas page for the information on how to access a non-default schema in Ignite.

📘

Limitations

  1. You cannot create objects in the SYS schema.
  2. System views provided by the SYS schema cannot be joined with user tables.

NODES View

The NODES view contains information about the cluster nodes.

Columns

ColumnData TypeDescription
IDUUIDNode ID.
CONSISTENT_IDVARCHARNode's consistent ID.
VERSIONVARCHARNode version.
IS_CLIENTBOOLEANIndicates whether the node is a [client](doc:https://apacheignite.readme.io/docs/clients-vs-servers#overview node).
IS_DAEMONBOOLEANIndicates whether the node is a daemon node.
NODE_ORDERINTNode order within the topology.
ADDRESSESVARCHARThe addresses of the node.
HOSTNAMESVARCHARThe host names of the node.

NODE_ATTRIBUTES View

The NODE_ATTRIBUTES view contains the attributes of all nodes.

Columns

ColumnData TypeDescription
NODE_IDUUIDNode ID.
NAMEVARCHARAttribute name.
VALUEVARCHARAttribute value.

BASELINE_NODES View

The BASELINE_NODES view contains information about the nodes that are part of the current baseline topology.

Columns

ColumnData TypeDescription
CONSISTENT_IDVARCHARNode consistent ID.
ONLINEBOOLEANIndicates whether the node is up and running.

NODE_METRICS View

The NODE_METRICS view provides various metrics about the state of nodes, resource consumption and other metrics.

Columns

ColumnData TypeDescription
NODE_IDUUIDNode ID.
LAST_UPDATE_TIMETIMESTAMPLast time the metrics were updated.
MAX_ACTIVE_JOBSINTMaximum number of concurrent jobs this node ever had at one time.
CUR_ACTIVE_JOBSINTNumber of currently active jobs running on the node.
AVG_ACTIVE_JOBSFLOATAverage number of active jobs concurrently executing on the node.
MAX_WAITING_JOBSINTMaximum number of waiting jobs this node ever had at one time.
CUR_WAITING_JOBSINTNumber of queued jobs currently waiting to be executed.
AVG_WAITING_JOBSFLOATAverage number of waiting jobs this node ever had at one time.
MAX_REJECTED_JOBSINTMaximum number of jobs rejected at once during a single collision resolution operation.
CUR_REJECTED_JOBSINTNumber of jobs rejected as a result of the most recent collision resolution operation.
AVG_REJECTED_JOBSFLOATAverage number of jobs this node rejected as a result of collision resolution operations.
TOTAL_REJECTED_JOBSINTTotal number of jobs this node has rejected as a result of collision resolution operations since the node startup.
MAX_CANCELED_JOBSINTMaximum number of cancelled jobs this node ever had running concurrently.
CUR_CANCELED_JOBSINTNumber of cancelled jobs that are still running.
AVG_CANCELED_JOBSFLOATAverage number of cancelled jobs this node ever had running concurrently.
TOTAL_CANCELED_JOBSINTNumber of jobs cancelled since the node startup.
MAX_JOBS_WAIT_TIMETIMEMaximum time a job ever spent waiting in a queue before being executed.
CUR_JOBS_WAIT_TIMETIMELongest wait time among the jobs that are currently waiting for execution.
AVG_JOBS_WAIT_TIMETIMEAverage time jobs spend in the queue before being executed.
MAX_JOBS_EXECUTE_TIMETIMEMaximum job execution time.
CUR_JOBS_EXECUTE_TIMETIMELongest time a current job has been executing for.
AVG_JOBS_EXECUTE_TIMETIMEAverage job execution time on this node.
TOTAL_JOBS_EXECUTE_TIMETIMETotal time all finished jobs took to execute on this node since the node startup.
TOTAL_EXECUTED_JOBSINTTotal number of jobs handled by the node since the node startup.
TOTAL_EXECUTED_TASKSINTTotal number of tasks handled by the node.
TOTAL_BUSY_TIMETIMETotal time this node spent executing jobs.
TOTAL_IDLE_TIMETIMETotal time this node spent idling (not executing any jobs).
CUR_IDLE_TIMETIMETime this node has spent idling since executing the last job.
BUSY_TIME_PERCENTAGEFLOATPercentage of job execution vs idle time.
IDLE_TIME_PERCENTAGEFLOATPercentage of idle vs job execution time.
TOTAL_CPUINTNumber of CPUs available to the Java Virtual Machine.
CUR_CPU_LOADDOUBLEPercentage of CPU usage expressed as a fraction in the range [0, 1].
AVG_CPU_LOADDOUBLEAverage percentage of CPU usage expressed as a fraction in the range [0, 1].
CUR_GC_CPU_LOADDOUBLEAverage time spent in GC since the last update of the metrics. By default, metrics are updated every 2 seconds.
HEAP_MEMORY_INITLONGAmount of heap memory in bytes that the JVM initially requests from the operating system for memory management. Shows -1 if the initial memory size is undefined.
HEAP_MEMORY_USEDLONGCurrent heap size that is used for object allocation. The heap consists of one or more memory pools. This value is the sum of used heap memory values of all heap memory pools.
HEAP_MEMORY_COMMITEDLONGAmount of heap memory in bytes that is committed for the JVM to use. This amount of memory is guaranteed for the JVM to use. The heap consists of one or more memory pools. This value is the sum of committed heap memory values of all heap memory pools.
HEAP_MEMORY_MAXLONGMaximum amount of heap memory in bytes that can be used for memory management. The column displays -1 if the maximum memory size is undefined.
HEAP_MEMORY_TOTALLONGTotal amount of heap memory in bytes. The column displays -1 if the total memory size is undefined.
NONHEAP_MEMORY_INITLONGAmount of non-heap memory in bytes that the JVM initially requests from the operating system for memory management. The column displays -1 if the initial memory size is undefined.
NONHEAP_MEMORY_USEDLONGCurrent non-heap memory size that is used by Java VM. The non-heap memory consists of one or more memory pools. This value is the sum of used non-heap memory values of all non-heap memory pools.
NONHEAP_MEMORY_COMMITEDLONGAmount of non-heap memory in bytes that is committed for the JVM to use. This amount of memory is guaranteed for the JVM to use. The non-heap memory consists of one or more memory pools. This value is the sum of committed non-heap memory values of all non-heap memory pools.
NONHEAP_MEMORY_MAXLONGReturns the maximum amount of non-heap memory in bytes that can be used for memory management. The column displays -1 if the maximum memory size is undefined.
NONHEAP_MEMORY_TOTALLONGTotal amount of non-heap memory in bytes that can be used for memory management. The column displays -1 if the total memory size is undefined.
UPTIMETIMEUptime of the JVM.
JVM_START_TIMETIMESTAMPStart time of the JVM.
NODE_START_TIMETIMESTAMPStart time of the node.
LAST_DATA_VERSIONLONGIn-Memory Data Grid assigns incremental versions to all cache operations. This columns contains the latest data version on the node.
CUR_THREAD_COUNTINTNumber of live threads including both daemon and non-daemon threads.
MAX_THREAD_COUNTINTMaximum live thread count since the JVM started or peak was reset.
TOTAL_THREAD_COUNTLONGTotal number of threads started since the JVM started.
CUR_DAEMON_THREAD_COUNTINTNumber of live daemon threads.
SENT_MESSAGES_COUNTINTNumber of node communication messages sent.
SENT_BYTES_COUNTLONGAmount of bytes sent.
RECEIVED_MESSAGES_COUNTINTNumber of node communication messages received.
RECEIVED_BYTES_COUNTLONGAmount of bytes received.
OUTBOUND_MESSAGES_QUEUEINTOutbound messages queue size.

Examples

To query the system views using the SQLLine tool, connect to the IGNITE schema as follows:

$ ./sqlline.sh -u jdbc:ignite:thin://127.0.0.1/SYS

Run a query:

-- get the list of nodes
select * from NODES;

-- view the CPU load as a percentage for a specific node
select CUR_CPU_LOAD * 100 from NODE_METRICS where NODE_ID = 'a1b77663-b37f-4ddf-87a6-1e2d684f3bae'

The same example using Java Thin Client:

ClientConfiguration cfg = new ClientConfiguration().setAddresses("127.0.0.1:10800");

try (IgniteClient igniteClient = Ignition.startClient(cfg)) {
    System.out.println();

    // getting the id of the first node 
    UUID nodeId = (UUID) igniteClient.query(new SqlFieldsQuery("SELECT * from NODES").setSchema("IGNITE"))
    .getAll().iterator().next().get(0);

    double cpu_load = (double) igniteClient
    .query(new SqlFieldsQuery("select CUR_CPU_LOAD * 100 from NODE_METRICS where NODE_ID = ? ")
    .setSchema("IGNITE").setArgs(nodeId.toString()))
    .getAll().iterator().next().get(0);
  
    System.out.println("node's cpu load = " + cpu_load);

} catch (ClientException e) {
    System.err.println(e.getMessage());
} catch (Exception e) {
    System.err.format("Unexpected failure: %s\n", e);
}

Updated 4 months ago

System Views


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.