Database Reference
In-Depth Information
the schedule generated so far. Executable (
) buffers requests chosen for exe-
cution. Scheduling protocols are realized as three scheduling queries: Q Schedule ,
Q Revoked , Q Irrelevant . Given previously executed requests, these queries deter-
mine in which order to execute pending requests. The scheduler state is advanced
in iterative steps by applying a generic scheduling algorithm (shown in Fig. 2)
that evaluates the scheduling queries over the current instances of the schedul-
ing relations. The algorithm is the same for every protocol, but is parameterized
by the protocol specific scheduling relations schemata and scheduling queries.
Each scheduler iteration (while loop) performs the following steps: (1) Requests
scheduled in the previous iteration are removed from
E
R
. (2) Newly arrived client
requests (
. (3) Q Revoked determines transactions that have
to be aborted since the requests cannot be executed due to constraint viola-
tions or blocking. (4) Q Schedule implements the scheduling protocol. It selects
all requests from
N
) are added to
R
that can be executed in this iteration without violating the
protocol constraints. (5) Requests in
R
E
are executed and (6) added to
H
. (7)
Q Irrelevant identifies those requests from
H
that are irrelevant for future schedul-
ing decisions, and is used to prune
H
so that it does not grow continuously.
2.2 Smile Architecture
The Smile prototype implements the Oshiya scheduling model outlined in the
last subsection using three threads ( ClientWorker , Declarative Scheduler and
Executor ), all running independently and continuously. The Smile architecture
is shown in Figure 1 with arrows denoting data flow.
Clients
H = E = R =
while true do begin
Smile
Runtime
Statistics
Collection
ClientWorker
Protocol
Library
R = R−E ;
Return
request
replies
1
Insert new
requests
R = R∪N ;
2
Declarative Scheduler
R
R = R−Q Revoked ( H, R );
Q
3
Revoked
Executor
DBMS
E = Q Schedule ( H, R );
4
Execute()
H
Execute ( E );
Q
5
Irrelevant
H = H∪E ;
6
Select
next
statement
Q
H = H−Q Irrelevant ( H );
end
E
Schedule
7
Fig. 2. Smile Algorithm
Fig. 1. Smile Architecture
ClientWorker. This thread manages client connections. The ClientWorker
thread receives new requests from clients, buffers these client requests in a queue
and periodically inserts them into
as batch job (Step 2).
Declarative Scheduler. This thread performs request scheduling by periodi-
cally executing Q Revoked , Q Schedule and Q Irrelevant (Steps 3, 4, 7).
Executor. The Executor thread is executing the scheduled requests located in
E
R
against the DBMS by repeating the following steps: Retrieve the request with
the smallest ID from E , execute it against the back-end DBMS, return the request
result to the client that has sent this request, and delete it from E (Step 5).
Search WWH ::




Custom Search