The Impala Daemon

The core Impala component is a daemon process that runs on each DataNode of the cluster, physically represented by the impalad process. It reads and writes
to data files; accepts queries transmitted from the impala-shell command, Hue, JDBC, or ODBC; parallelizes the queries and distributes work across the cluster; and
transmits intermediate query results back to the central coordinator node.

You can submit a query to the Impala daemon running on any DataNode, and that instance of the daemon serves as the coordinator node for that query. The other
nodes transmit partial results back to the coordinator, which constructs the final result set for a query. When running experiments with functionality through the impala-shell command, you might always connect to the same Impala daemon for convenience. For clusters running production workloads, you might load-balance by submitting each query
to a different Impala daemon in round-robin style, using the JDBC or ODBC interfaces.

The Impala daemons are in constant communication with the statestore, to confirm which nodes are healthy and can accept new work.

They also receive broadcast messages from the catalogd daemon (introduced in Impala 1.2) whenever any Impala node in the cluster
creates, alters, or drops any type of object, or when an INSERT or LOAD DATA statement is processed through Impala. This background
communication minimizes the need for REFRESH or INVALIDATE METADATA statements that were needed to coordinate metadata across nodes prior
to Impala 1.2.

The Impala Statestore

The Impala component known as the statestore checks on the health of Impala daemons on all the DataNodes in a cluster, and continuously relays its findings to
each of those daemons. It is physically represented by a daemon process named statestored; you only need such a process on one host in the cluster. If an Impala daemon
goes offline due to hardware failure, network error, software issue, or other reason, the statestore informs all the other Impala daemons so that future queries can avoid making requests to the
unreachable node.

Because the statestore's purpose is to help when things go wrong and to broadcast metadata to coordinators, it is not always critical to the normal operation of an Impala cluster. If the
statestore is not running or becomes unreachable, the Impala daemons continue running and distributing work among themselves as usual when working with the data known to Impala. The cluster just
becomes less robust if other Impala daemons fail, and metadata becomes less consistent as it changes while the statestore is offline. When the statestore comes back online, it re-establishes
communication with the Impala daemons and resumes its monitoring and broadcasting functions.

If you issue a DDL statement while the statestore is down, the queries that access the new object the DDL created will fail.

Most considerations for load balancing and high availability apply to the impalad daemon. The statestored and catalogd daemons do not have special requirements for high availability, because problems with those daemons do not
result in data loss. If those daemons become unavailable due to an outage on a particular host, you can stop the Impala service, delete the Impala StateStore and
Impala Catalog Server roles, add the roles on a different host, and restart the Impala service.

The Impala Catalog Service

The Impala component known as the catalog service relays the metadata changes from Impala SQL statements to all the Impala daemons in a cluster. It is physically
represented by a daemon process named catalogd; you only need such a process on one host in the cluster. Because the requests are passed through the statestore daemon,
it makes sense to run the statestored and catalogd services on the same host.

The catalog service avoids the need to issue REFRESH and INVALIDATE METADATA statements when the metadata changes are
performed by statements issued through Impala. When you create a table, load data, and so on through Hive, you do need to issue REFRESH or INVALIDATE METADATA on an Impala node before executing a query there.

The REFRESH and INVALIDATE METADATA statements are not needed when the CREATE TABLE,
INSERT, or other table-changing or data-changing operation is performed through Impala. These statements are still needed if such operations are done through Hive or by
manipulating data files directly in HDFS, but in those cases the statements only need to be issued on one Impala node rather than on all nodes. See REFRESH Statement and INVALIDATE METADATA Statement for the latest usage information
for those statements.

Use --load_catalog_in_background option to control when the metadata of a table is loaded.

If set to false, the metadata of a table will be loaded when it is referenced for the first time. This means that the first run of a particular query can
be slower than subsequent runs. Starting in Impala 2.2, the default for load_catalog_in_background is false.

If set to true, the catalog service will aim to load metadata for a table even if no query needed that metadata. So metadata will possibly be already
loaded when the first query that would need it is run. However, for the following reasons, we recommend not to set the option to true.

Both on startup and after a global or a table-specific metadata invalidate, the metadata load for tables that actual queries can get backed up because the catalog service could spend
time loading metadata for another table. During such load, a request for prioritized load by a query will be put on hold, and this can lead to seemingly random long-running queries that are difficult
for you to diagnose.

Impala may load metadata for tables that are possibly never used, increasing catalog size and consequently memory usage for both catalog and impalad.

Most considerations for load balancing and high availability apply to the impalad daemon. The statestored and catalogd daemons do not have special requirements for high availability, because problems with those daemons do not
result in data loss. If those daemons become unavailable due to an outage on a particular host, you can stop the Impala service, delete the Impala StateStore and
Impala Catalog Server roles, add the roles on a different host, and restart the Impala service.

Note:

In Impala 1.2.4 and higher, you can specify a table name with INVALIDATE METADATA after the table is created in Hive, allowing you to make individual
tables visible to Impala without doing a full reload of the catalog metadata. Impala 1.2.4 also includes other changes to make the metadata broadcast mechanism faster and more responsive, especially
during Impala startup. See New Features in Impala 1.2.4 for details.

If this documentation includes code, including but not limited to, code examples, Cloudera makes this available to you under the terms of the Apache License, Version 2.0, including any required
notices. A copy of the Apache License Version 2.0 can be found here.