You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Diplomarbeit</strong><br />
Graphische Oberfläche zum Offline-Studium<br />
des MELODY-File-Assigners<br />
Frank Thorsten Breuer<br />
<strong>Diplomarbeit</strong><br />
am Fachbereich Informatik<br />
der Universität Dortmund<br />
Freitag,<br />
13. Oktober 2000<br />
Gutachter:<br />
Prof. Dr. Horst F. Wedde<br />
Prof. Dr. Heiko Krumm
Acknowledgments<br />
I would like to thank Prof. Dr. Horst F. Wedde for his suggestions, support and motivation.<br />
To Wolfgang Freund G., a postgraduate and friend, for his effort, help and our discussions.<br />
Thanks to Sabine Böhm for testing.<br />
iii
Contents<br />
1 Introduction 1<br />
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br />
1.2 Goals of this Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2<br />
1.3 Outline of this Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2<br />
2 Melody 3<br />
2.1 Task Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
2.1.1 Criticality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
2.1.2 Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
2.1.3 Life Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
2.2 File Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
2.2.1 Public Copies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
2.2.2 Private Copies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
2.3 File Assigner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
2.3.1 Get Public Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />
2.3.2 Remove Local Public Copy . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
2.3.3 Remove Remote Public Copy . . . . . . . . . . . . . . . . . . . . . . . 8<br />
2.3.4 Emergency Remove Public Copy . . . . . . . . . . . . . . . . . . . . . 9<br />
2.3.5 Get Private Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />
2.3.6 Emergency Get Private Copy . . . . . . . . . . . . . . . . . . . . . . . . 10<br />
2.3.7 Remove Private Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />
3 Database 11<br />
3.1 Goals and Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
3.2 Choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
3.3 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
3.3.1 Users Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
3.3.2 Nodes Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
3.3.3 Experiments Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
3.3.4 Nodes In Experiment Table . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
3.3.5 Experiment Params Table . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
3.3.6 Files Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
3.3.7 Tasks Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
3.3.8 Events Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
3.3.9 Logs Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26<br />
3.4 Logfile filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
vi CONTENTS<br />
4 Implementation 29<br />
4.1 Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29<br />
4.2 Software Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30<br />
4.3 Experiment Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30<br />
4.4 Info Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33<br />
4.5 Experiment Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33<br />
4.5.1 Experiment Canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33<br />
4.5.2 Timer Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35<br />
5 User Manual 37<br />
5.1 Program Start and Connection to the Database . . . . . . . . . . . . . . . . . . . 37<br />
5.2 The Experiment Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />
5.3 The Experiment Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39<br />
5.3.1 File Copies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />
5.3.2 File Assigner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />
5.3.3 Changes in File Distribution . . . . . . . . . . . . . . . . . . . . . . . . 42<br />
5.3.4 Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />
5.4 The Experiment Info Window . . . . . . . . . . . . . . . . . . . . . . . . . . . 46<br />
6 Evaluation 47<br />
6.1 Database Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47<br />
6.2 Graphical User Interface Implementation . . . . . . . . . . . . . . . . . . . . . 47<br />
6.2.1 ExpSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47<br />
6.2.2 InfoFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47<br />
6.2.3 ExpFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48<br />
6.3 Real Logfile Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48<br />
7 Conclusions and Future Outlook 49<br />
Used Software 51<br />
Bibliography 53<br />
A Database 55<br />
A.1 Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55<br />
A.2 Events table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63<br />
B Source Code and Installation 69<br />
C Sample Pictures 71
List of Figures<br />
2.1 MELODY Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3<br />
2.2 Degrees of Criticality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
2.3 Degrees of Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
2.4 Task Execution Phases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
2.5 Get Public Copy Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />
2.6 Remove Local Public Copy Protocol . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
2.7 Remove Remote Public Copy Protocol . . . . . . . . . . . . . . . . . . . . . . . 9<br />
2.8 Emergency Remove Public Copy Protocol . . . . . . . . . . . . . . . . . . . . . 10<br />
3.1 Database Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
4.1 All Classes Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31<br />
4.2 Important Classes in Detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32<br />
5.1 Connecting to the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37<br />
5.2 Experiment Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />
5.3 Experiment Selector Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />
5.4 Experiment Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39<br />
5.5 Experiment Window Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />
5.6 Qualities of File Copies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />
5.7 File Assigner Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41<br />
5.8 File Assigner Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42<br />
5.9 File Assigner Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />
5.10 File Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />
5.11 Task Life Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44<br />
5.12 Criticality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44<br />
5.13 Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44<br />
5.14 Experiment Info Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46<br />
Conventions used in This Thesis<br />
The Typewriter Font is used for SQL tables, Java classes, and methods. The Typewriter<br />
Slanted Font is used for SQL columns and Java variables.<br />
When logfiles are quoted the Typewriter Font is used for original logfile entries. In case<br />
digits in the logfiles have been replaced by variables for clarity for these variables the Typewriter<br />
Slanted Font is used.<br />
References like [SG94] are used for literature, whereas references like [5] specify used software.
Chapter 1<br />
Introduction<br />
Safety-critical systems (e. g. air-plane and spacecraft automatic piloting and nuclear power plants)<br />
are systems where tasks do not only have to meet their deadlines, but become even critical in the<br />
sense that the whole system would crash after a certain number of subsequent deadline failures.<br />
In real-time systems the time a task needs is as important as the correctness of the result.<br />
MELODY is a prototype of an adaptive distributed real-time operating system that takes the<br />
requirements of safety-critical systems into account. The MELODY project was started at the<br />
Wayne State University in Detroit, Michigan and is continued at the University of Dortmund,<br />
Germany.<br />
Considering the complexity of such a system, the need for a new design methodology becomes<br />
evident. The MELODY system was developed by using a progress called incremental<br />
experimentation [WL97, sec. 2]: Refinements to MELODY base on results from the prior phase.<br />
The changes can be validated by experimenting with the newly added parameters.<br />
In MELODY two types of data files are distributed over different nodes: public copies are kept<br />
mutually consistent, and private copies are refreshed after updated to public copies. Reading<br />
tasks can access local available private copies as well as public copies. Writing tasks have got<br />
to work on public copies. The file assigner alters the file distribution to optimize the tasks’ file<br />
access [Sta96].<br />
Tasks work on the files by performing simple read and write operations in a transaction-like<br />
phase called critical section [SG94], [Win81]. A task can only enter its critical section after<br />
receiving locks from all accessed files.<br />
MELODY is described more detailed in chapter 2. The following explains intention and aim<br />
of this thesis.<br />
1.1 Motivation<br />
Recent years’ air plane crashes, spacecraft losses and accidents in atomic power plants prove<br />
the need for research in safety-critical distributed real-time systems. Still, as far as I know, in<br />
this field no work has been done that is comparable to MELODY. This makes MELODY an as<br />
interesting as complex project.<br />
Way MELODY disclosures its operations is obviously a result of this complexity: every task<br />
and every file on every node writes at least one logfile. These logfiles are indeed in a humanreadable<br />
but not in a human-analysable form. Gaining an overview of what happened during an<br />
experiment is quite an effort and time-consuming. On the other hand the information necessary<br />
to analyze a special detail is spread over a large number of logfiles. Analyzing an operation on<br />
one node requires a lookup in a number of logfiles on many nodes to find the cohering events
2 INTRODUCTION<br />
necessary to comprehend the operation. The concurrency of processes on one as well as on<br />
different nodes aggravate this problem.<br />
A real-time production of the events is pointless because MELODY experiments usually last<br />
between a couple of seconds and a few minutes. In a fraction of a second a huge number of<br />
events occurs. Neither the speed of a graphical user interface nor the user’s perspective faculty<br />
suffice this demand.<br />
So there is a need for a tool that shows the information of interest in an easily understandable<br />
way without loosing the relevant details. The graphical user interface must depict the events<br />
clearly. It has got to detect related events and display them suitably. The interdependence of<br />
operations should become cognizable. This thesis makes a start with the MELODY file assigners<br />
and the tasks file access.<br />
1.2 Goals of this Thesis<br />
The goals of this thesis are:<br />
1. design and implementation of a graphical user interface for offline studying the MELODY<br />
file assigner,<br />
2. design and creation of a database system that keeps the required data ready for display.<br />
Phenomenons — in the following all denominated as ‘events’ — in particular<br />
the local file assigner client’s decisions to attempt a change in file distribution,<br />
the order of events in the file assigner lock handling,<br />
changes in file distribution,<br />
the successful and failing file access of task instances<br />
phases in the tasks’ life cycles<br />
are to be stored in the database system and to be displayed by the graphical user interface.<br />
1.3 Outline of this Thesis<br />
Chapter 2 introduces the MELODY system concepts as far as it is needed for understanding the<br />
graphical user interface.<br />
The practical work splits into two parts: the database and the graphical user interface. The<br />
database, its design and creation is described in Chapter 3. The graphical user interface, its<br />
design and implementation is treated of in Chapter 4.<br />
Chapter 5 appearing as a manual describing the program out of a user’s point of view. Screen<br />
shots illustrate the manner of representation.<br />
The testing and gradual use on real experiment data is described in Chapter 6. Conclusions<br />
and a future outlook are given in Chapter 7.
Chapter 2<br />
Melody<br />
As mentioned in chapter 1 MELODY is a safety-critical distributed real-time operating system.<br />
For this purpose MELODY currently provides four services briefly described in the following.<br />
The file assigner is explained more detailed in section 2.3. In sections 2.1 and 2.2 the MELODY<br />
task model resp. the file model are explained as far as required to understand the graphical user<br />
interface. A more profound description is found in [Lin99].<br />
¢<br />
¡<br />
......<br />
. .............. ..... ..... . Task Scheduler ....... File Assigner ..........................................................<br />
¥¨<br />
£<br />
£<br />
¥<br />
¥ ¥<br />
¥ ¥ ¥ ¥ ¥ ¥§¦ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥<br />
¤<br />
¤<br />
¢<br />
...........<br />
¡<br />
....<br />
. ....... .........<br />
............... Run Time Monitor .. File Server .............................................................<br />
Figure 2.1: MELODY Servers<br />
Task Scheduler The Task Scheduler schedules the arrived tasks considering the task’s estimated<br />
execution time (derived from the file server’s history), its deadline, list of required files and<br />
static priority. The task scheduler distinguishes between strongly schedulable instances,<br />
which are scheduled, weakly schedulable instances, which are aborted but would have<br />
been scheduled, if the file distribution would have been appropiate, and non-schedulable<br />
tasks, which are aborted, too.<br />
Essentially critical tasks are not scheduled, but passed to the run-time monitor directly.<br />
Run Time Monitor Since the scheduler is invoced prior to resource allocation, it is left without<br />
exact information about the tasks’ execution time. Hence the run-time monitor is needed<br />
to abort tasks that are going to miss their deadlines after being scheduled.<br />
The run-time monitor consists of three sub-servers: the file monitor, the task monitor, and<br />
the integration controler. The task monitor aborts tasks, which are expected to miss their<br />
deadline, by monitoring the tasks’ life cycle (see figure 2.4). The file monitor checks, if<br />
file operations queued by the file server origin from a task instance that has already missed<br />
its deadline and removes these requests. The integration controler invokes the file server<br />
and task scheduler in a ratio that prevents too many tasks being scheduled and competing<br />
for the shared files.<br />
File Server The file server selects task instances, which have been scheduled, and tries to allocate<br />
the needed files. This is done utilizing the delayed insertion protocol [Dan92]. It
4 MELODY<br />
performes the read and write operations. The file server maintains a history about the read<br />
and write access for every file, requested by a task. This history is used to calculate a task’s<br />
estimated execution time regarded by the task scheduler.<br />
Having heard about public copy updates, the file server requests updates of his respective<br />
private copies.<br />
File Assigner The file assigner changes the file distribution in terms of location, number, and<br />
quality, in order to answer the tasks’ needs. Section 2.3 deals with the file assigner.<br />
2.1 Task Model<br />
Tasks perform simple read and write operations on files. Tasks are executed on a regular basis.<br />
Every instance of a task has got to go through a life cycle of four phases. In safety-critical<br />
systems tasks are assigned a criticality and sensitivity repesenting the task’s importance for the<br />
system.<br />
2.1.1 Criticality<br />
The criticality of a task is a gauge for the importance of the task to the entire system. In an<br />
aviation example the autopiloting is a critical task becoming even more critical, when landing,<br />
while the hot water preparation in the on-board kitchen is non-critical. Formally the criticality<br />
<br />
is defined as a © cirticality value assigned to a © © task. If , the task is called non critical, if<br />
© © , critical, and if ©© , essentially critical.<br />
©<br />
essentially critical critical non critical<br />
£<br />
£<br />
¡<br />
highest criticality lowest criticality<br />
© <br />
©<br />
Figure 2.2: Degrees of Criticality<br />
The © relative criticality of a task instance is set to the task’s © criticality value , if the<br />
<br />
task is (© © either non-critical ) or (©© essentially crititical ) or the last <br />
task instance<br />
was successful. Otherwise the relative criticality value is set to the task’s criticality value less<br />
the number of subsequent deadline failures making the instance more critical but not dropping<br />
below a © minumum of .<br />
2.1.2 Sensitivity<br />
The sensitivity of a task expresses the task’s dependence on up-to-date data. In the above example<br />
on normal flight level the autopiloting can cope with an inexactness of a few meters, but when<br />
landing especially immediately before touchdown, the exact height is needed. Formally the<br />
<br />
sensitivity is defined as a sensitivity value assigned to a task. If , the task is called<br />
robust, if , sensitive, and if , essentially sensitive.<br />
The relative sensitivity of a task instance is set to the task’s sensitivity value , if the<br />
<br />
task is ( either robust ) or ( essentially sensitive ) or the last task instance was<br />
successful. Otherwise the relative sensitivity value is set to the task’s sensitivity value plus the<br />
number of subsequent deadline failures making the instance more robust but not going over a<br />
maximum of .
2.1 Task Model 5<br />
essentially sensitive sensitive non sensitive<br />
£<br />
£<br />
¡<br />
highest sensitivity lowest sensitivity<br />
2.1.3 Life Cycle<br />
<br />
<br />
<br />
Figure 2.3: Degrees of Sensitivity<br />
The four phases every successful task instance goes through are the following:<br />
Scheduling phase In case the task scheduler recognizes the task instance to be schedulable,<br />
the instance is scheduled considering its priority and deadline. Otherwise the instance is<br />
aborted.<br />
Location phase During the location phase the file server locates all file copies required by the<br />
task instance. Reading tasks locate either a local copy — shadow or private, depending on<br />
the relative criticality and sensitivity — or a remote shadow copy. Writing tasks locate all<br />
public file copies.<br />
Acquisition phase The acquisition phase is different for reading and writing tasks:<br />
Writing tasks go through the allocation and locking subphases. These tasks have to compete<br />
for mutual exclusive file access using the delayed insertion protocol [Dan92]. The<br />
subphases correspond to the steps in the protocol directly. In the allocation subphase the<br />
instance sends requests to all file copies and waits for corresponding ready messages. After<br />
acquiring all ready messages the instance begins its locking subphase. During this phase<br />
the instance sends schedule messages to the file copies and waits for the lock messages.<br />
Reading tasks are not required to compete for file access. Nevertheless they have to be<br />
queued at the node holding the copy and gain a read lock.<br />
Computation phase After completing its acquisition phase successfully the instance begins its<br />
computation phase. It sends the read and write operations to all files and waits for responses.<br />
A message with a successful status is returned, in case the remote file server was<br />
able to perform the operation before the task’s deadline. Otherwise a failed is returned.<br />
If any access failed, the instance failed. Nevertheless all write operations are always performed<br />
to ensure the consistency of all public file copies.<br />
£<br />
Other system<br />
activities<br />
Creation time<br />
Scheduling<br />
phase<br />
£<br />
Location<br />
phase<br />
Start time<br />
Aquisition<br />
phase<br />
Execution time<br />
Computation<br />
phase<br />
Figure 2.4: Task Execution Phases<br />
£<br />
Laxity<br />
Completion<br />
time<br />
£<br />
Deadline<br />
Release phase If the instance was aborted or failed, it begins its release phase to give back all<br />
gained locks.<br />
Whether an instance was aborted or failed, it is marked as having failed in the sense of section<br />
2.1.1 and 2.1.2.<br />
¡
6 MELODY<br />
2.2 File Model<br />
As a distributed system MELODY replicates and distributes data objects (files) over different<br />
nodes. MELODY provides two types of file copies: public und private. For each public copy a<br />
shadow copy is created.<br />
2.2.1 Public Copies<br />
Public copies are shared resources and can be accessed by all tasks on every node. They always<br />
contain the latest data and are kept mutually consistent by a strong concurrency protocol. Since<br />
all public copies have to be updated, the time exposure for write operations depends directly on<br />
the number of public copies.<br />
For each public copy a shadow copy is created to allow reading access, while the file is being<br />
updated. Updating the shadow copy takes place automatically successive to the update to the<br />
public copy.<br />
2.2.2 Private Copies<br />
Private copies are not shared with other nodes in the MELODY system. They merly utilize a<br />
weak concurrency protocol, refreshing the copy some time after a public copy update. A private<br />
copy can only be accessed by reading tasks on the same node, which additionally have to be<br />
robust. Private copies may reduce the time exposure for read operations without increasing the<br />
write overhead.<br />
2.3 File Assigner<br />
The goal of the MELODY file assigner is to improve the availability of files and to better the<br />
system survivability. The available means are changes to file distribution in terms of location,<br />
number, and quality. The file assigner trades-off the costs for various alternative file distributions<br />
under changing request and deadline failure patterns. Therefore it cooperates with the local file<br />
server and remote file assigners. In this regard costs are overhead operations for multiple file<br />
copies and communication delays for remote operations.<br />
The difficulty is that changes to support one task may hamper other tasks. The following<br />
alternatives illustrate this.<br />
Creating a private copy of a file speeds up read access to the file originating from this node,<br />
without affecting write access. Unfortunately private copies can only be read by robust<br />
tasks.<br />
Creating a public copy of a file accelerates all read access to the file at least for tasks on this<br />
node. To writing tasks the additional copy involves more overhead.<br />
Moving a public copy from one node to another means more cost for reading tasks on one host<br />
resp. less cost on the other one.<br />
Reducing the number of public copies allows faster write access, while reading tasks at least<br />
on the affected node suffer.<br />
Deleting a private copy influences only robust reading tasks on the affected node.<br />
The MELODY file assigner has been divided into a server and a client part:
2.3 File Assigner 7<br />
¢<br />
¢<br />
Denied<br />
Not Possible<br />
Creation<br />
Create Done<br />
File Assigner Client<br />
Get Public Copy<br />
<br />
Check FA-Lock<br />
Granted<br />
¤<br />
Create or Move Copy<br />
<br />
<br />
<br />
Movement<br />
<br />
Request Creation Request Movement<br />
¡<br />
<br />
<br />
<br />
<br />
Move Done<br />
File Assigner Server<br />
Request Get Copy<br />
<br />
<br />
<br />
<br />
§<br />
<br />
FA-Lock Requested<br />
<br />
<br />
<br />
Release FA-Lock<br />
<br />
Release Done<br />
<br />
<br />
<br />
<br />
<br />
<br />
Respond FA Lock with<br />
relocation and replication info<br />
<br />
<br />
<br />
Release FA Lock<br />
<br />
<br />
<br />
<br />
§<br />
<br />
FA-Lock Released<br />
<br />
<br />
<br />
<br />
<br />
Respond Release<br />
Figure 2.5: Get Public Copy Protocol<br />
File assigner client The file assigner client decides how to change the file distribution to improve<br />
the costs for accessing a certain file. On account of the drastic effects of changes<br />
in distribution of public copies the file assigner client has got to ask for the file assigner<br />
servers’ consent, i. e. to retrieve a lock on the file.<br />
File assigner server The file assigner server handles requests for information regarding file<br />
copies on its node, their costs and needs for copies. The file assigner lock procedure<br />
ensures that only one file assigner client changes the distribution of a certain file at any<br />
time.<br />
The above mentioned lock procedure is realized utilizing the priority insertion protocol<br />
[Dan92]. The below sections describe the possible file assigner client decisions, the conditions<br />
for making these decisions, and the resulting file assigner lock procedures.<br />
2.3.1 Get Public Copy<br />
This service (see figure 2.5) is executed after the local file assigner has determined that a number<br />
of local read access requests have failed and a public copy should be created at the local node.<br />
The file assigner client sends get-copy-requests to all file assigner servers holding a copy of<br />
the respective file. In response the file assigner servers grant or deny a file assigner lock. In<br />
the case a file assigner server grants a lock it includes information whether it would allow the<br />
relocation of its local copy, if local read access on his node would not significantly suffer, or the<br />
creation of an additional one, if write access from his node would not significantly suffer.
8 MELODY<br />
¢<br />
¢<br />
Denied<br />
Not Possible<br />
File Assigner Client<br />
Remove Local Public Copy<br />
¡<br />
<br />
Check FA-Lock<br />
Granted<br />
¤<br />
Check Delete<br />
Deletion Possible<br />
¤<br />
Delete Local Copy<br />
Deletion Done<br />
¤<br />
Release FA-Lock<br />
<br />
Release Done<br />
File Assigner Server<br />
Request Delete<br />
<br />
<br />
<br />
<br />
§<br />
<br />
FA-Lock Requested<br />
<br />
<br />
<br />
<br />
<br />
Respond FA Lock<br />
<br />
<br />
<br />
Release FA Lock<br />
<br />
<br />
<br />
<br />
§<br />
<br />
FA-Lock Released<br />
<br />
<br />
<br />
<br />
<br />
Respond Release<br />
Figure 2.6: Remove Local Public Copy Protocol<br />
If one file assigner server has refused a lock, the file assigner client releases all already<br />
obtained locks and finishes the request. Having received responses from all file assigner servers<br />
the fac checks, if a file assigner server has allowed to move his public copy. If so, the file assigner<br />
client leads the file server to move this copy. If not, the file assigner client determines, if all file<br />
assigner server agree to create a new copy. If creation is possible, the local file server creates a<br />
new local copy, otherwise the file assigner client cannot do anything. Last step is the release of<br />
all obtained locks.<br />
2.3.2 Remove Local Public Copy<br />
Once the local file assigner client has determined that a local public copy should be removed,<br />
delete copy requests (see figure 2.6) are sent to all file assigner servers holding a public copy of<br />
this file.<br />
If all file assigner servers have granted a file assigner lock, the file assigner client ensures,<br />
that the number of public copies does not drop below the minimum number. If this condition is<br />
met, the local file server deletes the local copy. At the end of this service the file assigner client<br />
releases all obtained locks.<br />
2.3.3 Remove Remote Public Copy<br />
After determining a number of failing tasks writing on a file the file assigner client tries to<br />
reduce the number of public copies. Thereto is sends delete copy requests to all file assigner
2.3 File Assigner 9<br />
¢<br />
¢<br />
Denied<br />
Not Possible<br />
File Assigner Client<br />
Remove Remote Public Copy<br />
¡<br />
<br />
Check FA-Lock<br />
Granted<br />
¤<br />
Check Delete<br />
Deletion Possible<br />
¤<br />
Request Deletion<br />
Deletion Done<br />
¤<br />
Release FA-Lock<br />
<br />
Release Done<br />
File Assigner Server<br />
Request Delete Copy<br />
<br />
<br />
<br />
<br />
§<br />
<br />
FA-Lock Requested<br />
<br />
<br />
<br />
<br />
<br />
Respond FA Lock<br />
with deletion info<br />
<br />
<br />
<br />
Release FA Lock<br />
<br />
<br />
<br />
<br />
§<br />
<br />
FA-Lock Released<br />
<br />
<br />
<br />
<br />
<br />
Respond Release<br />
Figure 2.7: Remove Remote Public Copy Protocol<br />
server holding a copy of this file (see figure 2.7).<br />
Compared to removing a local copy (section 2.3.2) this change in file distribution affects<br />
reading tasks on other nodes. So the file assigner servers have not only to grant a file assigner<br />
lock but also decide whether or not they allow a deletion of their copy. If all locks could be<br />
obtained and a file assigner server allows the deletion, the file assigner client requests the local<br />
file server to delete the copy.<br />
2.3.4 Emergency Remove Public Copy<br />
Once a nearly sessentially critical writing task has failed and endangers the survivability of the<br />
system (emergency situation) this service is invoced in order to reduce the number of public<br />
copies of the respective file. So the chance that the next (essentially critical) instance of the<br />
failing task will be successful.<br />
The file assigner client sends emergency requests to all file assigner servers holding a copy of<br />
this file. These, in turn, grant or deny a file assigner lock. If all file assigner servers have granted<br />
locks, the file assigner client selects the copy with the lowest number of read access requests<br />
according to the conveyed read access histories.<br />
The file assigner client leads the file server to delete this copy. At the end of this service just<br />
as of the services above the file assigner locks are released.
10 MELODY<br />
Denied<br />
Not Possible<br />
2.3.5 Get Private Copy<br />
¢<br />
¢<br />
File Assigner Client<br />
Emerg. Remove Public Copy<br />
¡<br />
<br />
Check FA-Lock<br />
Granted<br />
¤<br />
Check Delete<br />
¤<br />
Request Deletion<br />
Delete node selected<br />
Deletion Done<br />
¤<br />
Release FA-Lock<br />
<br />
Release Done<br />
File Assigner Server<br />
Request Emergency Copy<br />
<br />
<br />
<br />
<br />
§<br />
<br />
FA-Lock Requested<br />
<br />
<br />
<br />
<br />
<br />
Respond FA Lock<br />
with read access history<br />
<br />
<br />
<br />
Release FA Lock<br />
<br />
<br />
<br />
<br />
§<br />
<br />
FA-Lock Released<br />
<br />
<br />
<br />
<br />
<br />
Respond Release<br />
Figure 2.8: Emergency Remove Public Copy Protocol<br />
The file assigner client determines the need for a local private copy, if a number of failing robust<br />
local read access requests have taken place.<br />
The change in distribution of private copies does not affect remote nodes. So the file assigner<br />
client can issue a request to the file server to create a private copy without a previous file assigner<br />
lock procedure.<br />
2.3.6 Emergency Get Private Copy<br />
When a nearly essentially critical reading task has failed, the system survivability might be compromised.<br />
Under all circumstances a local private copy has to be created, to ensure successful<br />
read access for the next (essentially critical) task instance.<br />
Apart from that this service is the same as get private copy (see section 2.3.5).<br />
2.3.7 Remove Private Copy<br />
If a private copy is rarely accessed, the file assigner client decides to remove it. Since this does<br />
not affect the remote nodes either, this is done without competing for file assigner locks.
Chapter 3<br />
Database<br />
The database system is the first part of the practical work done in writing this thesis. The database<br />
keeps the logfile data ready for display by the graphical user interface.<br />
This chapter lists requirements the database has to satisfy, gives the reasons, why POST-<br />
GRESQL is the chosen database system, and explains the design and creation of the MELODY<br />
database.<br />
3.1 Goals and Requirements<br />
The database system, as important part of the graphical user interface, provides the following<br />
services:<br />
interface between the MELODY system and the graphical user interface<br />
management and accumulation of MELODY experiments run by different users.<br />
The database system should allow<br />
a possibility to configurate MELODY experiments<br />
extentions for future versions of MELODY.<br />
The chosen database system should satisfy the requirements below:<br />
availability for the LINUX operation system<br />
SQL as query language<br />
high stability<br />
adequate speed with moderate resource consumption.<br />
3.2 Choice<br />
The two eligible database systems are:<br />
MYSQL [3]<br />
POSTGRESQL [4]
12 DATABASE<br />
Both are included in the S.U.S.E. LINUX 6.x distributions [5]. POSTGRESQL derived from<br />
the Berkeley Postgres Project and is distributed by the Postgres Development Team under the<br />
Berkeley License. MYSQL is free for non-comercial use, the TCX DataKonsult AB, Stockholm,<br />
Sweden charges for commercial licenses.<br />
MYSQL [AWCD00] implements a sufficient subset of the SQL standard. It does not support<br />
constraints or foreign keys. Insertions and updates are faster, selects do not show a significant<br />
difference compared to using POSTGRESQL.<br />
POSTGRESQL [Pos00] offers a wider selection of SQL features, but not as many as described<br />
in [Mom00], a book that turned out to be science fiction to some extend. Some complicated updates<br />
and inserts become instable on large amounts of data. None of these features is needed<br />
neiher by the graphical user interface nor by the filter described in 3.4, so this lack is no disadvantage<br />
in this connexion. POSTGRESQL supports transactions and check constraints. Check<br />
constraints, which can replace foreign keys, and transactions are an inestimable advantage to the<br />
databases consistency.<br />
Since the higher speed of MYSQL is insignificant and POSTGRESQL’s advantages prevail,<br />
the choice is POSTGRESQL. Nevertheless the graphical user interface uses only basic SQLstandard<br />
queries in order to stay database system independent.<br />
3.3 Structure<br />
The structure of the MELODY database has been modelled making use of [1]. Figure 3.1 shows<br />
the database modell. The generated sql statements have been optimized for POSTGRESQL manualy:<br />
The generated foreign keys have been replaced by sql functions and check constraints. The<br />
constraints for the LOGS table are entirely hand made.<br />
The sql statements creating the tables as well as the functions are presented in Appendix A.1<br />
(pp. 55). In the following the main tables are outlined.<br />
3.3.1 Users Table<br />
The database table ‘USERS’ stores all MELODY users. The table consists of the following<br />
columns:<br />
UserID SMALLINT UNIQUE PRIMARY KEY<br />
is a unique user id. It is referenced by the EXPERIMENTS table (s. section 3.3.3).<br />
Name VARCHAR(30)<br />
holds the user’s short name, e. g. his 1 unix account.<br />
Description VARCHAR(80)<br />
gives a description e. g. his full name.<br />
The sql function userOK(UserID) returns , if the passed UserID is found in the<br />
USERS table, otherwise. The UserID’s check constraint in the table EXPERIMENTS (s.<br />
section 3.3.3) calls this function to see, if the user exists.<br />
3.3.2 Nodes Table<br />
The database table ‘NODES’ holds a list of all nodes used for MELODY experiments. The table<br />
consists of the following columns:<br />
1 or her
3.3 Structure 13<br />
Figure 3.1: Database Structure
14 DATABASE<br />
NodeID SMALLINT UNIQUE PRIMARY KEY<br />
is a unique node id. It is referenced by the table NODES IN EXPERIMENT (s. section<br />
3.3.4).<br />
Name VARCHAR(30)<br />
is the node’s DNS 2 name in its short form without domain.<br />
Ok BOOLEAN<br />
indicates, if the node can currently be used for experiments.<br />
The sql function nodeOK(NodeID) returns , if the passed NodeID is found in the<br />
NODES table, otherwise. It is used by a check contraint in NODES IN EXPERIMENT (s.<br />
section 3.3.4) to see, if its NodeID points to an existing node.<br />
3.3.3 Experiments Table<br />
The database table ‘EXPERIMENTS’ stores a list of all MELODY experiments. The table consists<br />
of the following columns:<br />
ExpID INTEGER UNIQUE PRIMARY KEY<br />
is a unique id for every experiment. It is referenced by many other tables, e. g. LOGS (s.<br />
section 3.3.9), in order to relate each of their rows to a distinct experiment.<br />
UserID SMALLINT<br />
references a UserID in the USERS table (s. section 3.3.1).<br />
DateTime TIMESTAMP<br />
indicates when the experiment was inserted.<br />
Description VARCHAR(80)<br />
gives a short description of the experiment.<br />
The sql function expOK(ExpID) returns , if the passed ExpID is found in this table, <br />
otherwise. It is called by check constraints of all tables, which need to reference an experiment.<br />
3.3.4 Nodes In Experiment Table<br />
The database table ‘NODES IN EXPERIMENT’ remembers which nodes took part in which experiment.<br />
The table consists of the following columns:<br />
ExpID INTEGER<br />
references an ExpID in the EXPERIMENTS table.<br />
NodeID SMALLINT<br />
references an NodeID in the NODES table.<br />
The UNIQUE INDEX NODES IN EXP guaranties every node is assiciated with an experiment<br />
only once.<br />
The sql function nodeInExp(ExpID, NodeID) returns , if NodeID took part in ExpID,<br />
otherwise. It is called by other tables’ check constraints, whenever a node taking part in<br />
an experiment is referenced.<br />
2 Domain Name System
3.3 Structure 15<br />
3.3.5 Experiment Params Table<br />
The database table ‘EXPERIMENT PARAMS’ stores parameters for every MELODY experiment.<br />
The table consists of the following columns:<br />
ExpID INTEGER<br />
references an ExpID in EXPERIMENTS (s. section 3.3.3).<br />
Critical SMALLINT<br />
is the threshold that, if reached by a task’s criticality, means the task is critical.<br />
EssCritical SMALLINT<br />
is the threshold that, if exceeded by a task’s criticality, means the task is essentially critical.<br />
Sensitive SMALLINT<br />
is the threshold that, if reached by a task’s criticality, means the task is sensitive.<br />
EssSensitive SMALLINT<br />
is the threshold that, if exceeded by a task’s criticality, means the task is essentially sensitive.<br />
These four thresholds are explained with full details in [Lin99, sec 3.1]<br />
SchIntegID SMALLINT<br />
references a scheduler integration type listed in the SCHINTEGRATION table. At present<br />
‘periodic’, ‘dynamic’, ‘adjusted’ and ‘joined’ are possible. This choice is described in<br />
[Lin99, sec. 7.1.1] and [WL97, sec. 2.4].<br />
SchParams VARCHAR(20)<br />
a character string containing the scheduler parameters, which depend on the scheduler<br />
integration type.<br />
RTIntegID SMALLINT<br />
references a scheduler integration type listed in the RTINTEGRATION table. At present<br />
‘abort before computation’, ‘earliest abort before acquisition’, ‘medium abort before acquisition’<br />
and ‘latest abort before acquisition’ are possible. See [WLS99, sec. 4].<br />
FAIntegID SMALLINT<br />
references a scheduler integration type listed in the FAINTEGRATION table. At present<br />
‘task driven’, ‘file driven’, ‘history’ and ‘disabled’ are possible. Further information on<br />
the file assiner integration is found in [Lin99, sec. 6.1.4] and [Sta96, sec 4.4].<br />
FAThNotUsed SMALLINT<br />
FAThGetCopy SMALLINT<br />
FAThAllowCopy SMALLINT<br />
FAThReduceCopy SMALLINT<br />
FAThDeleteCopy SMALLINT<br />
FATryWait SMALLINT<br />
FAChangeWait SMALLINT<br />
FAHistWindow SMALLINT<br />
The above parameters are file assigner parameters described in [Sta96, sec. 4.2].<br />
MinPublic SMALLINT<br />
is the guarantied minimum number of public copies of each file. This parameter biasses<br />
the fault-tolerance properties of MELODY.
16 DATABASE<br />
MaxPublic SMALLINT<br />
is the maximum number of public copies the file assigner must not exceed.<br />
FileModelID SMALLINT<br />
references a scheduler integration type listed in the FILEMODELS table. At present<br />
‘melody’, ‘public’ and ‘private’ are possible.<br />
ServerPrio SMALLINT<br />
defines the basic server priority. The actual server priorities are set relative to this one.<br />
SyncMaster SMALLINT<br />
references the node that is used as master for time synchronisation. See [Lin99, app. B]<br />
and [WF00].<br />
3.3.6 Files Table<br />
The database table ‘FILES’ determines which files took part in an experiment, and on which<br />
node public and private copies were initially created. For each initial copy one row is inserted.<br />
The table consists of the following columns:<br />
ExpID INTEGER<br />
references an ExpID in the EXPERIMENTS table.<br />
FileID INTEGER<br />
is the file’s id.<br />
NodeID SMALLINT<br />
references an NodeID in the NODES IN EXPERIMENTS table that takes part in the experiment.<br />
Shows the node where a copy is initially created.<br />
Type CHAR(4)<br />
Determines the type (‘PUB’, ‘PRIV’) of the copy in initially created.<br />
Description VARCHAR(120)<br />
can hold a description of the file.<br />
The UNIQUE INDEX FILES IN EXP guaranties that every initial file copy on a node is<br />
unique within an experiment.<br />
The sql function fileInExp(ExpID, FileID) returns , if NodeID occures in ExpID,<br />
otherwise. It is called by other tables’ check constraints, whenever a file taking part in<br />
an experiment is referenced.<br />
3.3.7 Tasks Table<br />
The database table ‘TASKS’ stores the information needed about tasks that are run in an experiment.<br />
For each file a task accesses one row is inserted. The table consists of the following<br />
columns:<br />
ExpID INTEGER<br />
references an ExpID in the EXPERIMENTS table.<br />
TaskID SMALLINT<br />
is the task’s id.
3.3 Structure 17<br />
NodeID SMALLINT<br />
references the NodeID in the NODES IN EXPERIMENTS table where the task is run.<br />
Criticality SMALLINT<br />
determines the task’s criticality.<br />
Sensitivity SMALLINT<br />
determines the task’s sensitivity.<br />
FileID SMALLINT<br />
references a FileID in the FILES table. shows which files is accessed by the task.<br />
ReadWrite CHAR(1)<br />
indicates, if the task reads on (‘R’) or writes to (‘W’) FileID.<br />
Description VARCHAR(120)<br />
can hold a description of the file.<br />
The sql function taskInExp(ExpID, TaskID) returns , if NodeID occures in ExpID,<br />
otherwise. It is called by a check constraint in the LOGS table to see, if the referenced<br />
task exists.<br />
The UNIQUE INDEX TASKS IN EXP guaranties that no multiple rows are inserted.<br />
3.3.8 Events Table<br />
The database table ‘EVENTS’ provides information about all events that are stored in the LOGS<br />
table (s. section 3.3.9) and displayed by the graphical user interface. The priority assignment<br />
is to fix which columns in the LOGS table are mandatory for the respective events. The table<br />
consists of the following columns:<br />
EventID SMALLINT UNIQUE PRIMARY KEY<br />
is the unique id referenced by the LOGS table.<br />
Abr VARCHAR(30)<br />
is a short name of the event.<br />
Description VARCHAR(80)<br />
provides a short description of the event.<br />
LogFilePattern VARCHAR(80)<br />
The filter program (s. section 3.4) uses this pattern to find the rows in the logfiles according<br />
to this event.<br />
LogFileType VARCHAR(12)<br />
By stating a file extention, the LogFileType determines which logfiles the filter program<br />
searches for the pattern.<br />
LogFileMulti BOOL<br />
Some events are reported in several logfiles on different hosts. If this flag is set, the filter<br />
program ignores all events that do not affect the local node.<br />
FileID BOOL<br />
NodeID BOOL
18 DATABASE<br />
PeerNodeID BOOL<br />
TaskID BOOL<br />
Instance BOOL<br />
Criticality BOOL<br />
Sensitivity BOOL<br />
Data BOOL<br />
The above columns indicate, if the according columns in the LOGS table are mandatory.<br />
There is related function ‘...Mand(EventID)’ for each of these flags that is called by<br />
the LOGS table’s check constraints.<br />
Table 3.1 notes the inserted events down. In the following the events are described in more<br />
detail. All inhabitants as inserted into database are presented in Appendix A.2 on page 63.<br />
EventID<br />
Abreviation<br />
1100 GetPublic<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
1101 RemovePublicLocal<br />
1102 RemovePublicRemote<br />
1103 RemoveEmergencyPublic<br />
1104 GetPrivate<br />
1105 GetEmergencyPrivate<br />
1106 RemovePrivate<br />
1110 LockDenied<br />
1111 LockGranted<br />
1112 LockWinnerDeny<br />
1113 LockWinnerMove<br />
1114 LockWinnerCopy<br />
1115 LockWinnerDelete<br />
1116 LockWinnerEmergencyRemovePublic<br />
1117 LockRelease<br />
1200 CreatePrivateCopy<br />
1201 CreatePublicCopy<br />
1202 ChangePrivatePublicCopy<br />
1203 DeletePrivateCopy<br />
1204 DeletePublicCopy<br />
1205 ActivePublicCopy<br />
1206 ActiveShadowCopy<br />
1207 ActivePrivateCopy<br />
1208 DeactivePublicCopy<br />
1209 DeactivePrivateCopy<br />
1300 RequestDataCopy<br />
1301 ReceivePublicCopy<br />
1302 ReceivePrivateCopy<br />
1303 ReceiveCopyLength<br />
1304 ReceiveDataPortion<br />
FileID<br />
NodeID<br />
Table 3.1: Displayed Events<br />
PeerNodeID<br />
TaskID<br />
Instance<br />
Criticality<br />
Sensitivity<br />
Data<br />
cont’d on next page
3.3 Structure 19<br />
EventID<br />
Abreviation<br />
cont’d from last page<br />
1305 ReceiveCopyComplete <br />
2000 InstanceArrival <br />
2001 SchedulePhase <br />
2002 Scheduled <br />
2003 LocationPhase <br />
2004 LocatedFile <br />
2005 AquisitionPhase <br />
2006 AllocationSubPhase <br />
2007 ReadyFile <br />
2008 LockingSubPhase <br />
2009 LockedFile <br />
2019 GiveBackLock <br />
2010 ComputationPhase <br />
2011 Reading <br />
2018 Writing <br />
2012 Succeeding <br />
2013 Aborting <br />
2014 ReleasePhase <br />
2015 ReleaseFile <br />
2016 Success <br />
2017 Failed <br />
FileID<br />
NodeID<br />
Table 3.1: Displayed Events<br />
GetPublic The file assigner client at NodeID has decided to try to create a local public copy<br />
of FileID.<br />
This event coincides with the<br />
“realtimestamp | GET PUBLIC COPY”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
RemovePublicLocal The file assigner client at NodeID has decided to try to remove his local<br />
public copy of FileID.<br />
This event coincides with the<br />
“realtimestamp | REMOVE PUBLIC COPY LOCAL”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
RemovePublicRemote The file assigner client at NodeID has decided to try to reduce the<br />
number of public copies of FileID.<br />
This event coincides with the<br />
“realtimestamp | REMOVE PUBLIC COPY REMOTE”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
PeerNodeID<br />
TaskID<br />
Instance<br />
Criticality<br />
Sensitivity<br />
Data
20 DATABASE<br />
RemoveEmergencyPublic In an emergency situation the file assigner client at NodeID has<br />
decided to try to reduce the number of public copies of FileID.<br />
This event coincides with the<br />
“realtimestamp | EMERGNCY PUBLIC COPY REMOTE”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
GetPrivate The file assigner client at NodeID has decided to create a local private copy of<br />
FileID.<br />
This event coincides with the<br />
“realtimestamp | GET PRIVATE COPY”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
GetEmergencyPrivate In an emergency situation the file assigner client at NodeID has decided<br />
to create a local private copy of FileID.<br />
This event coincides with the<br />
“realtimestamp | EMERGNCY PRIVATE COPY REMOTE”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
RemovePrivate The file assigner client at NodeID has decided to remove his local private<br />
copy of FileID.<br />
This event coincides with the<br />
“realtimestamp | REMOVE PRIVATE COPY LOCAL”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
LockDenied The file assigner server at PeerNodeID has refused a file assigner lock for<br />
FileID requested by NodeID.<br />
This event coincides with the<br />
“realtimestamp | LOCK DENIED AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
LockGranted The file assigner server at PeerNodeID has granted a file assigner lock for<br />
FileID requested by NodeID.<br />
This event coincides with the<br />
“realtimestamp | LOCK GRANTED BY PeerNode ...”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
LockWinnerDeny All file assigner servers holding a copy of FileID have granted a file<br />
assigner lock for FileID requested by NodeID, but refuse the requested action. If this event<br />
follows an ‘RemoveEmergencyPublic’ event, it means that at least one file assigner server has<br />
refused this file assigner lock requested by NodeID.<br />
This event coincides with the<br />
“realtimestamp | REQUEST DENIED HISTORY”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
LockWinnerMove All file assigner servers holding a copy of FileID have granted a file assigner<br />
lock for FileID requested by NodeID, the file assigner server at PeerNodeID allows<br />
to move his public copy of this file.
3.3 Structure 21<br />
This event coincides with the<br />
“realtimestamp | MOVING PUBLIC FROM PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
LockWinnerCopy All file assigner servers holding a copy of FileID have granted a file<br />
assigner lock for FileID requested by NodeID and allow to create a new public copy at this<br />
node. The copy will be received from PeerNodeID.<br />
This event coincides with the<br />
“realtimestamp | GETTING PUBLIC FROM PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
LockWinnerDelete All file assigner servers holding a copy of FileID have granted a file<br />
assigner lock for FileID requested by NodeID and allow to remove a public copy. The copy<br />
at PeerNodeID will be removed.<br />
This event coincides with the<br />
“realtimestamp | REMOVING PUBLIC AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
LockWinnerEmergencyRemovePublic All file assigner servers holding a copy of FileID<br />
have granted a file assigner lock for FileID requested by NodeID, which is in an emergency<br />
situation.<br />
This event coincides with the<br />
“realtimestamp | "EMERGNCY PUBLIC FROM Node”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
LockRelease The file assigner client at PeerNodeID releases file assigner lock at NodeID<br />
for FileID.<br />
This event coincides with the<br />
“realtimestamp | LOCK PUBLIC RECEIVE WRITE/ASSIGN RELEASE<br />
FROM PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
Unlike the ‘Lock Granted’ and ‘Lock Denied’ events this log file entry is found in the<br />
PeerNodeID’s logs, so compared to the preceding events NodeID and PeerNodeID are<br />
swapped.<br />
CreatePrivateCopy NodeID starts creating a local private copy of FileID.<br />
This event coincides with the<br />
“realtimestamp | CREATE PRIVATE COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.<br />
CreatePublicCopy NodeID starts creating a local public copy of FileID.<br />
This event coincides with the<br />
“realtimestamp | CREATE PUBLIC COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.
22 DATABASE<br />
ChangePrivatePublicCopy NodeID starts changing his local private copy of FileID into a<br />
public one.<br />
This event coincides with the<br />
“realtimestamp | CHANGING PRIVATE COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.<br />
DeletePrivateCopy NodeID starts deleting his local private copy of FileID.<br />
This event coincides with the<br />
“realtimestamp | DELETE PRIVATE COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.<br />
DeletePublicCopy NodeID starts deleting his local public copy of FileID.<br />
This event coincides with the<br />
“realtimestamp | DELETE PUBLIC COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.<br />
ActivePublicCopy A public copy of FileID has been created on NodeID.<br />
This event coincides with the<br />
“realtimestamp | ACTIVE PUBLIC COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.<br />
ActiveShadowCopy A shadow copy of FileID has been created on NodeID.<br />
This event coincides with the<br />
“realtimestamp | ACTIVE SHADOW COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.<br />
ActivePrivateCopy A private copy of FileID has been created on NodeID.<br />
This event coincides with the<br />
“realtimestamp | ACTIVE PRIVATE COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.<br />
DeactivePublicCopy The public copy of FileID has been removed from NodeID.<br />
This event coincides with the<br />
“realtimestamp | DEACTIVE PUBLIC COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.
3.3 Structure 23<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.<br />
DeactivePrivateCopy The private copy of FileID has been removed from NodeID.<br />
This event coincides with the<br />
“realtimestamp | DEACTIVE PRIVATE COPY AT PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
This event is logged on every node. In the database only one entry is necessary, so this event<br />
may only be inserted, if NodeID equals PeerNodeID.<br />
RequestDataCopy The file server on NodeID has asked the file server on PeerNodeID for<br />
a copy of FileID.<br />
This event coincides with the<br />
“realtimestamp | REQUEST DATA COPY FROM PeerNode”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
ReceivePublicCopy The file server on NodeID has started to receive a public copy of FileID.<br />
This event coincides with the<br />
“realtimestamp | RECEIVE COPY PUBLIC ...”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
ReceivePrivateCopy The file server on NodeID has started to receive a private copy of<br />
FileID.<br />
This event coincides with the<br />
“realtimestamp | RECEIVE COPY PRIVATE ...”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
ReceiveCopyLength The file server on NodeID has received the length (Data) of FileID,<br />
he is receiving.<br />
This event coincides with the<br />
“realtimestamp | RECEIVE COPY LENGTH data”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
ReceiveDataPortion The file server on NodeID has received a portion with length (Data) of<br />
FileID.<br />
This event coincides with the<br />
“realtimestamp | RECEIVE DATA PORTION data”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
ReceiveCopyComplete The file server on NodeID has received all portion of FileID.<br />
This event coincides with the<br />
“realtimestamp | RECEIVE COPY COMPLETE”<br />
log file entries in the file ‘Node/FILEFileID.moving’.<br />
InstanceArrival Instance of TaskID on NodeID has arrived.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - INSTANCE ARRIVAL
24 DATABASE<br />
STARTED ...”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
SchedulePhase Instance of TaskID on NodeID has begun its scheduling phase. It will<br />
be scheduled with Citicality and Sensitivity .<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - BEGINNING SCHEDULE PHASE<br />
[Criticality,Sensitivity] ...”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
Scheduled Instance of TaskID on NodeID has been scheduled.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - SCHEDULED”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
LocationPhase Instance of TaskID on NodeID has begun its location phase.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - BEGINNING LOCATION PHASE”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
LocatedFile Instance of TaskID on NodeID has located FileID on PeerNodeID.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - LOCATED FILE<br />
FileID@PeerNodeID ...”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
AquisitionPhase Instance of TaskID on NodeID has begun its aquisition phase.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - BEGINNING AQUISITION PHASE”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
AllocationSubPhase Instance of TaskID on NodeID has begun its allocation subphase.<br />
This events occurs only, if the task reads at least one file.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - BEGINNING ALLOCATION<br />
SUB-PHASE”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
ReadyFile FileID on PeerNodeID is ready for Instance of TaskID on NodeID. This<br />
event occurs only, if the task writes on this file.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - READY FILE<br />
FileID@PeerNodeID ...”<br />
log file entries in the file ‘Node/TASKTaskID.access’.
3.3 Structure 25<br />
LockingSubPhase Instance of TaskID on NodeID has begun its locking subphase. This<br />
events occurs only, if the task reads at least one file.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - BEGINNING LOCKING<br />
SUB-PHASE”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
LockedFile FileID on PeerNodeID is locked by Instance of TaskID on NodeID.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - LOCKED FILE<br />
FileID@PeerNodeID ...”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
GiveBackLock Instance of TaskID on NodeID has given back lock to FileID on<br />
PeerNodeID.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - GIVEBACK FILE<br />
FileID@PeerNodeID ...”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
RemoveFile FileID on PeerNodeID has been removed and Instance of TaskID on<br />
NodeID has been notified.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - REMOVE FILE<br />
FileID@PeerNodeID ...”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
ComputationPhase Instance of TaskID on NodeID has begun its computation phase.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - BEGINNING COMPUTATION<br />
PHASE”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
Reading Instance of TaskID on NodeID has read from FileID on PeerNodeID.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - PLAYER TaskID Instance@Node<br />
- READING (...)”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
Unlike the e. g. ‘LocatedFile’, ‘LockedFile’ events this log file entry is found in the log<br />
files of the accessed file, so compared to the preceding events NodeID and PeerNodeID are<br />
swapped.<br />
Writing Instance of TaskID on NodeID has written to FileID on PeerNodeID.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - PLAYER TaskID Instance@Node<br />
- WRITING (...)”<br />
log file entries in the file ‘Node/TASKTaskID.access’.
26 DATABASE<br />
Unlike the e. g. ‘LocatedFile’, ‘LockedFile’ events this log file entry is found in the log<br />
files of the accessed file, so compared to the preceding events NodeID and PeerNodeID are<br />
swapped.<br />
Succeeding Instance of TaskID on NodeID is going to terminate successfully.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - SUCCEEDING”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
Failing Instance of TaskID on NodeID could not access the files in time and is not going<br />
to terminate successfully.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - FAILING”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
Aborting Instance of TaskID on NodeID has been aborted and is not going to terminate<br />
successfully.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - ABORTING”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
ReleasePhase Instance of TaskID on NodeID has begun its release phase.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - BEGINNING RELEASE<br />
PHASE”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
ReleaseFile Instance of TaskID on NodeID has released FileID on PeerNodeID.<br />
This event coincides with the<br />
“realtimestamp | PLAYER TaskID Instance@PeerNode - RELEASE”<br />
log file entries in the file ‘Node/FileFileID.access’.<br />
Unlike the e. g. ‘LocatedFile’, ‘LockedFile’ events this log file entry is found in the log files<br />
of the accessed file, so compared to those events NodeID and PeerNodeID are swapped.<br />
Success Instance of TaskID on NodeID has terminated successfully.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - SUCCESS [...]”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
Failed Instance of TaskID on NodeID has terminated not successfully.<br />
This event coincides with the<br />
“realtimestamp | INSTANCE Instance - FAILED [...]”<br />
log file entries in the file ‘Node/TASKTaskID.access’.<br />
3.3.9 Logs Table<br />
The database table ‘EVENTS’ holds all events occuring in all experiments. The table consists of<br />
the following columns:
3.4 Logfile filter 27<br />
ExpID SMALLINT<br />
references an ExpID in the EXPERIMENTS table and assigns this event to one experiment.<br />
TimeStamp INTEGER<br />
is the time relative to the first event in the experiment in .<br />
RealTimeStamp FLOAT<br />
is the timestamp found in the logfiles in .<br />
EventID SMALLINT<br />
references an EventID in the EVENTS table.<br />
FileID SMALLINT<br />
references an FileID in the FILES table<br />
NodeID SMALLINT<br />
references an NodeID in the NODES IN EXPERIMENT table<br />
PeerNodeID SMALLINT<br />
references an NodeID in the NODES IN EXPERIMENT table<br />
TaskID SMALLINT<br />
references an TaskID in the TASKS table<br />
Instance INTEGER<br />
Criticality SMALLINT<br />
Sensitivity SMALLINT<br />
Data INTEGER<br />
The last eight columns hold the parameters that are mandatory for the event. Constraints<br />
ensure that the columns are filled with data, if and only if this is intended for the respective<br />
EventID according to the EVENTS table (s. section 3.3.8).<br />
3.4 Logfile filter<br />
The filter program is strictly speaking not a part of this thesis. The perl script was written by<br />
Wolfgang Freund G. and Frank Thorsten Breuer.<br />
Its duty is to add a performed experiment to the MELODY database. Therefore it copies all<br />
MELODY logfiles from the experiment manager brachio to the local host and parses them.<br />
It adds one row each to the EXPERIMENTS and EXPEXIMENT PARAMS tables and several<br />
rows to the FILES IN EXPERIMENT, NODES and TASKS tables according to the MELODY<br />
parameter files. It inserts the required logfile data to the LOGS table in consistence with the<br />
EVENTS table.
Chapter 4<br />
Implementation<br />
The implementaion of the graphical user interface is the second part of the practical work. This<br />
chapter explaines the choice of Java as programming language. The design of the graphical user<br />
interface is described and illustrated with UML 1 diagrams. In the following sections interesting<br />
implementation details concerning the translation of the data, obtained from the database, into<br />
displayable information are explained.<br />
4.1 Java<br />
As programming language C, C++, and Java are in widespread use. Both C and C++ are standard<br />
languages especially in an UNIX environment. Whereas Java is a quite young object orientated<br />
language that gained an enormous popularity.<br />
Before deciding on a language the key requirements to the language are to be considered:<br />
For the implementation of a graphical user interface the used programming language<br />
should provide a set of powerful graphic routines.<br />
The program must be executed with a reasonable speed, since the graphical user interface<br />
includes animations.<br />
Multi threaded programming languages deskill graphic animation programming.<br />
Database access should be provided independently from the database system.<br />
An object orientated software design is desired.<br />
Java’s Abstract Windowing Toolkit provides a sufficient set of classes to develop a graphical user<br />
interface. Additionally the ‘Swing’ classes, a package for developing more advanced graphical<br />
user interfaces, are available. The ‘Swing’ classes have become a part of the Java standard classes<br />
in Java version 1.2.<br />
C and C++ themself do not provide libraries for building graphical user interfaces but use<br />
external libraries like Motif. Another possibility is to use programs like Tkl/Tk. Using Motif<br />
produces faster programs compared to Java. Motif provides more features and higher speed<br />
performance, but using Motif is quite tricky and fault-prone. Tkl/Tk is not faster that Java. The<br />
combination of two heterogenous systems like C++ and Tkl/Tk causes problems which cannot<br />
arise when using a monolithic system like Java.<br />
1 UML = unified modelling language
30 IMPLEMENTATION<br />
For C and C++ a number of database access libraries exist. Usually these are database<br />
specific and migration from one database system to another is complicated. The JDBC (Java<br />
Database Connection) provides a package for operation system independent and database system<br />
independent access to SQL databases.<br />
Java itself is multi threaded, while C and C++ have to utilze libraries. C and C++ programs<br />
are compiled for a special platform. Compiled Java programs are interpreted by the Java Virtual<br />
Machine and stay platform independent. The consequence is that Java programs cannot reach<br />
the speed of C or C++ programs.<br />
Java serves the requirements above. C and C++ have to utilize external libraries to reach the<br />
functionality of core java. Since C is a procedural language, a decision between C++ and java<br />
is to be made. Trading-off the functionality of Java and the higher speed of C++ the decision is<br />
Java.<br />
The version 1.1.7 of the JDK (Java Development Kit) [2] is used. This version is distributed<br />
with the S.U.S.E. LINUX distributions [5] as a trade-off between stability and functionality. —<br />
A comprehendable decision.<br />
4.2 Software Architecture<br />
Figure 4.1 gives an overview of all classes created for the graphical user interface. The UML<br />
figures printed in this chapter were produced using [6]. The graphical user interface contains<br />
three classes which apear on the screen as independent Frames. Each of them, together with the<br />
classes the respective class utilizes, makes one module of the graphical user interface.<br />
ExpSelect<br />
InfoFrame<br />
ExpFrame<br />
Each of these modules is described in the following sections.<br />
The communication between these modules is done by using the ClosableWindow interface<br />
that is implemented by each of the classes listed above.<br />
The one and only instance of the ExpSelect class is instanciated by the public static<br />
void main() method, where the execution of the program starts. This instance creates instances<br />
of the InfoFrame and ExpFrame classes depending on the user input. The ExpSelect<br />
class keeps track of all open windows. It can close one of the windows by calling its<br />
closeFrame() method. Vice versa the window calls the closeFrame() method of the<br />
ExpSelect class when closing itself.<br />
4.3 Experiment Selector<br />
The ExpSelect class is a subclass of the Frame class. The one and only instance is created<br />
after the program start.<br />
This instance establishes a connection to the database. All other classes which need a connection<br />
call the getConnection() method of this class to obtain one.<br />
This instance holds a list of all experiments stored in the database. If the user wants an<br />
experiment to be displayed or wants to see the experiment info, this class instanstantiates the<br />
ExpFrame resp. the InfoFrame classes. It keeps track of all these instances. If one of these<br />
frames closes itself, it informs the ExpSelect instance by calling its closeFrame method.
4.3 Experiment Selector 31<br />
Figure 4.1: All Classes Overview
32 IMPLEMENTATION<br />
Figure 4.2: Important Classes in Detail
4.4 Info Frame 33<br />
4.4 Info Frame<br />
The InfoFrame class is the smallest module of the graphical user interface. It is a subclass of<br />
the Frame class. Its only job is to obtain a database connection from the ExpSelect class and<br />
retrieve the initial file distribution and task parameters. This information is displayed by placing<br />
instances of the Label class into a Scrollpane.<br />
When this frame is closing itself, it calls the closeFrame method from the ExpSelect<br />
class.<br />
4.5 Experiment Frame<br />
The most subtle module is the ExpFrame. The ExpFrame class is a subclass of the Frame<br />
class. After being instantiated itself by the ExpSelect class it chiefly creates its own MenuBar,<br />
an instance of the ExperimentCanvas class and an instance of the TimerDialog. class<br />
The TimerDialog instance obtains the required data from the database and transfers it to<br />
the ExperimentCanvas instance. So most of the work is done by these two classes.<br />
4.5.1 Experiment Canvas<br />
This class holds all information about all displayed objects. Therefor the following data structure<br />
is created.<br />
Hashtable nodes;<br />
public class NodeData<br />
{<br />
int id;<br />
String name;<br />
...<br />
Hashtable tasks;<br />
...<br />
}<br />
public class TaskData<br />
{<br />
int nodeID;<br />
int taskID;<br />
int crit;<br />
int sens;<br />
int yOffset;<br />
...<br />
Hashtable instances;<br />
...<br />
}<br />
public class FileAccessData<br />
{<br />
int peerNodeID;<br />
int fileID;
34 IMPLEMENTATION<br />
}<br />
int status;<br />
...<br />
public class InstanceData<br />
{<br />
int nr;<br />
...<br />
int status;<br />
int crit;<br />
int sens;<br />
int success;<br />
Hashtable fileAccess;<br />
...<br />
}<br />
Hashtable files;<br />
public class FileStatus<br />
{<br />
int copyStatus;<br />
int moveStatus;<br />
int movePeer;<br />
int asgnStatus;<br />
int lockStatus;<br />
Hashtable lockPeers;<br />
...<br />
}<br />
class FileData<br />
{<br />
int id;<br />
...<br />
Hashtable status;<br />
...<br />
}<br />
The ExperimentCanvas class holds the NodeData in the Hashtable nodes. Each<br />
NodeData again holds the TaskData in the Hashtable tasks. And again each Task-<br />
Data holds the InstanceData in the Hashtable instances.<br />
So the Hashtable nodes contains all data regarding the nodes, the tasks on each node,<br />
and the instances of each task.<br />
The other important data structure is the Hashtable files. It holds all FileData, i. e.<br />
all information about the file distribution, the file servers and file assigner.<br />
The following methods enlarge these data structures by adding more objects to the respective<br />
Hashtables. They return true, if the operation was successful, false, otherwise.<br />
public boolean addNode(int n, String s);
4.5 Experiment Frame 35<br />
public boolean addFile(int n);<br />
public boolean addTask(int nodeID, int taskID, int crit,<br />
int sens);<br />
public boolean addWriteFile(int nodeID, int taskID,<br />
int fileID);<br />
public boolean addTaskInstance(int nodeID, int taskID,<br />
int instance);<br />
The following methods change the status of the respective objects. They return true, if the<br />
event was visible on the screen, false, otherwise. The TimerDialog needs this information<br />
to stop after every visible event in single step mode.<br />
public boolean setFileAsgnStatus(int fileID, int nodeID,<br />
int status);<br />
public boolean setFileLockStatus(int fileID, int nodeID,<br />
int status);<br />
public boolean setFileLockPeer(int fileID, int nodeID,<br />
int peerNodeID, int status);<br />
public boolean setTaskInstanceStatus(int nodeID, int taskID,<br />
int instance, int status);<br />
public boolean setTaskInstanceCritSens(int nodeID, int taskID,<br />
int instance, int c, int s);<br />
public boolean setFileAccessStatus(int nodeID, int taskID,<br />
int instance, int fileID, int peerNodeID, int status);<br />
public boolean setTaskInstanceSuccess(int nodeID, int taskID,<br />
int instance, int status);<br />
boolean setFileCopyStatus(int fileID, int nodeID, int status);<br />
boolean setFileMovePeer(int fileID, int nodeID, int peerNodeID);<br />
boolean setFileMoveStatus(int fileID, int nodeID, int status);<br />
boolean fileMoveDataPortion(int fileID, int nodeID);<br />
4.5.2 Timer Dialog<br />
This class takes the user input regarding the progress in time. For each action ‘to beginning of<br />
experiment’, ‘one step forward’, ‘ten steps forward’, ‘play’, ‘one step back’, ‘ten steps back’,<br />
and ‘goto timestamp’ a button is created. If a button is pressed the respective method is called.<br />
The example below shows invoked, when the ‘play’ button is pressed.<br />
boolean doPlay(...)<br />
{<br />
ResultSet results = ... /* make SQL query */<br />
while(results.next())<br />
{<br />
if( ... /* display interrupted */)<br />
{<br />
return(true);<br />
}<br />
setCurrentTime(results.getInt(9));<br />
doStep(results))<br />
}
36 IMPLEMENTATION<br />
}<br />
return(false);<br />
boolean doStep(ResultSet result)<br />
{<br />
switch(result.getInt(1))<br />
{<br />
case ...: return( ... );<br />
/* call ExperimentCanvas.method() */<br />
...<br />
case ...: return( ... );<br />
}<br />
System.err.println("Error: unknown event");<br />
return(false);<br />
}<br />
The method do step is called for each event. It translates the data recieved from the database<br />
into calls to the ExperimentCanvas instance.
Chapter 5<br />
User Manual<br />
This chapter illustrates the graphical user interface. The functionality of the three modules the<br />
experiment selector, the experiment frame, and the experiment info frame is described out of a<br />
user’s point of view.<br />
5.1 Program Start and Connection to the Database<br />
The graphical user interface is started by executing the shell script GUI run. The script sets the<br />
required Java properties and extents the CLASSPATH variable.<br />
First of all the graphical user interface must connect to the database system. Therefore it<br />
prompts for the necessary data (see figure 5.1). That is the database URL, the user name, and the<br />
password, where the database URL has the following form:<br />
protocol:driver://host:port/database<br />
The default database URL is set by the above mentioned shell script.<br />
The input is concluded by pressing the ‘Ok’ button. If the connection to the database connot<br />
be established the window keeps prompting for the correct input. Pressing the ‘Cancel’ button<br />
quits the program. As soon as the graphical user interface could connect the experiment selector<br />
window becomes accessible.<br />
Figure 5.1: Connecting to the Database
38 USER MANUAL<br />
5.2 The Experiment Selector<br />
The experiment selector looks like displayed in figure 5.2. It lists all MELODY experiments<br />
stored in the database to be selected by the user. Each row in the list consists of a unique<br />
experiment id, the user who inserted the experiment, the insertion date, and a short description.<br />
The menu bar grants access to the options of this window. Figure 5.3 shows the menus and<br />
points out the provided options:<br />
File Menu figure 5.3(a)<br />
Figure 5.2: Experiment Selector<br />
Open Opens the selected experiment in another window (see section 5.3). If no experiment<br />
is selected or the experiment is already opened, this menu item is disabled.<br />
This action can also be performed by double clicking the experiment in the list.<br />
Info Opens an extra window showing the initial file distribution and the files accessed by<br />
each task (see section 5.4).<br />
Close Closes this window.<br />
Quit Closes all windows and quits the graphical user interface.<br />
View Menu figure 5.3(b)<br />
Update The experiment selector is not notified about newly inserted experiment. Selecting<br />
this menu item rereads the list of experiments from the database.<br />
(a) File Menu (b) View Menu (c) Filter Dialog<br />
Figure 5.3: Experiment Selector Menu Bar
5.3 The Experiment Window 39<br />
Order by The listed experiments can be arranged by number, user, date, or description<br />
each in descending or ascending order.<br />
Filter . . . Shows the filter dialog (figure 5.3(c)), allowing to list only the desired experiments.<br />
5.3 The Experiment Window<br />
The experiment window visualizes all information regarding the file distribution, the file assigner<br />
activities and the running task instances. The window is divided into columns representing the<br />
MELODY nodes. At the head of each column the currently existing file copies and the MELODY<br />
file assigner activities are displayed. Thereunder the tasks on this node are listed.<br />
The representation of file copies is introduced in section 5.3.1, the representation of the file<br />
assigner activities in section 5.3.2, and the representation of tasks in section 5.3.4.<br />
Figure 5.4: Experiment Window<br />
The menu bar (figure 5.5) gives an overview about the options of this window:<br />
File Menu figure 5.5(a)<br />
ExpSelect Shows the experiment selector window, so the user can select another experiment.<br />
Close Closes this experiment window<br />
Quit Closes all windows and quits the graphical user interface.<br />
View Menu figure 5.5(b)<br />
Timer Hides resp. shows the timer dialog which controls the progress in time while an<br />
experiment is displayed<br />
Exp. Parameters Hides resp. shows the parameters dialog<br />
Assigner Locks Hides resp. shows the lines representing the file assigner locks<br />
File Access Hides resp. shows the lines representing the task file access<br />
ViewNode Menu figure 5.5(c)<br />
Hides resp. shows nodes, i. e. the column representing a node. All events involving this<br />
node are not displayed.<br />
ViewFiles Menu figure 5.5(d)<br />
Hides resp. shows files. Again events involving this file are not displayed.
40 USER MANUAL<br />
(a) File (b) View (c) View Node<br />
(d) View File (e) View Task (f) Options<br />
Figure 5.5: Experiment Window Menu Bar<br />
ViewTasks Menu figure 5.5(e)<br />
Hides resp. shows tasks. Every task on each node can be hidden seperately.<br />
Options Menu figure 5.5(f)<br />
Selects a speed for the play mode.<br />
5.3.1 File Copies<br />
MELODY provides three qualities of files: public copies, shadow copies, and private copies.<br />
Figure 5.6 shows the appearance of each type.<br />
The file distribution is shown at the top of the experiment window. For non existing file<br />
copies the space is left empty (a neighbouring file does not move up) in order to attain a clear<br />
arrangement.<br />
(a) Private Copy (b) Public Copy (c) Public Copy with Shadow<br />
Copy<br />
5.3.2 File Assigner<br />
Figure 5.6: Qualities of File Copies<br />
The MELODY file assigner tries to improve the task file access by changing the file distribution.<br />
The file assigner client decisions have already been explained in section 2.3. They are displayed
5.3 The Experiment Window 41<br />
by the graphical user interface as described in the following.<br />
Get Public Copy see figure 5.7(a)<br />
The decision to create a public copy in this node is displayed by the outline of a public<br />
copy. Its color is green indicating a decision in a non-emergency situation.<br />
Remove Local Copy see figure 5.7(b)<br />
The decision to remove either a private or a public local copy is both displayed in the same<br />
way. It is distinguished by the type of file copy underlying the cross-out.<br />
Remove Remote Public Copy see figure 5.7(c)<br />
The decision to reduce the number of public copies is displayed by a thumb pointing down.<br />
Again this is a non-emergency decision so the colour is green.<br />
Emergency Remove Public Copy see figure 5.7(d)<br />
The difference to the above decision is that this decision is made in an emergency situation,<br />
so it is displayed in red.<br />
Get Private Copy see figure 5.7(e)<br />
The decision to create a private copy in this node is displayed by a green outline of a<br />
private copy.<br />
Emergency Get Private Copy see figure 5.7(f)<br />
This decision is made in an emergency situation. Hence the outline of a private copy is<br />
displayed in red.<br />
(a) Get Public Copy (b) Remove Local<br />
Copy<br />
(d) Emergency Remove<br />
Public Copy<br />
(c) Remove Remote<br />
Public Copy<br />
(e) Get Private Copy (f) Emergency Get Private<br />
Copy<br />
Figure 5.7: File Assigner Procedures<br />
In case the decision affects the distribution of public copies, the file assigner client has to<br />
compete for a file assigner lock on this file. Granted locks are displayed by pink arrows pointing<br />
from the node whose file assigner client obtained the lock to the node whose file assigner server<br />
granted it. Denied locks are displayed in yellow. In this case a frowny appears at the file assigner<br />
client’s node (see figure 5.8(a)).<br />
As described in section 2.3 a file assigner lock may be granted or not. If it is granted, several<br />
cases may occur:
42 USER MANUAL<br />
Lock Granted see figure 5.8(b)<br />
A file assigner lock on this file has been granted, but the file assigner servers prohibit the<br />
desired change.<br />
Lock Granted Move see figure 5.8(c)<br />
A file assigner lock on this file has been granted. One file assigner server allows to move<br />
his public copy.<br />
Lock Granted Copy see figure 5.8(d)<br />
A file assigner lock on this file has been granted. All file assigner servers allows to create<br />
an additional public copy.<br />
Lock Granted Delete see figure 5.8(e)<br />
A file assigner lock on this file has been granted. All file assigner servers allows to delete<br />
a public copy.<br />
(a) Lock Denied (b) Lock Granted (c) Lock Granted Move<br />
5.3.3 Changes in File Distribution<br />
(d) Lock Granted Copy (e) Lock Granted<br />
Delete<br />
Figure 5.8: File Assigner Locks<br />
When a MELODY file assigner client has obtained all required file assigner locks, it can change<br />
the file distribution. Therefor it sends a request to the local file server. The following procedures<br />
are possible:<br />
Creation of a Public Copy see figure 5.9(a)<br />
The file server creates a public copy.<br />
Creation of a Private Copy see figure 5.9(b)<br />
The file server creates a private copy.<br />
Deletion of a Copy see figure 5.9(c)<br />
The file server deletes a copy. Whether a private or a public copy is deleted, is obvious<br />
through the underlying icon displaying either a private or a public copy.<br />
Relocation of a Public Copy The relocation of a public copy is done by creating a copy on the<br />
destination node and deleting the copy on the source node.
5.3 The Experiment Window 43<br />
(a) Get Public Copy (b) Create Private Copy (c) Remove Copy<br />
Figure 5.9: File Assigner Procedures<br />
The procedure of transfering a data copy is executed as described in the following.<br />
Request a Data Copy<br />
The file server requests a data copy from a node that holds a public copy of the file. A blue<br />
line connects the icons on the source and on the destination node.<br />
Receive Data Copy see figure 5.10(a)<br />
The transfer begins. The icon formerly showing an empty box is now half-filled.<br />
Receive Data Portion<br />
The transfer of a data portion is displayed by an icon moving along the blue line menioned<br />
above.<br />
Receive Copy Complete see figure 5.10(b)<br />
The transfer is completed. The icon is now almost filled. As soon as the copy is activated<br />
the icon is completely filled (see figure 5.6(b)).<br />
5.3.4 Tasks<br />
(a) Beginning of Transfer (b) Transfer Completed<br />
Figure 5.10: File Movement<br />
MELODY tasks run through a life cycle described in section 2.1.3. The following describes how<br />
this is visualized by the graphical user interface.<br />
Arrival see figure 5.11(a)<br />
Before the scheduling phase has begun the task instance is displayed as empty box just<br />
showing task and instance number. In figure 5.11 instead of instance number and task<br />
number ‘I’ resp. ‘T’ is plotted.<br />
Scheduling Phase see figure 5.12 and figure 5.13<br />
The beginning of the scheduling phase is indicated by highlighting the task icon in colours<br />
according to its criticality and sensitivity.
44 USER MANUAL<br />
(a) Arrived (b) Scheduled (c) Location Phase<br />
(d) Acquisition Phase (e) Locking Phase (f) Computation Phase<br />
(g) Succeeding (h) Failing (i) Release Phase<br />
Figure 5.11: Task Life Cycle<br />
(a) non-critical (b) critical (c) ess. critical<br />
Figure 5.12: Criticality<br />
(a) robust (b) sensitive (c) ess. sensitive<br />
Figure 5.13: Sensitivity
5.3 The Experiment Window 45<br />
Scheduled see figure 5.11(b)<br />
The instance has been scheduled and waits to begin its location phase.<br />
Location Phase see figure 5.11(c)<br />
The location phase is depictured by a magnifying glass. Every file copy that is located by<br />
the instance is connected to the instance icon with a black line.<br />
Acquisition Phase see figure 5.11(d)<br />
The acquisition phase is different for reading tasks and writing tasks.<br />
Reading tasks have only got to obtain read locks. The read locks are displayed by changing<br />
the black colour for located files into blue.<br />
Writing tasks run through the allocation and locking subphases corresponding with the<br />
phases of the delayed insertion protocol [Dan92]. The Allocation Subphase is displayed<br />
without a different icon compared to the acquisition phase, since the instance enters the<br />
allocation subphase immediately after beginning its acquisition phase. In contrast to the<br />
locks of reading tasks the allocated file copies are marked with green lines for writing<br />
tasks.<br />
Locking Subphase see figure 5.11(e)<br />
The locking subphase is entered by writing tasks only. In this last phase of the delayed<br />
insertion protocol the writing tasks have got to obtain a write locks on the required file<br />
copies. Write locks are displayed as red lines.<br />
Computation Phase see figure 5.11(f)<br />
After obtaining all required locks the instance can enter its computation phase to perform<br />
its file access. When a locked file copy has been accessed successfully, the red or blue line<br />
indicating the file lock is turned dark red resp. dark blue.<br />
Succeeding see figure 5.11(g)<br />
This is strictly speaking not a phase of the task life cycle. As soon as the instance has<br />
successfully accessed all files, it was successful. This is depictured by a green smiley. The<br />
instance starts to release the locked file copies.<br />
Failing see figure 5.11(h)<br />
In case the instance will not be able to meet its deadline or the deadline is already expired<br />
the instance is marked as failing by displaying a red frowny.<br />
Release Phase see figure 5.11(i)<br />
A task instance that failed releases its file locks in this phase. The corresponding lines<br />
disappear.
46 USER MANUAL<br />
5.4 The Experiment Info Window<br />
The experiment info window visualizes the initial file distribution. Underneath every gray bar<br />
the file copies initially created on this node are itemized. Thereunder small white bars indicate<br />
the tasks executed on the node. For each task the accessed files are listed.<br />
When clicking on a file copy, every copy of this file is highlighted. So conflicts in file access<br />
are easily detected.<br />
Figure 5.14: Experiment Info Frame
Chapter 6<br />
Evaluation<br />
The database is the basis for the graphical user interface. So testing the database took place first.<br />
Soley the incremental insertion of the events was done simultaneously for the database and the<br />
TimerDialog class.<br />
6.1 Database Creation<br />
The only source of errors in creating the database were the manually created check constraints. In<br />
the order, the tables reference each other, beginning with the USER and NODES tables one table<br />
was manually inhabited with data using the POSTGRESQL frontend. The functions that access<br />
these tables (described in section 3.3) were invoced by hand, to verify their correctness. Next<br />
step was to insert allowable and undue data to the tables, whose constraints use these functions,<br />
to check these constraints, and so forth.<br />
The EVENTS table was inhabited with only a handful of events to test the function in principle.<br />
The entry of all events was deferred to later on (section 6.3). This was done event by event<br />
while testing the graphical user interface.<br />
6.2 Graphical User Interface Implementation<br />
In the testing phase the greatest lack of the JAVA DEVELOPMENT KIT [2] emerges: the lack<br />
of a java debugger. It is true that java forces the programmer to write relatively faultless<br />
code and dumps useful information, if a java program crashes, but debugging only by inserting<br />
‘System.out.println(...)’ has definitely not been up to date for ages.<br />
6.2.1 ExpSelect<br />
The ExpSelect class establishes the connections to the database. Therefore numerous possible<br />
errors of the database backend were caused to verify the graphical user interface’s behaviour.<br />
This class keeps track of all other open frames. This feature was tested using dummies for<br />
the InfoFrame and ExpFrame classes.<br />
6.2.2 InfoFrame<br />
A comparison between the MELODY profiles and the presentation of files and tasks renders a<br />
verification of the filter program parsing the profiles, the proper database tables and the InfoFrame<br />
class possible.
48 EVALUATION<br />
6.2.3 ExpFrame<br />
Most work in the ExpFrame is done by the ExperimentCanvas and TimerDialog classes.<br />
The ExperimentCanvas class provides methods which are called mainly by the Timer-<br />
Dialog class. As a first checking these methods were called by a dummy Frame in the order<br />
the ExpFrame and TimerDialog classes were expected to do so.<br />
The TimerDialog class, which gets the log data from the database system, was first tested<br />
on the few events initially inserted into the EVENTS table. The other events were inserted step<br />
by step as described in section 6.3.<br />
6.3 Real Logfile Data<br />
Step by step more events were added to the EVENTS table i. e. to the filter and the LOGS table<br />
as well as to the TimerDialog class. For each new event the occurence in the logfiles and in<br />
the LOGS table was compared to the behaviour of the graphical user interface.<br />
As soon as a convenient set of events had been inserted, the graphical user interface was at<br />
the fellows’ disposal. This review, the staff to the MELODY project provided, was a great help<br />
uncovering the graphical user interface’s faults.<br />
According to the cease of trouble reports during the last fortnight the graphical user interface<br />
seems to be satisfactory stable.
Chapter 7<br />
Conclusions and Future Outlook<br />
The interest in this thesis shown by the staff of the MELODY project points to the fact that there<br />
is a need for a graphical user interface for studying the order of events in MELODY experiments.<br />
The graphical user interface has already been used for studying experiments while performing<br />
the write reported in [WBF01].<br />
The complexity mentioned in section 1.1 outcropped in the first phase of this thesis:<br />
The analysis of the logfile entries, due to the complexity and a lack of documentation, grew into<br />
a tailsome and time-consuming matter. The logfile entries’ pinpointed meaning, their sequence<br />
and interrelationship could be understood by analyzing the MELODY source code.<br />
The results led to the assumption that MELODY produces consistent log files sufficient for<br />
displaying the file assigner activities, the tasks’ live cycle and file access. This was verified by<br />
later phases.<br />
With the aquired knowledge the next phases, the database and graphical user interface design<br />
could progress more quickly:<br />
A selection of events, described in section 3.3.8, are enough to render the behaviour sufficing<br />
the goals (s. section 1.2) of this thesis. The graphical user interface achieves a clear picture of the<br />
file assigner activities, the tasks’ live cycle and file access. It is a topview showing every node,<br />
its files and tasks. Distinct icons and colors are used to distinguish public and private copies, the<br />
different file assigner decisions as well as the phases of the tasks’ live cycle. The criticality and<br />
sensitivity and the history of tasks are represented by colors. The file access and file assigner<br />
locks are visualized by colored lines and arrows. Information, which files a task accesses, is<br />
provided.<br />
Coherences beween the tasks’ file access and the changes in file distribution become comprehensible.<br />
In case the displayed information is too much and becomes confusing, in can be limited to the<br />
information of interest. Every particular node, every particular file and every particular task on<br />
each node. can easily be hidden. All file access and all file assigner locks can be disessembled.<br />
The number of events occuring in an experiment depends mainly on the number of tasks as<br />
well as on the experiment duration and varies between in and in . An average<br />
experiment produces roughly 500 events per second. In the fastest mode these 500 events can<br />
be displayed within one minute. So for longer experiments the above mentioned filter should be<br />
used, too.<br />
Future work will have to be done to keep the graphical user interface up to consecutive refinements<br />
to MELODY. Services of new versions of MELODY, e. g. the transactions in [Böh00] (a<br />
thesis overlapping in time with this thesis), ought to be displayed by the graphical user interface.
50 CONCLUSIONS AND FUTURE OUTLOOK<br />
Just so the MELODY services, currently not producing logfile data, should be made visual.<br />
These are e. g. the scheduler and the run-time integtration.<br />
MELODY requires a huge number of parameters: The initial file distribution, task configuration<br />
and the strategies for the MELODY services have got to be set. At present these parameters<br />
are adjusted in ASCII parameter-files. Great pains have to be taken over this fault-prone process.<br />
The graphical user interface should be upgraded to a control center for creating, configurating,<br />
running, analyzing, and removing experiments. If the parameters are set in an interactive<br />
user interface, inconsistencies can be prevented. Settings can be adopted from archieved experiments.<br />
Prepared experiments can automatically be run several times or at night-time. All told a<br />
control center like this would be a helpful extension to MELODY.
Used Software<br />
[1] DEZIGN FOR DATABASES V.2.2<br />
http://www.heraut.demon.nl/<br />
DEZIGN FOR DATABASES is a database design and maintenance tool for database designers<br />
and programmers.<br />
[2] JAVA DEVELOPMENT KIT version 1.1.7B<br />
http://java.sun.com/<br />
The Java Development Kit is a development environment for writing applets and applications<br />
that conform to the Java 1.1 Core API.<br />
http://java.sun.com/products/jdk/1.1/<br />
[3] MYSQL<br />
http://www.mysql.com/<br />
MYSQL is a relational database management system.<br />
http://www.mysql.com/downloads/<br />
[4] POSTGRESQL<br />
http://www.postgresql.org/<br />
POSTGRESQL is a sophisticated Object-Relational DBMS, supporting almost all SQL<br />
constructs, including subselects, transactions, and user-defined types and functions.<br />
ftp://ftp.de.postgresql.org/<br />
[5] S.U.S.E. LINUX 6.1<br />
http://www.suse.de/<br />
S.U.S.E. LINUX is a distribution of the LINUX operating system.<br />
ftp://ftp.suse.com/pub/suse/i386/6.1/<br />
[6] TOGETHER 4.1<br />
http://www.togethersoft.com/<br />
UML Modelling Tool<br />
http:://www.togethersoft.com/downloads/
Bibliography<br />
[AWCD00] David Axmark, Michael Widenius, Jeremy Cole, and Paul DuBois. MySQL Reference<br />
Manual. http://www.mysql.com/documentation/mysql/bychapter/, 2000.<br />
[Böh00] Sabine Böhm. Distributed transaction management in safety-critical systems. Master’s<br />
thesis, University of Dortmund, June 2000.<br />
[Dan92] Douglas C. Daniels. The Design and Analysis of Protocols for Distributed Resource<br />
Scheduling under Real-Time Constraints. PhD thesis, Wayne State University, Detroit,<br />
Michigan, June 1992.<br />
[DD97] C. J. Date and Hugh Darwen. A Guide to the SQL Standard. Addison-Wesley,<br />
Reading, Ma., 4. edition, 1997.<br />
[Fre99] Christian Frey. Entwurf und implementierung einer verteilten experimentierumgebung<br />
für resource-scheduling-algorithmen. Master’s thesis, Universität Dortmund,<br />
March 1999.<br />
[FvDFH92] James D. Foley, Andries van Damm, Steven K. Feiner, and John F. Hughes. Computer<br />
Graphics, principles and practice. Addision-Wesley Systems Programming<br />
Series. Addison-Wesley, Reading, Ma., 2. edition, 1992.<br />
[GK97] Mark Grand and Jonathan Knudsen. Java Fundamental Classes Reference. The<br />
Java Series. O’Reilly, Sebastopol, 1. edition, July 1997.<br />
[GMS94] Michel Goossens, Frank Mittelbach, and Alexander Samarin. Der LATEX Begleiter.<br />
Addison-Wesley (Deutschland), Bonn, 1. edition, 1994.<br />
[Lin99] Jon A. Lind. Realization of the Highly Integrated Distributed Real-Time Safety-<br />
Critical System Melody. PhD thesis, University of Dortmund, January 1999.<br />
[Mom00] Bruce Momjian. PostgreSQL: Introduction and Concepts. to be published by<br />
Addison-Wesley, version July 2000.<br />
[OW97] Scott Oaks and Henry Wong. Java Threads. The Java Series. O’Reilly, Sebastopol,<br />
1. edition, January 1997.<br />
[Pos00] The PostgreSQL Development Team. PostgreSQL online documentation and FAQs.<br />
http://www.de.postgresql.org/docs/, 2000.<br />
[Ree97] George Reese. Database Programming with JDBC and Java. The Java Series.<br />
O’Reilly, Sebastopol, 1. edition, June 1997.<br />
[SG94] Abraham Silberschatz and Peter B. Galvin. Operation System Concepts. World<br />
Student Series. Addison-Wesley, 4. edition, 1994.
54 BIBLIOGRAPHY<br />
[Sta96] Carsten Stange. Adaptives File Assignment in verteilten sicherheitskritischen Betriebssystemen.<br />
Master’s thesis, Universität Dortmund, August 1996.<br />
[vdL98] Peter van der Linden. Just Java and Beyond. Java Series. Sun Microsystems Press,<br />
Palo Alto, Ca., 3. edition, 1998.<br />
[WBF01] Horst F. Wedde, Sabine Böhm, and Wolfgang Freund. Adaptive protocols for survivability<br />
of transaction operation of replicated objects. submitted to the Sixth Int’l<br />
Workshop on Object-Orientated Real-Time Systems, Rome, Italy, January 2001.<br />
[WF00] Horst F. Wedde and Wolfgang Freund. Harmonious internal clock synchronization.<br />
In EUROMICRO Workshop on Real-Time-Systems 2000 (ERTS’00), pages 175 –<br />
182, Stockholm, Sweden, June 2000. Euromicro, IEEE Computer Society Press.<br />
[Win81] Józef Winkowski. Protocols of accessing overlaping sets of resources. Information<br />
Processing Letters, 12(5):239–243, October 1981.<br />
[WL97] Horst F. Wedde and Jon A. Lind. Building large, complex, distributed safety-critical<br />
systems. Real-Time Systems, 13(3):277–302, 1997.<br />
[WLS99] Horst F. Wedde, Jon Lind, and Guido Segbert. Distributed real-time task monitoring<br />
in the safety-critical system melody. In Proc. of the RTSS 99, 1999.<br />
[Zuk97] John Zukowski. Java AWT Reference. The Java Series. O’Reilly, Sebastopol, 1<br />
edition, January 1997.
Appendix A<br />
Database<br />
A.1 Creation<br />
1 /*************************************************************<br />
* create_db_melody.sql *<br />
* *<br />
* creates all tables functions, ... needed for melody *<br />
5 *************************************************************/<br />
/*************************************************************/<br />
CREATE TABLE USERS<br />
(<br />
10 UserID SMALLINT NOT NULL UNIQUE PRIMARY KEY,<br />
Name VARCHAR(30) NOT NULL UNIQUE,<br />
Description VARCHAR(80)<br />
);<br />
15 /* userOK(UserID)<br />
* -> 0: UserID does not exist<br />
* -> 1: UserID exists */<br />
CREATE FUNCTION userOk(SMALLINT)<br />
RETURNS INTEGER<br />
20 AS ’SELECT COUNT(UserID) FROM USERS WHERE UserID = $1;’<br />
LANGUAGE ’sql’;<br />
/* current_userID()<br />
* -> UserID of current user */<br />
25 CREATE FUNCTION current_userID()<br />
RETURNS SMALLINT<br />
AS ’SELECT UserID FROM USERS WHERE name = CURRENT_USER;’<br />
LANGUAGE ’sql’;<br />
30 /*************************************************************/<br />
CREATE TABLE NODES<br />
(<br />
NodeID SMALLINT NOT NULL UNIQUE PRIMARY KEY,<br />
Name VARCHAR(20) NOT NULL,<br />
35 Ok BOOLEAN NOT NULL DEFAULT TRUE<br />
);<br />
/* nodeOK(NodeID)
56 DATABASE<br />
* -> 0: NodeID does not exist<br />
40 * -> 1: NodeID exists */<br />
CREATE FUNCTION nodeOk(SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(NodeID) FROM NODES WHERE NodeID = $1;’<br />
LANGUAGE ’sql’;<br />
45<br />
/*************************************************************/<br />
CREATE TABLE EXPERIMENTS<br />
(<br />
ExpID INTEGER NOT NULL UNIQUE PRIMARY KEY,<br />
50 UserID SMALLINT NOT NULL CHECK (userOk(UserID) > 0)<br />
DEFAULT current_userId(),<br />
DateTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,<br />
Description VARCHAR(80)<br />
);<br />
55<br />
/* expOK(ExpID)<br />
* -> 0: ExpID does not exist<br />
* -> 1: ExpID exists */<br />
CREATE FUNCTION expOk(SMALLINT)<br />
60 RETURNS INTEGER<br />
AS ’SELECT COUNT(ExpID) FROM EXPERIMENTS WHERE ExpID = $1;’<br />
LANGUAGE ’sql’;<br />
/*************************************************************/<br />
65 CREATE TABLE NODES_IN_EXPERIMENT<br />
(<br />
ExpID INTEGER NOT NULL CHECK (expOk(ExpID) > 0),<br />
NodeID SMALLINT NOT NULL CHECK (nodeOk(NodeID) > 0)<br />
);<br />
70<br />
CREATE UNIQUE INDEX NODES_IN_EXP<br />
ON NODES_IN_EXPERIMENT (ExpID, NodeID);<br />
/* nodeInExp(ExpID, NodeID)<br />
75 * -> 0: node NodeID takes part in exp. ExpID<br />
* -> 1: node NodeID does not take part in exp. ExpID */<br />
CREATE FUNCTION nodeInExp(INTEGER, SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM NODES_IN_EXPERIMENT<br />
80 WHERE ExpID = $1 AND NodeID = $2;’<br />
LANGUAGE ’sql’;<br />
/*************************************************************/<br />
CREATE TABLE SCHINTEGRATION<br />
85 (<br />
SchIntegID SMALLINT NOT NULL PRIMARY KEY,<br />
Abr CHAR (1) NOT NULL,<br />
Description VARCHAR (50)<br />
);<br />
90<br />
/* schOk(SchIntegID)<br />
* -> 0: Scheduler integration type not defined<br />
* -> 1: Scheduler integration type defined */
A.1 Creation 57<br />
CREATE FUNCTION schOk(SMALLINT)<br />
95 RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM SCHINTEGRATION<br />
WHERE SchIntegID = $1;’<br />
LANGUAGE ’sql’;<br />
100 /*************************************************************/<br />
CREATE TABLE RTINTEGRATION<br />
(<br />
RTIntegID SMALLINT NOT NULL PRIMARY KEY,<br />
Abr CHAR (4) NOT NULL,<br />
105 Description VARCHAR (50)<br />
);<br />
/* rtiOk(RTIntegID)<br />
* -> 0: Run time integration type not defined<br />
110 * -> 1: Run time integration type defined */<br />
CREATE FUNCTION rtiOk(SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM RTINTEGRATION<br />
WHERE RTIntegID = $1;’<br />
115 LANGUAGE ’sql’;<br />
/*************************************************************/<br />
CREATE TABLE FAINTEGRATION<br />
(<br />
120 FAIntegID SMALLINT NOT NULL PRIMARY KEY,<br />
Abr CHAR (1) NOT NULL,<br />
Description VARCHAR (50)<br />
);<br />
125 /* faiOk(FAIntegID)<br />
* -> 0: File assigner integration type not defined<br />
* -> 1: File assigner integration type defined */<br />
CREATE FUNCTION faiOk(SMALLINT)<br />
RETURNS INTEGER<br />
130 AS ’SELECT COUNT(*) FROM FAINTEGRATION<br />
WHERE FAIntegID = $1;’<br />
LANGUAGE ’sql’;<br />
/*************************************************************/<br />
135 CREATE TABLE FILEMODELS<br />
(<br />
FileModelID SMALLINT NOT NULL PRIMARY KEY,<br />
Abr VARCHAR (7) NOT NULL,<br />
Description VARCHAR (50)<br />
140 );<br />
/* filemodelOk(FileModelID)<br />
* -> 0: File model not defined<br />
* -> 1: File model defined */<br />
145 CREATE FUNCTION filemodelOk(SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM FILEMODELS<br />
WHERE FileModelID = $1;’
58 DATABASE<br />
LANGUAGE ’sql’;<br />
150<br />
/*************************************************************/<br />
CREATE TABLE EXPERIMENT_PARAMS<br />
(<br />
ExpID INTEGER NOT NULL CHECK (ExpOK(ExpID) > 0),<br />
155 Critical SMALLINT NOT NULL DEFAULT 10,<br />
EssCritical SMALLINT NOT NULL DEFAULT 3,<br />
Sensitive SMALLINT NOT NULL DEFAULT 10,<br />
EssSensitive SMALLINT NOT NULL DEFAULT 5,<br />
SchIntegID SMALLINT NOT NULL DEFAULT 2<br />
160 CHECK (SchOk(SchIntegID) > 0),<br />
SchParams VARCHAR (20) NOT NULL DEFAULT ’(1|3,1,4)’,<br />
RTIntegID SMALLINT NOT NULL DEFAULT 3<br />
CHECK (RTIOk(RTIntegID) > 0),<br />
FAIntegID SMALLINT NOT NULL DEFAULT 2<br />
165 CHECK (FAIOk(FAIntegID) > 0),<br />
FAThNotUsed SMALLINT NOT NULL DEFAULT 0,<br />
FAThGetCopy SMALLINT NOT NULL DEFAULT 2,<br />
FAThAllowCopy SMALLINT NOT NULL DEFAULT 10,<br />
FAThReduceCopy SMALLINT NOT NULL DEFAULT 2,<br />
170 FAThDeleteCopy SMALLINT NOT NULL DEFAULT 2,<br />
FATryWait SMALLINT NOT NULL DEFAULT 400,<br />
FAChangeWait SMALLINT NOT NULL DEFAULT 1000,<br />
FAHistWindow SMALLINT NOT NULL DEFAULT 5000,<br />
FileModelID SMALLINT NOT NULL DEFAULT 1<br />
175 CHECK (filemodelOk(FileModelID) > 0),<br />
MinPublic SMALLINT NOT NULL DEFAULT 1,<br />
MaxPublic SMALLINT NOT NULL DEFAULT 7,<br />
ServerPrio SMALLINT NOT NULL DEFAULT 55,<br />
SyncMaster SMALLINT NOT NULL DEFAULT 4<br />
180 CHECK (NodeInExp(ExpID, SyncMaster) > 0)<br />
);<br />
/*************************************************************/<br />
CREATE TABLE FILES<br />
185 (<br />
ExpID INTEGER NOT NULL,<br />
FileID INTEGER NOT NULL,<br />
NodeID SMALLINT NOT NULL,<br />
Type CHAR(4) NOT NULL CHECK (Type IN (’PRIV’, ’PUB’)),<br />
190 Description VARCHAR(120),<br />
CHECK (nodeInExp(ExpID, NodeID) > 0)<br />
);<br />
CREATE UNIQUE INDEX FILES_IN_EXP ON FILES (ExpID, NodeID, FileID);<br />
195<br />
/* fileInExp(ExpID, FileID)<br />
* -> 0: file FileID takes part in exp. ExpID<br />
* -> 1: file FileID does not take part in exp. ExpID */<br />
CREATE FUNCTION fileInExp(INTEGER, SMALLINT)<br />
200 RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM FILES<br />
WHERE ExpID = $1 AND FileID = $2;’<br />
LANGUAGE ’sql’;
A.1 Creation 59<br />
205 /*************************************************************/<br />
CREATE TABLE TASKS<br />
(<br />
ExpID INTEGER NOT NULL,<br />
TaskID SMALLINT NOT NULL,<br />
210 NodeID SMALLINT NOT NULL,<br />
Criticality SMALLINT NOT NULL,<br />
Sensitivity SMALLINT NOT NULL,<br />
FileID SMALLINT NOT NULL,<br />
ReadWrite CHAR(1) NOT NULL CHECK (ReadWrite IN (’W’, ’R’)),<br />
215 CHECK (nodeInExp(ExpID, NodeID) > 0),<br />
CHECK (fileInExp(ExpID, FileID) > 0)<br />
);<br />
CREATE UNIQUE INDEX TASKS_IN_EXP ON TASKS (ExpID, NodeID, TaskID,<br />
220 FileID, ReadWrite);<br />
/* taskInExp(ExpID, TaskID, NodeID)<br />
* -> 0: file FileID takes part in exp. ExpID<br />
* -> 1: file FileID does not take part in exp. ExpID */<br />
225 CREATE FUNCTION taskInExp(INTEGER, SMALLINT, SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM TASKS<br />
WHERE ExpID = $1 AND TaskID = $2 AND NodeID = $3;’<br />
LANGUAGE ’sql’;<br />
230<br />
/*************************************************************/<br />
CREATE TABLE EVENTS<br />
(<br />
EventID SMALLINT NOT NULL UNIQUE PRIMARY KEY,<br />
235 Abr VARCHAR(30) UNIQUE NOT NULL,<br />
Description VARCHAR(80) NOT NULL,<br />
/* Information a log file parser needs */<br />
LogFilePattern VARCHAR(80) NOT NULL,<br />
LogFileType VARCHAR(12) NOT NULL,<br />
240 LogFileMulti BOOL NOT NULL,<br />
FileID BOOL NOT NULL,<br />
NodeID BOOL NOT NULL,<br />
PeerNodeID BOOL NOT NULL,<br />
TaskID BOOL NOT NULL,<br />
245 Instance BOOL NOT NULL,<br />
Criticality BOOL NOT NULL,<br />
Sensitivity BOOL NOT NULL,<br />
Data BOOL NOT NULL<br />
);<br />
250<br />
/* eventIDOk(EventID)<br />
* -> 0: EventID does not exist<br />
* -> 1: EventID exists */<br />
CREATE FUNCTION eventIDOk(SMALLINT)<br />
255 RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM EVENTS<br />
WHERE EventID = $1;’<br />
LANGUAGE ’sql’;
60 DATABASE<br />
260 /* fileIDMand(EventID)<br />
* -> 0: FileID entry is manadtory for EventID<br />
* -> 1: FileID entry is not allowed fot EventID */<br />
CREATE FUNCTION fileIDMand(SMALLINT)<br />
RETURNS INTEGER<br />
265 AS ’SELECT COUNT(*) FROM EVENTS WHERE EVENTID = $1<br />
AND FileID = TRUE’<br />
LANGUAGE ’sql’;<br />
/* nodeIDMand(EventID)<br />
270 * -> 0: NodeID entry is manadtory for EventID<br />
* -> 1: NodeID entry is not allowed fot EventID */<br />
CREATE FUNCTION nodeIDMand(SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM EVENTS WHERE EVENTID = $1<br />
275 AND NodeID = TRUE’<br />
LANGUAGE ’sql’;<br />
/* peerNodeIDMand(EventID)<br />
* -> 0: PeerNodeID entry is manadtory for EventID<br />
280 * -> 1: PeerNodeID entry is not allowed fot EventID */<br />
CREATE FUNCTION peerNodeIDMand(SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM EVENTS WHERE EVENTID = $1<br />
AND PeerNodeID = TRUE’<br />
285 LANGUAGE ’sql’;<br />
/* taskIDMand(EventID)<br />
* -> 0: TaskID entry is manadtory for EventID<br />
* -> 1: TaskID entry is not allowed fot EventID */<br />
290 CREATE FUNCTION taskIDMand(SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM EVENTS WHERE EVENTID = $1<br />
AND TaskID = TRUE’<br />
LANGUAGE ’sql’;<br />
295<br />
/* instanceMand(EventID)<br />
* -> 0: Instance entry is manadtory for EventID<br />
* -> 1: Instance entry is not allowed fot EventID */<br />
CREATE FUNCTION instanceMand(SMALLINT)<br />
300 RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM EVENTS WHERE EVENTID = $1<br />
AND Instance = TRUE’<br />
LANGUAGE ’sql’;<br />
305 /* critMand(EventID)<br />
* -> 0: Instance entry is manadtory for EventID<br />
* -> 1: Instance entry is not allowed fot EventID */<br />
CREATE FUNCTION critMand(SMALLINT)<br />
RETURNS INTEGER<br />
310 AS ’SELECT COUNT(*) FROM EVENTS WHERE EVENTID = $1<br />
AND Criticality = TRUE’<br />
LANGUAGE ’sql’;
A.1 Creation 61<br />
/* sensMand(EventID)<br />
315 * -> 0: Instance entry is manadtory for EventID<br />
* -> 1: Instance entry is not allowed fot EventID */<br />
CREATE FUNCTION sensMand(SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM EVENTS WHERE EVENTID = $1<br />
320 AND Sensitivity = TRUE’<br />
LANGUAGE ’sql’;<br />
/* dataMand(EventID)<br />
* -> 0: Instance entry is manadtory for EventID<br />
325 * -> 1: Instance entry is not allowed fot EventID */<br />
CREATE FUNCTION dataMand(SMALLINT)<br />
RETURNS INTEGER<br />
AS ’SELECT COUNT(*) FROM EVENTS WHERE EVENTID = $1<br />
AND Data = TRUE’<br />
330 LANGUAGE ’sql’;<br />
/*************************************************************/<br />
CREATE TABLE LOGS<br />
(<br />
335 ExpID INTEGER NOT NULL CHECK (expOk(ExpID) > 0),<br />
TimeStamp INTEGER NOT NULL,<br />
RealTimeStamp FLOAT NOT NULL,<br />
EventID SMALLINT NOT NULL CHECK (eventIDOk(EventID) > 0),<br />
FileID SMALLINT CHECK ((FileID IS NULL<br />
340 AND fileIDMand(EventID) = 0)<br />
OR (fileInExp(ExpID, FileID) > 0<br />
AND fileIDMand(EventID) > 0)),<br />
NodeID SMALLINT CHECK ((NodeID IS NULL<br />
AND nodeIDMand(EventID) = 0)<br />
345 OR (nodeInExp(ExpID, NodeID) > 0<br />
AND nodeIDMand(EventID) > 0)),<br />
PeerNodeID SMALLINT CHECK ((PeerNodeID IS NULL<br />
AND peerNodeIDMand(EventID) = 0)<br />
OR (nodeInExp(ExpID, PeerNodeID) > 0<br />
350 AND peerNodeIDMand(EventID) > 0)),<br />
TaskId SMALLINT CHECK ( (TaskID IS NULL<br />
AND taskIDMand(EventID) = 0)<br />
OR ((taskInExp(ExpID, TaskID, NodeID) > 0<br />
OR taskInExp(ExpID, TaskID,<br />
355 PeerNodeID) > 0)<br />
AND taskIDMand(EventID) > 0) ),<br />
Instance INTEGER CHECK ((Instance IS NULL<br />
AND instanceMand(EventID) = 0)<br />
OR instanceMand(EventID) > 0),<br />
360 Criticality SMALLINT CHECK ((Criticality IS NULL<br />
AND critMand(EventID) = 0)<br />
OR critMand(EventID) > 0),<br />
Sensitivity SMALLINT CHECK ((sensitivity IS NULL<br />
AND sensMand(EventID) = 0)<br />
365 OR sensMand(EventID) > 0),<br />
Data INTEGER CHECK ((Data IS NULL<br />
AND dataMand(EventID) = 0)<br />
OR dataMand(EventID) > 0)
62 DATABASE<br />
370<br />
);<br />
CREATE INDEX TimeInExp ON LOGS (ExpID,TimeStamp);<br />
/*************************************************************<br />
* the following functions are for inserting new experiemnts *<br />
375 * and are used by the logfile filter *<br />
*************************************************************/<br />
/* maxExpID()<br />
* -> returns the max expID in experiments<br />
380 * (has side effects unless used prior newExp) */<br />
CREATE FUNCTION maxExpID()<br />
RETURNS INTEGER<br />
AS ’DELETE FROM EXPERIMENTS WHERE ExpID = 0;<br />
INSERT INTO EXPERIMENTS (ExpID) VALUES (0);<br />
385 SELECT MAX(ExpID) FROM EXPERIMENTS;’<br />
LANGUAGE ’sql’;<br />
/* Inserts a new Experiment into table experiments<br />
* newExpID(Description)<br />
390 * -> returns the new ExpID */<br />
CREATE FUNCTION newExp(VARCHAR)<br />
RETURNS INTEGER<br />
AS ’INSERT INTO EXPERIMENTS (ExpID, Description)<br />
VALUES (maxExpID()+1, $1);<br />
395 DELETE FROM EXPERIMENTS WHERE ExpID = 0;<br />
SELECT MAX(ExpID) FROM EXPERIMENTS;’<br />
LANGUAGE ’sql’;<br />
/* Inserts a new Experiment into table experiments<br />
400 * newExpID(Description, UserID, Timestamp)<br />
* -> returns the new ExpID */<br />
CREATE FUNCTION newExp(VARCHAR, SMALLINT, TIMESTAMP)<br />
RETURNS INTEGER<br />
AS ’INSERT INTO EXPERIMENTS<br />
405 (ExpID, Description, UserId, DateTime)<br />
VALUES (maxExpID()+1, $1, $2, $3);<br />
DELETE FROM EXPERIMENTS WHERE ExpID = 0;<br />
SELECT MAX(ExpID) FROM EXPERIMENTS;’<br />
LANGUAGE ’sql’;<br />
410 /* Deletes an Experiment completely */<br />
* deleteExp(ExpID)<br />
* -> alway returns 0 */<br />
CREATE FUNCTION deleteExp(INTEGER)<br />
RETURNS INTEGER<br />
415 AS ’DELETE FROM LOGS WHERE ExpID = $1;<br />
DELETE FROM TASKS WHERE ExpID = $1;<br />
DELETE FROM FILES WHERE ExpID = $1;<br />
DELETE FROM NODES_IN_EXPERIMENT WHERE ExpID = $1;<br />
DELETE FROM EXPERIMENTS WHERE ExpID = $1;<br />
420 SELECT 0 AS OK;’<br />
LANGUAGE ’sql’;
A.2 Events table 63<br />
A.2 Events table<br />
1 DELETE FROM EVENTS;<br />
INSERT INTO EVENTS VALUES (1100, ’GetPublic’,<br />
’local decision to try to create a local public copy’,<br />
5 ’GET PUBLIC COPY%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1101, ’RemovePublicLocal’,<br />
’local decision to try to create a local public copy’,<br />
’REMOVE PUBLIC COPY LOCAL%’, ’moving’, FALSE,<br />
10 TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1102, ’RemovePublicRemote’,<br />
’local decision to try to remove a local public copy’,<br />
’REMOVE PRIVATE COPY REMOTE%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
15 INSERT INTO EVENTS VALUES (1103, ’RemoveEmergencyPublic’,<br />
’local emergency decision to remove a remote public copy’,<br />
’EMERGNCY PUBLIC%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1104, ’GetPrivate’,<br />
20 ’local decision to create a local private copy’,<br />
’GET PRIVATE COPY%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1105, ’GetEmergencyPrivate’,<br />
’local emergency decision to create a local private copy’,<br />
25 ’EMERGNCY PRIVATE COPY%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1106, ’RemovePrivate’,<br />
’local decision to remove a local private copy’,<br />
’REMOVE PRIVATE COPY LOCAL%’, ’moving’, FALSE,<br />
30 TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1110, ’LockDenied’,<br />
’remote file assigner denied lock’,<br />
’LOCK DENIED%’, ’moving’, FALSE,<br />
TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
35 INSERT INTO EVENTS VALUES (1111, ’LockGranted’,<br />
’remote file assigner granted lock’,<br />
’LOCK GRANTED%’, ’moving’, FALSE,<br />
TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1112, ’LockWinnerDeny’,<br />
40 ’all remote fa granted locks but refuse the requested action’,<br />
’REQUEST DENIED HISTORY%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1113, ’LockWinnerMove’,<br />
’all remote f a granted lock, at least one allows<br />
to move his copy’,<br />
45 ’MOVING PUBLIC FROM%’, ’moving’, FALSE,<br />
TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1114, ’LockWinnerCopy’,<br />
’all remote fa granted lock and allow to create<br />
a new copy’,<br />
’GETTING PUBLIC FROM%’, ’moving’, FALSE,<br />
50 TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);
64 DATABASE<br />
INSERT INTO EVENTS VALUES (1115, ’LockWinnerDelete’,<br />
’all remote fa granted lock, one allows<br />
to delete his copy’,<br />
’REMOVING PUBLIC AT%’, ’moving’, FALSE,<br />
TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
55 INSERT INTO EVENTS VALUES (1116, ’LockWinnerEmergencyRemovePublic’,<br />
’all remote file assigners granted lock to remove a public<br />
copy’,<br />
’EMERGNCY PUBLIC FROM%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1117, ’LockRelease’,<br />
60 ’release lock at remote file assigner’,<br />
’LOCK PUBLIC RECEIVE WRITE/ASSIGN%’, ’moving’, FALSE,<br />
TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1200, ’CreatePrivateCopy’,<br />
’start creating a private copy’,<br />
65 ’CREATE PRIVATE COPY%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1201, ’CreatePublicCopy’,<br />
’start creating a public copy’,<br />
’CREATE PUBLIC COPY%’, ’moving’, TRUE,<br />
70 TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1202, ’ChangePrivatePublicCopy’,<br />
’start creating a public copy out of private one’,<br />
’CHANGING PRIVATE COPY%’, ’moving’, TRUE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
75 INSERT INTO EVENTS VALUES (1203, ’DeletePrivateCopy’,<br />
’start deleteing a private copy’,<br />
’DELETE PRIVATE COPY%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1204, ’DeletePublicCopy’,<br />
80 ’start deleting a public copy’,<br />
’DELETE PUBLIC COPY%’, ’moving’, TRUE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1205, ’ActivePublicCopy’,<br />
’public copy created’,<br />
85 ’ACTIVE PUBLIC COPY%’, ’moving’, TRUE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1206, ’ActiveShadowCopy’,<br />
’shadow copy created’,<br />
’ACTIVATE SHADOW COPY%’, ’update’, FALSE,<br />
90 TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1207, ’ActivePrivateCopy’,<br />
’private copy created’,<br />
’ACTIVE PRIVATE COPY%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
95 INSERT INTO EVENTS VALUES (1208, ’DeactivePublicCopy’,<br />
’public copy deleted’,<br />
’DEACTIVE PUBLIC COPY%’, ’moving’, TRUE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1209, ’DeactivePrivateCopy’,<br />
100 ’private copy deleted’,<br />
’DEACTIVE PRIVATE COPY%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1300, ’RequestDataCopy’,
A.2 Events table 65<br />
’ask foreign node to send a copy’,<br />
105 ’REQUEST DATA COPY%’, ’moving’, FALSE,<br />
TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1301, ’ReceivePublicCopy’,<br />
’start receiving a public copy’,<br />
’RECEIVE COPY PUBLIC%’, ’moving’, FALSE,<br />
110 TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (1302, ’ReceivePrivateCopy’,<br />
’start receiving a private copy’,<br />
’RECEIVE COPY PRIVAT%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
115 INSERT INTO EVENTS VALUES (1303, ’ReceiveCopyLength’,<br />
’receive length of data copy’,<br />
’RECEIVE COPY LENGTH%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE);<br />
INSERT INTO EVENTS VALUES (1304, ’ReceiveDataPortion’,<br />
120 ’receive a portin of data’,<br />
’RECEIVE DATA PORTIO%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE);<br />
INSERT INTO EVENTS VALUES (1305, ’ReceiveCopyComplete’,<br />
’receive length of data copy’,<br />
125 ’RECEIVE COPY COMPLE%’, ’moving’, FALSE,<br />
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);<br />
/* TASKS */<br />
INSERT INTO EVENTS VALUES (2000, ’InstanceArrival’,<br />
130 ’task instance has arrived’,<br />
’INSTANCE ARRIVA%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2001, ’SchedulePhase’,<br />
’beginning of schedule phase’,<br />
135 ’BEGINNING SCHED%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE);<br />
INSERT INTO EVENTS VALUES (2002, ’Scheduled’,<br />
’end of schedule phase’,<br />
’SCHEDULED%’, ’access’, FALSE,<br />
140 FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2003, ’LocationPhase’,<br />
’beginning of location phase’,<br />
’BEGINNING LOCAT%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
145 INSERT INTO EVENTS VALUES (2004, ’LocatedFile’,<br />
’found file on node’,<br />
’LOCATED FILE%’, ’access’, FALSE,<br />
TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2005, ’AquisionPhase’,<br />
150 ’beginning of aquision phase’,<br />
’BEGINNING AQUIS%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2006, ’AllocationSubPhase’,<br />
’beginning of allocation phase (write tasks only)’,<br />
155 ’BEGINNING ALLOC%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2007, ’ReadyFile’,<br />
’file on node ready (write tasks only’,
66 DATABASE<br />
’READY FILE%’, ’access’, FALSE,<br />
160 TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2008, ’LockingSubPhase’,<br />
’beginning of locking phase (write tasks only)’,<br />
’BEGINNING LOCKI%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
165 INSERT INTO EVENTS VALUES (2009, ’LockedFile’,<br />
’file on node locked’,<br />
’LOCKED FILE%’, ’access’, FALSE,<br />
TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2010, ’ComputationPhase’,<br />
170 ’beginning of computation phase’,<br />
’BEGINNING COMPU%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2011, ’Reading’,<br />
’task instance is reading file’,<br />
175 ’%READING%’, ’update’, FALSE,<br />
TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2012, ’Succeeding’,<br />
’task instance was successful’,<br />
’SUCCEEDING%’, ’access’, FALSE,<br />
180 FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2013, ’Aborting’,<br />
’decision to abort task instance’,<br />
’ABORTING%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
185 INSERT INTO EVENTS VALUES (2020, ’Failing’,<br />
’task instance failed to access files’,<br />
’ABORTING%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2014, ’ReleasePhase’,<br />
190 ’beginning of release phase’,<br />
’BEGINNING RELEA%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2015, ’ReleaseFile’,<br />
’task instance released locked file’,<br />
195 ’%- RELEASE%’, ’access’, FALSE,<br />
TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2015, ’ReleaseFile’,<br />
’task instance released locked file’,<br />
’%- RELEASE%’, ’access’, FALSE,<br />
200 TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2016, ’Success’,<br />
’task instance released locked files’,<br />
’SUCCESS%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
205 INSERT INTO EVENTS VALUES (2017, ’Failed’,<br />
’task instance released locked files’,<br />
’FAILED%’, ’access’, FALSE,<br />
FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2018, ’Writing’,<br />
210 ’task instance writes on file’,<br />
’%WRITING%’, ’update’, FALSE,<br />
TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);<br />
INSERT INTO EVENTS VALUES (2019, ’GiveBackLock’,
A.2 Events table 67<br />
’task instance gives back file lock’,<br />
215 ’GIVEBACK%’, ’access’, FALSE,<br />
TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);
Appendix B<br />
Source Code and Installation<br />
All practical work has been done on salbei.cs.uni-dortmund.de. The source is found<br />
in the folder /home/melody/gui/source.<br />
The class files have been generated by compiling the ExpSelect.java file. All class files<br />
have been packed into a Java archive file /home/melody/lib/fagui.jar. The gif files<br />
used by the graphical user interface live in /home/melody/lib/gifs/.<br />
The shell script GUI run that starts the graphical user interface is found in<br />
/home/melody/lib/bin/.<br />
1 #!/bin/tcsh<br />
5<br />
# add the postgres driver to CLASSPATH<br />
setenv CLASSPATH /usr/lib/pgsql/lib/postgresql.jar:$CLASSPATH<br />
# add the program classes to CLASSPATH<br />
setenv CLASSPATH /home/melody/gui/lib/fagui.jar:$CLASSPATH<br />
#"jdbc.drivers" selects the jdbc driver<br />
10 #"melody.gifspath" points folder with the required gif files<br />
java -Djdbc.drivers=postgresql.Driver<br />
-Dmelody.gifspath=/home/melody/gui/lib/gifs/ ExpSelect
Appendix C<br />
Sample Pictures<br />
The pictures on the next two pages give an impression of the graphical user interface.<br />
The interesting points are:<br />
FILE25@maia<br />
The picture on the next page shows the file assigner client has decided to create a local<br />
public copy. On the next but one page the file assigner client has won the file assigner lock<br />
shown by the pink arrow and is allowed to move a copy. The transfer has already begun<br />
indicated by the blue line and the half-filled icon.<br />
FILE20@titano<br />
The file assigner client has decided to remove his local copy. The file assigner lock has<br />
been granted by the file assigner server on titano, while the file assigner client is still<br />
waiting for a response from plateo.<br />
TASK1@titano<br />
On the next but one page this task is in its locking subphase. FILE20@titano is still ready<br />
while FILE20@plateo is already locked.<br />
TASK25@maia, TASK27@maia<br />
On the next but one page the last two instances of TASK25 have failed, the last two instaces<br />
of TASK27 have succeeded. This is indicated by the two red resp. green dots. The yellow<br />
dots underneath them show that all these instances have been critical and sensitive.