- Add the Shutdown Service API documentation.

- Improve the BulkImport API documentation.
- Fix markdown in README.
- Update the app's version.
This commit is contained in:
Lampros Smyrnaios 2023-06-06 16:18:38 +03:00
parent 54685bbe9a
commit 5d99a4be5d
2 changed files with 20 additions and 9 deletions

View File

@ -9,25 +9,36 @@ For interacting with the database we use [Impala](https://impala.apache.org/).<b
<br>
**BulkImport API**:
- "**bulkImportFullTexts**" endpoint: **http://\<IP\>:<PORT>/api/bulkImportFullTexts?provenance=\<provenance\>&bulkImportDir=\<bulkImportDir\>&shouldDeleteFilesOnFinish={true|false}** <br>
This endpoint loads the right configuration with the help of the "provenance" param and then processes the full-texts files inside the given directory, in the following way: it generates the openAireIDs, uploads the files to the S3 ObjectStore, generates and stores the the "payload" records in the database. If it is specified, it removes the successfully imported full-texts from the directory.
- "**getBulkImportReport**" endpoint: **http://\<IP\>:<PORT>/api/getBulkImportReport?id=\<bulkImportReportId\>** <br>
This endpoint returns the bulkImport report, which corresponds to the given ID, in JSON format.
- "**bulkImportFullTexts**" endpoint: **http://\<IP\>:\<PORT\>/api/bulkImportFullTexts?provenance=\<provenance\>&bulkImportDir=\<bulkImportDir\>&shouldDeleteFilesOnFinish={true|false}** <br>
This endpoint loads the right configuration with the help of the "provenance" parameter, delegates the processing to a background thread and returns a message with useful information, including the "reportFileID", which can be used at any moment to request a report about the progress of the bulk-import procedure.
The processing job starts running after 30-60 minutes and processes the full-texts files inside the given directory, in the following way: it generates the OpenAIRE-IDs, uploads the files to the S3 Object Store, generates and stores the "payload" records in the database. If it is specified, it removes the successfully imported full-texts from the directory.
- "**getBulkImportReport**" endpoint: **http://\<IP\>:\<PORT\>/api/getBulkImportReport?id=\<reportFileID\>** <br>
This endpoint returns the bulkImport report, which corresponds to the given reportFileID, in JSON format.
<br>
<br>
**Statistics API**:
- "**getNumberOfAllPayloads**" endpoint: **http://\<IP\>:<PORT>/api/stats/getNumberOfAllPayloads** <br>
- "**getNumberOfAllPayloads**" endpoint: **http://\<IP\>:\<PORT\>/api/stats/getNumberOfAllPayloads** <br>
This endpoint returns the total number of payloads existing in the database, independently of the way they were aggregated. This includes the payloads created by other pieces of software, before the PDF-Aggregation-Service was created.
- "**getNumberOfPayloadsAggregatedByService**" endpoint: **http://\<IP\>:<PORT>/api/stats/getNumberOfPayloadsAggregatedByService** <br>
- "**getNumberOfPayloadsAggregatedByService**" endpoint: **http://\<IP\>:\<PORT\>/api/stats/getNumberOfPayloadsAggregatedByService** <br>
This endpoint returns the number of payloads aggregated by the PDF-Aggregated-Service itself. It excludes the payloads aggregated by other methods, by applying a Date-filter for the records created in 2021 or later.
- "**getNumberOfPayloadsForDatasource**" endpoint: **http://\<IP\>:<PORT>/api/stats/getNumberOfPayloadsForDatasource?datasourceId=\<givenDatasourceId\>** <br>
- "**getNumberOfPayloadsForDatasource**" endpoint: **http://\<IP\>:\<PORT\>/api/stats/getNumberOfPayloadsForDatasource?datasourceId=\<givenDatasourceId\>** <br>
This endpoint returns the number of payloads which belong to the datasource specified by the given datasourceID.
- "**getNumberOfRecordsInspected**" endpoint: **http://\<IP\>:<PORT>/api/stats/getNumberOfRecordsInspected** <br>
- "**getNumberOfRecordsInspected**" endpoint: **http://\<IP\>:\<PORT\>/api/stats/getNumberOfRecordsInspected** <br>
This endpoint returns the number of records inspected by the PDF-Aggregation-Service.
<br>
<br>
**Shutdown Service API**:
- "**shutdownService**" endpoint: **http://\<IP\>:\<PORT\>/api/shutdownService** <br>
This endpoint sends "shutdownWorker" requests to all the Workers which are actively participating in the Service. The Workers will shut down after finishing their work-in-progress and all full-texts have been either transferred to the Controller or deleted, in case an error has appeared.<br>
Once the Workers are about to shut down, they send a "shutdownReport" to the Controller. A scheduling task runs in the Controller, every 2 hours, and if the user has specified that the Controller must shut down and all the Workers participating in the Service have shutdown, then it gently shuts down the Controller.
- "**cancelShutdownService**" endpoint: **http://\<IP\>:\<PORT\>/api/cancelShutdownService** <br>
This endpoint specifies that the Controller will not shut down, and sends "cancelShutdownWorker" requests to all the Workers which are actively participating in the Service (have not shut down yet), so that they can continue to request assignments.
<br>
<br>
**To install and run the application**:
- Run ```git clone``` and then ```cd UrlsController```.
- Set the preferable values inside the [__application.yml__](https://code-repo.d4science.org/lsmyrnaios/UrlsController/src/branch/master/src/main/resources/application.yml) file.

View File

@ -5,7 +5,7 @@ plugins {
}
group = 'eu.openaire.urls_controller'
version = '1.0.0-SNAPSHOT'
version = '2.1.0-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {