Skip to content
Snippets Groups Projects
Conventions.md 2.63 KiB
Newer Older
Armin Costa's avatar
Armin Costa committed
# Conventions #
 
 
Armin Costa's avatar
Armin Costa committed
## Logical directory hierarchy ##
 
Armin Costa's avatar
Armin Costa committed
The DES starts it's operations (eg. <FileType> filtering) considering a logical hierachy of directories starting form a given BASE_PATH that 
Armin Costa's avatar
Armin Costa committed
reflects the configuration within a given processor configuration file.

Armin Costa's avatar
Armin Costa committed
The directories, if not already present, are created automatically with the following structure:
Armin Costa's avatar
Armin Costa committed
```
$BASE_PATH/$AOI/$PROCESSOR
```
Armin Costa's avatar
Armin Costa committed
 
 
 
## FileType filtering ##
 
Armin Costa's avatar
Armin Costa committed
The files to be handled by a give *Task* or that are used for a given *Task* triggering, are filtered by regular expressions defined in the *FileType* tag of the *Task*
Armin Costa's avatar
Armin Costa committed

Files are detected by the *FileType* filtering IFF:
- No stamp file exists (eg. yourfile.txt.stamp) in the path defined by *STAMPS_PATH/$PROCESSOR*
Armin Costa's avatar
Armin Costa committed
- An equivalend .md5 file exists in the logical directory hierarchy (ex.yourfile.txt.md5), unless the tag *MD5Filter* is set explicitly to value *false* 
Armin Costa's avatar
Armin Costa committed
Stamp files are used to track that a file has already been processed by a given Task.
Armin Costa's avatar
Armin Costa committed
IFF a given *Task* returns either *EXIT_SUCESS* (0) or *EXIT_WARNING* (1), the DES will create a corresponding stamp file for the file processed.
Armin Costa's avatar
Armin Costa committed

IF a given *Task* does not comply to the *EXIT_CODES* defined above, the *Task* implementation, upon completion,
Armin Costa's avatar
Armin Costa committed
should therefore either delete the input file and it's equivalent md5, and if necessary, to avoid a reprocessing of a given file, 
create a corresponding stamp file in *STAMPS_PATH/$PROCESSOR* directory
Armin Costa's avatar
Armin Costa committed
 
 
 
## Stamp files ##
 
A Stamp file is an empty file that is created iff a given Task has been completed for a given input file filtered by a *FileType* expression.
In presence of a stamp file a subsequent *FileType* filtering will not detect the file that has an equivalent stamp file.

Stamp files are stored in the directory specified by *STAMPS_PATH/$PROCESSOR*

Stamp files have the following naming convention:
```
[PUSH | GET | TASK]_[Consumer name | Task name]_[Procesor name]_[AOI name]_[File name].stamp
```
 
Example:
```
Armin Costa's avatar
Armin Costa committed
TASK_createMap_EURAC_RADBEAM_P_southtyrol_TREURAC_RADBEAM_P.southtyrol.demST25m.year.2017.2018-06-19T16:45:00.Eurac.01.00.trigger.stamp
Armin Costa's avatar
Armin Costa committed
```
Armin Costa's avatar
Armin Costa committed
 
 
 
## Exit Codes ##

The *Task* entities registered within a *Processor* definition  should use the following ExitCodes when returning from execution 
Armin Costa's avatar
Armin Costa committed

Armin Costa's avatar
Armin Costa committed
```
EXIT_NONE = -999; // No files are available in the DES task pipeline
EXIT_SUCESS = 0;
EXIT_WARNING = 1; //1 - 127
EXIT_ERROR = -1;
EXIT_ERROR_SHELL = 255; // Shell scripts that exit -1 are converted to 255
EXIT_NOPROC = -666; // Task was executed but, either did not any job at all, OR the Task plugin did skip the files 
EXIT_MISSING_PARAM = 2; // Task did not receive all or valid parameters
```
Armin Costa's avatar
Armin Costa committed