Skip to content
Snippets Groups Projects
Commit 2efa298f authored by Martin Weise's avatar Martin Weise
Browse files

fixed AMQP queues and display more information in front-end

Former-commit-id: fa4f4e8f
parent db6f553a
Branches
Tags
1 merge request!42Fixed the query service tests
Showing
with 39 additions and 3986 deletions
(apply,CacheStats{hitCount=1574, missCount=1272, loadSuccessCount=1272, loadExceptionCount=0, totalLoadTime=2527581017, evictionCount=0})
(tree,CacheStats{hitCount=10217, missCount=7686, loadSuccessCount=7596, loadExceptionCount=0, totalLoadTime=8213136503, evictionCount=0})
(commit,CacheStats{hitCount=694, missCount=643, loadSuccessCount=643, loadExceptionCount=0, totalLoadTime=275826606, evictionCount=0})
(tag,CacheStats{hitCount=0, missCount=0, loadSuccessCount=0, loadExceptionCount=0, totalLoadTime=0, evictionCount=0})
713ab2c7f0039e2ecd0cd2c899b91b1e2fbf62ac 106380411 aka_name.csv
242cac8f2a5a4d59291064cf62c8106ba060a04f 2529221849 cast_info.csv
36c1c267d202b557c6703d389173d8e15975e87b 298218895 char_name.csv
2a74b7a473f8858cb9a0867bd372946797215635 174324333 movie_companies.csv
82b36a37a56bab39199dedd850ef7117b11f0faa 1892370889 movie_info.csv
21a98633c1d8f6f7626c70704330c6a5a9f6b4d2 157586033 movie_keyword.csv
69a94c856734b0bda8f4fa25d69012062733c288 493025835 name.csv
d0df73492030d86391383efe0e0148581fa55ffe 624932135 person_info.csv
396cf5134f8c735cc6922f999baf1b41dc9896a6 378724398 title.csv
01f7a2803c5fdfefdbfa01edc09739a14c8f0564 d811aeae5c6e972c5773a3b38298aaad671b380d
07a1ea416e14e593073c0942daf33a860cbdffaa c4a23e8413a4708f4d4a4e9924574cd69f4fe346
0a1e789c983cb6161a04d3dd0f65bf346d9231ac adcd02ed4db785e3a2032540a03b70117bac680e
1290a8526bf0d29ebb8d92aa9fd95c3ba9b9f343 154f70c8a2a386e9a72a9c547d23f46d0906b976
1c06e71693f91f82a36be520f15365108015373f 73242f538ccf8a3a2796a2faee84379e435e6fc7
266c887cc238c0925faf0c72d462ba9cc45c3e8a 57046d390e7b6f4b3b2f4ec159b79cdfed4d054e
2a38c1926f91be33e97e3eec76e388510e64e266 b3c4b4f3088c9cc93800214d6b7ca12ca047568c
2dabb816895a27ca0743f5f8e8c1101d3b8dcb08 656584a4448303e7d81a5b823236c25837380bc1
363247098804ff488d67632bd08474d091198e1b 431146c1baa01e2ea43ec75abcb66e0bf76374c5
380e13149da2e7d2a7edbbe61dcdd1e547fc694c 191aca0d1327390278c473ab75abd491f9595a14
3df556047077b8d5203aa735bc21910f2906ae47 ae1df518e74fb8defc8a5f51bba3eee3ac454199
3fd9889a029ba07548b8ac3eed6decabba2e10c9 821f60346e17f068bcae7bb7ef908bb2d7963926
41e1b000cdd099a0e7430994d668e98b1ea7c884 db3f6c5f874c117e21e8f0efad6a507d2872af3d
421ab3ac9117a37b837b828ae6e8d032a4947eb4 cbf8df32dca0c908c320dd34a45beafd66b2ba9c
45bc23ba952cdc27b6efd370807ffed5be6d90d0 c38dc0595f5d785c7145442b87bee113beda15ba
49b8033c7b968bf11a68c327ebaecff5db0a0d0f 3703544050b558145737d457bf72a83dcfe90681
548c600e994992e711e135d9dac36715e694b380 c7aa4d4ea0879e0fa3603617a99fcfc282694779
55c3f824cb475393656dcaa062097ba72d99591f 22726084457e9e0952a9198654b560f107d98298
571536b60611080dbded72fe6bf481873a8594e7 4094d13e9843af7a19937cb719588c473b777a71
5ba239e1858579d9429ed0e94ed4bd677c396ce5 d19a1afff789b84f3dbd8d72282ba73fb5e951b7
5bd030217d2a0976aa35533143548c99aac82b7e c915bb5a8270a90ed37d4ca44f7251ba554e3318
6203b43a591478433ff5bed33f32a13e83a363d8 0e836c3e726ea25a37ec4e827830109b9c60dad8
696354ea54b0e5c160297b0847861174e2a1bb0a 0cb58a4c37fb9434272ddce731f721605027875a
6b6cd6e918b3ea0551ed2f7a9c92614b9237d2c4 e376062a266bb992b9fb840210df331ea608a9f5
708197bb312d853c9d411c461685e64989432379 d40684218665fa7dd7d73556ce2ddd39a0624ece
741c529527b8453a32fb5c643e7bcbe66e1f117d 0f3e7f98f61cd66f10c22f5b4ed616f0fdf9758c
74d8f867e461d6cb9e09d81f560c880c3451a1f4 960c26665f54a3ef6bc307036005e80f603b2c05
74e81552f4ef2d661f1d799bc2e53df725b85369 4393eb9ef4ee08e15b2bbd13b5e3b2ea6373f65d
85e8b142204b292a6d4c3947e22e24fcbcec9410 2ffce12bfd18acfef8cb041be0880e0735327252
88f1e5b3d8672857e738f7d0c055b6da09f0d08a 613bfca533ea1364d2f1108e7f252ce6d2aed6f7
8ce51034caed0e998965e71c5421d0063ace7ee8 53d838c97b640bc51804796b22492093565b6f52
906687de42f004a3c153784e25258f2f52f902c9 9641ecb3603ece6c9d07b3c003212b81a02ed519
913d821625bb393656e6b2f68956452076b3d58b bd1e2b8d5bc01fd56f571a75ddd6f21c58c41959
9521053e5f7cc57b91230b7dab30eab2785b1f3e 72cd31ea64214db9a423b6f89c67cfa25bd33dca
99b12e8e1e78e1762fc072af713a2973f07f65b3 3106fa7446a10804da9af072e4734a542f1397f4
9a5d90cac33f4966b7ea8d8e6ef07f7c45f49089 cf77fed7fb0f4e7f8e72430d2cdf88d4a0147221
9f0508baec1b3cec8009df73ce50a48388762ccb ed645483cec084585281d65db20f17ea5737b11e
af8713c7866108018304183bf5516b32eff0e652 1de118cafd43ce9c5966f587f533ecbd674b3300
af9c693357d353af801551f88af477c83c4e83e7 10d8182e87d65d9928679356578be37125df88cd
b414e8e2eeddb73938c14faf26b6a8187c6c51be f7b8599e63a15751377a0248354ec3f89232bce4
b432585b60f78fe5435ce0ba5e798a4282027038 c4535b4e0ed74cc8e2aeb2c9431e4c8deef2bb24
bed8daed700c843ec37d7e27964ee55add391525 8e9c4d62f4dc47516bbbf7fd9bc3abd147b1197a
bfe6157904436c1053893451e2ec5ceede12dbdf 401c163d77f9b352f9266e5169e5c8e7e7529e1f
c052b5ce020e2bc5f99d23877edc0122c8697ce1 12e5d65b168cb2ef79692519a540b584f5845bc7
c789e5eadec340c51de91fe200a545575a7c3ed5 0e5a09d9811fdb10353b1fd3486d3ae0b9d0357b
c9682baa6aaab358b00372cfb008aa7dc1c9a470 1081d9fc7e12371e90497e26d986ea80f1ea16b3
ca12bcf32b9a614ec9afb7fab5e9257849613a96 e6c41b811d8aa127ba0ec67c4c4a3886d0ed5427
cfa2875338eabd63e83e39a1c1afbd15a7d4c71d 9816feeb775e49a8b137ad92e5a3610232179593
d7c1e6bf009e99f772383dc71a0bf00335a5b68f 8165733e01ae4160365586dcfa4842950735fc01
d8e77694d4089508fd8e39a3ab376f413fde3d3e 57fdb2540b6ddee2bf2f2d44b5bab7e9569e0f2e
dcea4701d6b3cf2e294f84eb02d40704d79866cb 473e0f58d0d6e7eb2ab08f50a5cd6366b2405709
e2a69bf7b60d4bbccd31da27abb3e9eb769e6b22 72e40f973727b9e807465f133b7e97425de18ecb
ed76fbb5c6582e3f268ad5ea11052dee07de7517 9cb8bbd6726be058a722e4130de48b4e75fc4976
effda608dc9e429e6166927b9c29a9cee675219c a96c58b7b416d89e4c8d2a209a6ef5aee9174a93
f1fa1f90a8db3be9a156f4cb6cb8566e5ecc1f4f 2a67e4a6d344b912c440d5cb5d1d3b4836a0b3cb
f2ea4dba45063b41002b18d4319472109e92561b 45a8a6045af0de4b9fa878970d2140fc26f5e8d4
fab5cb5803d1fe4f2830b3ee81c493d4daf76a97 31a66d5abc5700c22cc01cef4e3a0b695c419c42
(apply,CacheStats{hitCount=903, missCount=1272, loadSuccessCount=1272, loadExceptionCount=0, totalLoadTime=3168228989, evictionCount=0})
(tree,CacheStats{hitCount=10220, missCount=7683, loadSuccessCount=7596, loadExceptionCount=0, totalLoadTime=6285853981, evictionCount=0})
(commit,CacheStats{hitCount=694, missCount=643, loadSuccessCount=643, loadExceptionCount=0, totalLoadTime=461482314, evictionCount=0})
(tag,CacheStats{hitCount=0, missCount=0, loadSuccessCount=0, loadExceptionCount=0, totalLoadTime=0, evictionCount=0})
823364b5fcb28384fd825872cff1896d217e9590 59285834 aka_title.csv
b53c55cfc26a1bc6ccc4c63fece701b1dd328b84 27535007 company_name.csv
fed782c95ca49572a1b0f0e7d274b17e6612436c 66208024 movie_link.csv
7ff3a96a695721a3b69ec4f5774cc3c6f562bb25 96926941 testdt06.csv
This diff is collapsed.
(apply,CacheStats{hitCount=893, missCount=2333, loadSuccessCount=2333, loadExceptionCount=0, totalLoadTime=4573153354, evictionCount=0})
(tree,CacheStats{hitCount=16272, missCount=8348, loadSuccessCount=8233, loadExceptionCount=0, totalLoadTime=7766525658, evictionCount=0})
(commit,CacheStats{hitCount=1275, missCount=1181, loadSuccessCount=1181, loadExceptionCount=0, totalLoadTime=668194688, evictionCount=0})
(tag,CacheStats{hitCount=0, missCount=0, loadSuccessCount=0, loadExceptionCount=0, totalLoadTime=0, evictionCount=0})
791e783edfbcb02087eca4c7bd7dedef25751cc5 145031 2020_11_19__15_45_00raab_neumarkt.sql
This diff is collapsed.
791e783edfbcb02087eca4c7bd7dedef25751cc5,DELETE,regular-file,fda-analyse-service/data/2020_11_19__15_45_00raab_neumarkt.sql,145031,
(apply,CacheStats{hitCount=1597, missCount=2815, loadSuccessCount=2815, loadExceptionCount=0, totalLoadTime=2943813398, evictionCount=0})
(tree,CacheStats{hitCount=19070, missCount=8633, loadSuccessCount=8515, loadExceptionCount=0, totalLoadTime=8330387124, evictionCount=0})
(commit,CacheStats{hitCount=1549, missCount=1427, loadSuccessCount=1427, loadExceptionCount=0, totalLoadTime=418903314, evictionCount=0})
(tag,CacheStats{hitCount=0, missCount=0, loadSuccessCount=0, loadExceptionCount=0, totalLoadTime=0, evictionCount=0})
791e783edfbcb02087eca4c7bd7dedef25751cc5 145031 2020_11_19__15_45_00raab_neumarkt.sql
This diff is collapsed.
791e783edfbcb02087eca4c7bd7dedef25751cc5,DELETE,regular-file,fda-analyse-service/data/2020_11_19__15_45_00raab_neumarkt.sql,145031,
package at.tuwien.config;
import com.google.common.io.Files;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import javax.annotation.PostConstruct;
import java.io.File;
import java.io.IOException;
@Configuration
public class ReadyConfig {
@PostConstruct
@EventListener(ApplicationReadyEvent.class)
public void init() throws IOException {
Files.touch(new File("/ready"));
}
......
......@@ -65,7 +65,8 @@ public class DatabaseEndpoint {
@ApiResponse(code = 405, message = "Unable to connect to database within container."),
})
public ResponseEntity<DatabaseBriefDto> create(@Valid @RequestBody DatabaseCreateDto createDto)
throws ImageNotSupportedException, ContainerNotFoundException, DatabaseMalformedException, BrokerMalformedException {
throws ImageNotSupportedException, ContainerNotFoundException, DatabaseMalformedException,
AmqpException {
final Database database = databaseService.create(createDto);
return ResponseEntity.status(HttpStatus.CREATED)
.body(databaseMapper.databaseToDatabaseBriefDto(database));
......@@ -109,7 +110,7 @@ public class DatabaseEndpoint {
@ApiResponse(code = 405, message = "Unable to connect to database within container."),
})
public ResponseEntity<?> delete(@NotBlank @PathVariable Long id) throws DatabaseNotFoundException,
ImageNotSupportedException, DatabaseMalformedException, BrokerMalformedException {
ImageNotSupportedException, DatabaseMalformedException, AmqpException {
databaseService.delete(id);
return ResponseEntity.status(HttpStatus.ACCEPTED)
.build();
......
......@@ -50,7 +50,7 @@ public class EndpointUnitTest extends BaseUnitTest {
@Test
public void create_succeeds() throws ImageNotSupportedException, ContainerNotFoundException,
DatabaseMalformedException, BrokerMalformedException {
DatabaseMalformedException, AmqpException {
final DatabaseCreateDto request = DatabaseCreateDto.builder()
.containerId(CONTAINER_1_ID)
.name(CONTAINER_1_NAME)
......@@ -68,7 +68,7 @@ public class EndpointUnitTest extends BaseUnitTest {
@Test
public void create_containerNotFound_fails() throws ImageNotSupportedException, ContainerNotFoundException,
DatabaseMalformedException, BrokerMalformedException {
DatabaseMalformedException, AmqpException {
final DatabaseCreateDto request = DatabaseCreateDto.builder()
.containerId(CONTAINER_1_ID)
.name(CONTAINER_1_NAME)
......@@ -85,7 +85,7 @@ public class EndpointUnitTest extends BaseUnitTest {
@Test
public void create_imageNotSupported_fails() throws ImageNotSupportedException, ContainerNotFoundException,
DatabaseMalformedException, BrokerMalformedException {
DatabaseMalformedException, AmqpException {
final DatabaseCreateDto request = DatabaseCreateDto.builder()
.containerId(CONTAINER_1_ID)
.name(CONTAINER_1_NAME)
......@@ -152,7 +152,7 @@ public class EndpointUnitTest extends BaseUnitTest {
@Test
public void delete_succeeds() throws DatabaseNotFoundException, ImageNotSupportedException,
DatabaseMalformedException, BrokerMalformedException {
DatabaseMalformedException, AmqpException {
final ResponseEntity<?> response = databaseEndpoint.delete(DATABASE_1_ID);
/* test */
......@@ -161,7 +161,7 @@ public class EndpointUnitTest extends BaseUnitTest {
@Test
public void delete_invalidImage_fails() throws DatabaseNotFoundException, ImageNotSupportedException,
DatabaseMalformedException, BrokerMalformedException {
DatabaseMalformedException, AmqpException {
willThrow(ImageNotSupportedException.class)
.given(databaseService)
.delete(DATABASE_1_ID);
......@@ -174,7 +174,7 @@ public class EndpointUnitTest extends BaseUnitTest {
@Test
public void delete_notFound_fails() throws DatabaseNotFoundException, ImageNotSupportedException,
DatabaseMalformedException, BrokerMalformedException {
DatabaseMalformedException, AmqpException {
willThrow(DatabaseNotFoundException.class)
.given(databaseService)
.delete(DATABASE_1_ID);
......
......@@ -3,26 +3,17 @@ package at.tuwien.service;
import at.tuwien.BaseUnitTest;
import at.tuwien.api.database.DatabaseCreateDto;
import at.tuwien.api.database.DatabaseModifyDto;
import at.tuwien.entities.container.Container;
import at.tuwien.entities.container.image.ContainerImage;
import at.tuwien.entities.database.Database;
import at.tuwien.exception.*;
import at.tuwien.mapper.ImageMapper;
import at.tuwien.repository.ContainerRepository;
import at.tuwien.repository.DatabaseRepository;
import at.tuwien.repository.ImageRepository;
import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.CreateContainerResponse;
import com.github.dockerjava.api.exception.ConflictException;
import com.github.dockerjava.api.exception.NotModifiedException;
import com.github.dockerjava.api.model.ExposedPort;
import com.github.dockerjava.api.model.HostConfig;
import com.github.dockerjava.api.model.Network;
import com.github.dockerjava.api.model.PortBinding;
import org.checkerframework.checker.units.qual.A;
import org.jooq.DSLContext;
import org.jooq.SQLDialect;
import org.jooq.impl.DSL;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
......@@ -30,22 +21,16 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Properties;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
@ExtendWith(SpringExtension.class)
......@@ -151,7 +136,7 @@ public class ServiceIntegrationTest extends BaseUnitTest {
@Test
public void create_postgres_succeeds() throws ImageNotSupportedException, ContainerNotFoundException,
DatabaseMalformedException, SQLException, BrokerMalformedException {
DatabaseMalformedException, SQLException, AmqpException {
final DatabaseCreateDto request = DatabaseCreateDto.builder()
.containerId(CONTAINER_1_ID)
.name(DATABASE_1_NAME)
......@@ -170,7 +155,7 @@ public class ServiceIntegrationTest extends BaseUnitTest {
@Test
@Disabled("Cannot start in normal time")
public void create_mariadb_succeeds() throws ImageNotSupportedException, ContainerNotFoundException,
DatabaseMalformedException, InterruptedException, BrokerMalformedException {
DatabaseMalformedException, InterruptedException, AmqpException {
final DatabaseCreateDto request = DatabaseCreateDto.builder()
.containerId(CONTAINER_2_ID)
.name(DATABASE_2_NAME)
......@@ -218,7 +203,7 @@ public class ServiceIntegrationTest extends BaseUnitTest {
@Test
public void delete_succeeds() throws DatabaseNotFoundException, ImageNotSupportedException,
DatabaseMalformedException, BrokerMalformedException {
DatabaseMalformedException, AmqpException {
/* test */
databaseService.delete(DATABASE_1_ID);
......
package at.tuwien.config;
import com.google.common.io.Files;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import javax.annotation.PostConstruct;
import java.io.File;
import java.io.IOException;
@Configuration
public class ReadyConfig {
@PostConstruct
@EventListener(ApplicationReadyEvent.class)
public void init() throws IOException {
Files.touch(new File("/ready"));
}
......
package at.tuwien.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(code = HttpStatus.NOT_ACCEPTABLE)
public class AmqpException extends Exception {
public AmqpException(String msg) {
super(msg);
}
public AmqpException(String msg, Throwable thr) {
super(msg, thr);
}
public AmqpException(Throwable thr) {
super(thr);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment