|
1 | 1 | package org.labkey.primeseq.etl; |
2 | 2 |
|
3 | 3 | import org.apache.commons.lang3.StringUtils; |
| 4 | +import org.apache.logging.log4j.Level; |
4 | 5 | import org.apache.logging.log4j.Logger; |
5 | 6 | import org.jetbrains.annotations.NotNull; |
6 | 7 | import org.labkey.api.collections.CaseInsensitiveHashMap; |
@@ -50,7 +51,8 @@ private enum Settings |
50 | 51 | destSchema(true), |
51 | 52 | destQuery(true), |
52 | 53 | destColumn(true), |
53 | | - destAdditionalFilters(false); |
| 54 | + destAdditionalFilters(false), |
| 55 | + reportOnly(false); |
54 | 56 |
|
55 | 57 | private final boolean _isRequired; |
56 | 58 |
|
@@ -106,6 +108,11 @@ public void setSettings(Map<String, String> settings) |
106 | 108 | _settings.putAll(settings); |
107 | 109 | } |
108 | 110 |
|
| 111 | + private boolean isReportOnly() |
| 112 | + { |
| 113 | + return _settings.containsKey(Settings.reportOnly.name()) && Boolean.parseBoolean(_settings.get(Settings.reportOnly.name())); |
| 114 | + } |
| 115 | + |
109 | 116 | private DataIntegrationService.RemoteConnection getRemoteDataSource(String name, Container c, Logger log) throws IllegalStateException |
110 | 117 | { |
111 | 118 | DataIntegrationService.RemoteConnection rc = DataIntegrationService.get().getRemoteConnection(name, c, log); |
@@ -259,7 +266,13 @@ private void verifyRows(PipelineJob job) throws PipelineJobException |
259 | 266 |
|
260 | 267 | if (source != dest) |
261 | 268 | { |
262 | | - job.getLogger().error("Row counts do not match (source: {}, dest: {})!", source, dest); |
| 269 | + if (isReportOnly()) { |
| 270 | + job.getLogger().info("Row counts do not match (source: {}, dest: {})!", source, dest); |
| 271 | + } |
| 272 | + else |
| 273 | + { |
| 274 | + job.getLogger().error("Row counts do not match (source: {}, dest: {})!", source, dest); |
| 275 | + } |
263 | 276 | } |
264 | 277 | } |
265 | 278 | } |
0 commit comments