Skip to content

Commit

Permalink
minor additional refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Oct 26, 2016
1 parent b90381d commit 655a412
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
@@ -1,11 +1,15 @@
package geotrellis.spark.etl.config

import com.github.fge.jsonschema.main.JsonSchemaFactory
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.Path
import org.apache.spark.SparkContext

trait ConfigParse {
val help: String
val requiredFields: Set[Symbol]

val schemaFactory = JsonSchemaFactory.byDefault()

def getJson(filePath: String, conf: Configuration): String = {
val path = new Path(filePath)
Expand Down
Expand Up @@ -4,7 +4,6 @@ import geotrellis.spark.etl.config.json._

import org.apache.spark.SparkContext
import com.github.fge.jackson.JsonLoader
import com.github.fge.jsonschema.main.JsonSchemaFactory
import spray.json._

trait DefaultEtlConf extends ConfigParse {
Expand All @@ -25,7 +24,6 @@ trait DefaultEtlConf extends ConfigParse {

val requiredFields = Set('input, 'output, 'backendProfiles)

val schemaFactory = JsonSchemaFactory.byDefault()
val backendProfilesSchema = schemaFactory.getJsonSchema(JsonLoader.fromResource("/backend-profiles-schema.json"))
val inputSchema = schemaFactory.getJsonSchema(JsonLoader.fromResource("/input-schema.json"))
val outputSchema = schemaFactory.getJsonSchema(JsonLoader.fromResource("/output-schema.json"))
Expand Down

0 comments on commit 655a412

Please sign in to comment.