@@ -70,11 +70,14 @@ public class ConfigBasedDataset implements CopyableDataset {
70
70
private final CopyRoute copyRoute ;
71
71
private final ReplicationConfiguration rc ;
72
72
private String datasetURN ;
73
+ private boolean watermarkEnabled ;
73
74
74
75
public ConfigBasedDataset (ReplicationConfiguration rc , Properties props , CopyRoute copyRoute ) {
75
76
this .props = props ;
76
77
this .copyRoute = copyRoute ;
77
78
this .rc = rc ;
79
+ this .watermarkEnabled = Boolean .parseBoolean
80
+ (this .props .getProperty (ConfigBasedDatasetsFinder .WATERMARK_ENABLE , "true" ));
78
81
calculateDatasetURN ();
79
82
}
80
83
@@ -110,14 +113,16 @@ public Collection<? extends CopyEntity> getCopyableFiles(FileSystem targetFs, Co
110
113
return copyableFiles ;
111
114
}
112
115
113
- if ((!copyFromRaw .getWatermark ().isPresent () && copyToRaw .getWatermark ().isPresent ())
114
- || (copyFromRaw .getWatermark ().isPresent () && copyToRaw .getWatermark ().isPresent ()
115
- && copyFromRaw .getWatermark ().get ().compareTo (copyToRaw .getWatermark ().get ()) <= 0 )) {
116
- log .info (
117
- "No need to copy as destination watermark >= source watermark with source watermark {}, for dataset with metadata {}" ,
118
- copyFromRaw .getWatermark ().isPresent () ? copyFromRaw .getWatermark ().get ().toJson () : "N/A" ,
119
- this .rc .getMetaData ());
120
- return copyableFiles ;
116
+ if (this .watermarkEnabled ) {
117
+ if ((!copyFromRaw .getWatermark ().isPresent () && copyToRaw .getWatermark ().isPresent ()) || (
118
+ copyFromRaw .getWatermark ().isPresent () && copyToRaw .getWatermark ().isPresent ()
119
+ && copyFromRaw .getWatermark ().get ().compareTo (copyToRaw .getWatermark ().get ()) <= 0 )) {
120
+ log .info (
121
+ "No need to copy as destination watermark >= source watermark with source watermark {}, for dataset with metadata {}" ,
122
+ copyFromRaw .getWatermark ().isPresent () ? copyFromRaw .getWatermark ().get ().toJson () : "N/A" ,
123
+ this .rc .getMetaData ());
124
+ return copyableFiles ;
125
+ }
121
126
}
122
127
123
128
HadoopFsEndPoint copyFrom = (HadoopFsEndPoint ) copyFromRaw ;
@@ -194,7 +199,7 @@ public boolean apply(FileStatus input) {
194
199
deleteCommitStep , 0 ));
195
200
}
196
201
197
- // generate the watermark file
202
+ // generate the watermark file even if watermark checking is disabled. Make sure it can come into functional once disired.
198
203
if ((!watermarkMetadataCopied ) && copyFrom .getWatermark ().isPresent ()) {
199
204
copyableFiles .add (new PostPublishStep (copyTo .getDatasetPath ().toString (), Maps .<String , String > newHashMap (),
200
205
new WatermarkMetadataGenerationCommitStep (copyTo .getFsURI ().toString (), copyTo .getDatasetPath (),
0 commit comments