Skip to content

Commit f0776e0

Browse files
moulimukherjeejohnynek
authored andcommitted
Check for success files based on configuration flag (#1758)
1 parent 0614b51 commit f0776e0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scalding-core/src/main/scala/com/twitter/scalding/FileSource.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,13 @@ abstract class FileSource extends SchemedSource with LocalSourceOverride with Hf
229229
* TODO: consider writing a more in-depth version of this method in [[TimePathedSource]] that looks for
230230
* TODO: missing days / hours etc.
231231
*/
232-
protected def pathIsGood(globPattern: String, conf: Configuration) = FileSource.globHasNonHiddenPaths(globPattern, conf)
232+
protected def pathIsGood(globPattern: String, conf: Configuration) = {
233+
if (conf.getBoolean("scalding.require_success_file", false)) {
234+
FileSource.allGlobFilesWithSuccess(globPattern, conf, true)
235+
} else {
236+
FileSource.globHasNonHiddenPaths(globPattern, conf)
237+
}
238+
}
233239

234240
def hdfsPaths: Iterable[String]
235241
// By default, we write to the LAST path returned by hdfsPaths

0 commit comments

Comments
 (0)