|
1 | 1 | package it.agilelab.bigdata.wasp.consumers.spark.plugins.parallel.tools |
2 | 2 |
|
3 | 3 | import it.agilelab.bigdata.wasp.consumers.spark.plugins.parallel.catalog.CatalogCoordinates |
4 | | -import it.agilelab.bigdata.wasp.consumers.spark.plugins.parallel.model.{ContinuousUpdate, ParallelWrite, ParallelWriteModel} |
| 4 | +import it.agilelab.bigdata.wasp.consumers.spark.plugins.parallel.model.{ |
| 5 | + ContinuousUpdate, |
| 6 | + ParallelWrite, |
| 7 | + ParallelWriteModel |
| 8 | +} |
5 | 9 |
|
6 | 10 | object TestModels { |
7 | 11 | val model1 = ParallelWriteModel(ParallelWrite("append"), entityDetails = CatalogCoordinates("default", "mock", "v1")) |
8 | | - val model2 = ParallelWriteModel(ParallelWrite("overwrite"), entityDetails = CatalogCoordinates("default", "mock", "v1")) |
| 12 | + val model2 = |
| 13 | + ParallelWriteModel(ParallelWrite("overwrite"), entityDetails = CatalogCoordinates("default", "mock", "v1")) |
9 | 14 |
|
10 | | - private val entityDetails: CatalogCoordinates = CatalogCoordinates("default", "mock", "v1") |
11 | | - private val entityDetailsWithDB: CatalogCoordinates = CatalogCoordinates("default", "mock", "v1", Some("mock_db")) |
12 | | - private val wrongDetails: CatalogCoordinates = CatalogCoordinates("default", "fake", "v1") |
| 15 | + private val entityDetails: CatalogCoordinates = CatalogCoordinates("default", "mock", "v1") |
| 16 | + private val entityDetailsWithDB: CatalogCoordinates = CatalogCoordinates("default", "mock", "v1", Some("mock_db")) |
| 17 | + private val wrongDetails: CatalogCoordinates = CatalogCoordinates("default", "fake", "v1") |
13 | 18 | private val notExistingEntityDetails: CatalogCoordinates = CatalogCoordinates("default", "entity", "v1") |
14 | 19 |
|
15 | 20 | val modelWithDB = ParallelWriteModel(ParallelWrite("overwrite"), entityDetails = entityDetailsWithDB) |
16 | 21 |
|
17 | | - val continuousUpdateModel1 = ParallelWriteModel(ContinuousUpdate(keys = "column1" :: Nil, orderingExpression = "ordering", Some(100), Some(1), Some(168), Some(100)), entityDetails) |
| 22 | + val continuousUpdateModel1 = ParallelWriteModel( |
| 23 | + ContinuousUpdate( |
| 24 | + keys = "column1" :: Nil, |
| 25 | + orderingExpression = "ordering", |
| 26 | + compactFrequency = None, |
| 27 | + compactNumFile = None, |
| 28 | + retentionHours = None, |
| 29 | + vacuumFrequency = None |
| 30 | + ), |
| 31 | + entityDetails |
| 32 | + ) |
18 | 33 |
|
19 | | - val continuousUpdateModel2 = ParallelWriteModel(ContinuousUpdate(keys = "column1" :: Nil, orderingExpression = "-(ordering1 + ordering2)", Some(100), Some(1), Some(168), Some(100)), entityDetails) |
| 34 | + val continuousUpdateModel2 = ParallelWriteModel( |
| 35 | + ContinuousUpdate( |
| 36 | + keys = "column1" :: Nil, |
| 37 | + orderingExpression = "-(ordering1 + ordering2)", |
| 38 | + compactFrequency = Some(100), |
| 39 | + compactNumFile = Some(1), |
| 40 | + retentionHours = Some(168), |
| 41 | + vacuumFrequency = Some(100) |
| 42 | + ), |
| 43 | + entityDetails |
| 44 | + ) |
20 | 45 |
|
21 | | - val wrongModel = ParallelWriteModel(ContinuousUpdate(keys = "column1" :: Nil, orderingExpression = "-(ordering1 + ordering2)", Some(100), Some(1), Some(168), Some(100)), wrongDetails) |
| 46 | + val wrongModel = ParallelWriteModel( |
| 47 | + ContinuousUpdate( |
| 48 | + keys = "column1" :: Nil, |
| 49 | + orderingExpression = "-(ordering1 + ordering2)", |
| 50 | + compactFrequency = Some(100), |
| 51 | + compactNumFile = Some(1), |
| 52 | + retentionHours = Some(168), |
| 53 | + vacuumFrequency = Some(100) |
| 54 | + ), |
| 55 | + wrongDetails |
| 56 | + ) |
22 | 57 |
|
23 | | - val notExistingEntityModel = ParallelWriteModel(ContinuousUpdate(keys = "column1" :: Nil, orderingExpression = "-(ordering1 + ordering2)", Some(100), Some(1), Some(168), Some(100)), notExistingEntityDetails) |
| 58 | + val notExistingEntityModel = ParallelWriteModel( |
| 59 | + ContinuousUpdate( |
| 60 | + keys = "column1" :: Nil, |
| 61 | + orderingExpression = "-(ordering1 + ordering2)", |
| 62 | + compactFrequency = Some(100), |
| 63 | + compactNumFile = Some(1), |
| 64 | + retentionHours = Some(168), |
| 65 | + vacuumFrequency = Some(100) |
| 66 | + ), |
| 67 | + notExistingEntityDetails |
| 68 | + ) |
24 | 69 | } |
0 commit comments