The HStoreSite will listen on the port defined in its proc_port paramter for incoming transaction requests from clients. This transaction requests are serialized StoredProcedureInvocation, which is originally based on the VoltDB wire protocol. Each request will be processed first by the VoltProcedureListener, and then passed into HStoreSite.procedureInvocation().
Each StoredProcedureInvocation request is turned into a handle. This object will store all the state information about a transaction both before and during a transaction executes. Each transaction is given a globaly ordered transaction id. The four key elements that the system needs to determine before a transaction can execute is:
- The partition to execute the transaction’s control code on (e.g., the base partition).
- The list of partitions that the DBMS thinks that the transaction will read/write data on.
- Whether the transaction is read-only.
- Whether the transaction could abort.
If the StoredProcedureInvocation request is for a system procedure, then it will be marked to execute on every partition in the cluster and its base partition will be a random partition on the local HStoreSite. Otherwise, the HStoreSite will use one of several different methods for determining what partitions it will need.
Once the HStoreSite determines this information, the transaction is either (1) passed directly to its base partition’s PartitionExecutor if it is single-partitioned or (2) passed to the HStoreCoordinator if it is a distributed transaction (i.e., the number of partitions that it will read/write data on is greater than one or is not the same as its base partition).
The HStoreSite also performs other high-level operations on transactions, such as restarting it and redirecting it to execute on another HStoreSite (based on its base partition). It acts as a go-between for the HStoreCoordinator and PartitionExecutors.