-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to HttpDataSource & HttpFileDataSource
- Loading branch information
1 parent
07233d9
commit 52de1df
Showing
12 changed files
with
108 additions
and
364 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...ain/scala/com/github/sharpdata/sharpetl/core/datasource/config/HttpDataSourceConfig.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.github.sharpdata.sharpetl.core.datasource.config | ||
|
||
import com.github.sharpdata.sharpetl.core.annotation.configFor | ||
|
||
import scala.beans.BeanProperty | ||
|
||
@configFor(types = Array("http")) | ||
class HttpDataSourceConfig extends DataSourceConfig with Serializable { | ||
|
||
@BeanProperty | ||
var connectionName: String = _ | ||
|
||
@BeanProperty | ||
var url: String = _ | ||
|
||
@BeanProperty | ||
var httpMethod: String = "GET" | ||
|
||
@BeanProperty | ||
var timeout: String = _ | ||
|
||
@BeanProperty | ||
var requestBody: String = _ | ||
|
||
@BeanProperty | ||
var fieldName: String = "value" | ||
|
||
@BeanProperty | ||
var jsonPath: String = "$" | ||
|
||
@BeanProperty | ||
var splitBy: String = "" | ||
} | ||
|
||
@configFor(types = Array("http_file")) | ||
class HttpFileDataSourceConfig extends HttpDataSourceConfig { | ||
|
||
@BeanProperty | ||
var tempDestinationDir = "/tmp" | ||
|
||
@BeanProperty | ||
var hdfsDir = "/tmp" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 21 additions & 17 deletions
38
...nsformation/HttpDownloadTransformer.scala → ...spark/datasource/HttpFileDataSource.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 0 additions & 83 deletions
83
spark/src/test/resources/tasks/transformer/LoopHttpTransformer.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.