@@ -18,7 +18,7 @@ import scalaz.{DList => _, _}, Scalaz._
18
18
19
19
object ingestBulk extends IvoryApp {
20
20
21
- case class CliArguments (repo : String , dictionary : Option [String ], input : String , tmp : String , timezone : DateTimeZone , optimal : Long , codec : Option [CompressionCodec ])
21
+ case class CliArguments (repo : String , dictionary : Option [String ], input : String , timezone : DateTimeZone , optimal : Long , codec : Option [CompressionCodec ])
22
22
23
23
val parser = new scopt.OptionParser [CliArguments ](" ingest-bulk" ) {
24
24
head("""
@@ -32,7 +32,6 @@ object ingestBulk extends IvoryApp {
32
32
opt[Unit ]('n' , " no-compression" ) action { (_, c) => c.copy(codec = None ) } text " Don't use compression."
33
33
34
34
opt[String ]('r' , " repo" ) action { (x, c) => c.copy(repo = x) } required() text " Path to an ivory repository."
35
- opt[String ]('t' , " tmp" ) action { (x, c) => c.copy(tmp = x) } required() text " Path to store tmp data."
36
35
opt[String ]('i' , " input" ) action { (x, c) => c.copy(input = x) } required() text " Path to data to import."
37
36
opt[Long ]('o' , " optimal-input-chunk" ) action { (x, c) => c.copy(optimal = x) } text " Optimal size (in bytes) of input chunk.."
38
37
opt[String ]('d' , " dictionary" ) action { (x, c) => c.copy(dictionary = Some (x)) } text " Name of dictionary to use."
@@ -45,21 +44,21 @@ object ingestBulk extends IvoryApp {
45
44
type Parts = String
46
45
47
46
def cmd = IvoryCmd [CliArguments ](parser,
48
- CliArguments (" " , None , " " , " " , DateTimeZone .getDefault, 1024 * 1024 * 256 /* 256MB */ , Some (new SnappyCodec )),
47
+ CliArguments (" " , None , " " , DateTimeZone .getDefault, 1024 * 1024 * 256 /* 256MB */ , Some (new SnappyCodec )),
49
48
ScoobiCmd (configuration => c => {
50
- val res = onHdfs(new Path (c.repo), c.dictionary, new Path (c.input), new Path (c.tmp), c.timezone, c.optimal, c.codec)
49
+ val res = onHdfs(new Path (c.repo), c.dictionary, new Path (c.input), c.timezone, c.optimal, c.codec)
51
50
res.run(configuration).map {
52
51
case f => List (s " Successfully imported ' ${c.input}' as ${f} into ' ${c.repo}' " )
53
52
}
54
53
}))
55
54
56
- def onHdfs (repo : Path , dictionary : Option [String ], input : Path , tmp : Path , timezone : DateTimeZone , optimal : Long , codec : Option [CompressionCodec ]): ScoobiAction [Factset ] =
57
- fatrepo.ImportWorkflow .onHdfs(repo, dictionary.map(defaultDictionaryImport(_)), importFeed(input, optimal, codec), tmp, timezone)
55
+ def onHdfs (repo : Path , dictionary : Option [String ], input : Path , timezone : DateTimeZone , optimal : Long , codec : Option [CompressionCodec ]): ScoobiAction [Factset ] =
56
+ fatrepo.ImportWorkflow .onHdfs(repo, dictionary.map(defaultDictionaryImport(_)), importFeed(input, optimal, codec), timezone)
58
57
59
- def defaultDictionaryImport (dictionary : String )(repo : HdfsRepository , name : String , tmpPath : Path ): Hdfs [Unit ] =
58
+ def defaultDictionaryImport (dictionary : String )(repo : HdfsRepository , name : String ): Hdfs [Unit ] =
60
59
DictionaryImporter .onHdfs(repo.root.toHdfs, repo.dictionaryByName(dictionary).toHdfs, name)
61
60
62
- def importFeed (input : Path , optimal : Long , codec : Option [CompressionCodec ])(repo : HdfsRepository , factset : Factset , dname : String , tmpPath : Path , errorPath : Path , timezone : DateTimeZone ): ScoobiAction [Unit ] = for {
61
+ def importFeed (input : Path , optimal : Long , codec : Option [CompressionCodec ])(repo : HdfsRepository , factset : Factset , dname : String , errorPath : Path , timezone : DateTimeZone ): ScoobiAction [Unit ] = for {
63
62
dict <- ScoobiAction .fromHdfs(IvoryStorage .dictionaryFromIvory(repo, dname))
64
63
list <- listing(input)
65
64
conf <- ScoobiAction .scoobiConfiguration
0 commit comments