Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
Import Process
Import Process Administrator
Commits
4f86ad53
Unverified
Commit
4f86ad53
authored
Aug 21, 2020
by
Sebastian Schüpbach
Browse files
fix style issues
Signed-off-by:
Sebastian Schüpbach
<
sebastian.schuepbach@unibas.ch
>
parent
bf14c219
Pipeline
#13080
passed with stages
in 7 minutes and 50 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/main/scala/ch/memobase/App.scala
View file @
4f86ad53
...
...
@@ -31,6 +31,7 @@ object App extends scala.App with Logging {
val
topology
=
new
KafkaTopology
val
streams
=
new
KafkaStreams
(
topology
.
build
(),
SettingsFromFile
.
getKafkaStreamsSettings
)
val
shutdownGracePeriodMs
=
10000
logger
.
trace
(
"Starting stream processing"
)
Try
(
...
...
@@ -41,6 +42,6 @@ object App extends scala.App with Logging {
}
sys
.
ShutdownHookThread
{
streams
.
close
(
Duration
.
of
Seconds
(
10
))
streams
.
close
(
Duration
.
of
Millis
(
shutdownGracePeriodMs
))
}
}
src/main/scala/ch/memobase/Messages.scala
View file @
4f86ad53
...
...
@@ -24,8 +24,9 @@ import upickle.default.{Reader, macroRW}
/**
* Terminates a Kafka service when sent downstream
*
* @param processId Id of import process
* @param jobName Name of job inside process
* @param jobName
Name of job inside process
*/
case
class
ServiceTermination
(
processId
:
String
,
jobName
:
String
)
{
override
def
toString
:
String
=
s
"""{"action":"termination","processId":"$processId","job-name":"$jobName"}"""
...
...
@@ -34,8 +35,8 @@ case class ServiceTermination(processId: String, jobName: String) {
// FIXME: Can eventually be removed
/**
*
* @param id Record id
* @param status Processing result; either SUCCESS or FAILURE
* @param id
Record id
* @param status
Processing result; either SUCCESS or FAILURE
* @param message Message in case of error
*/
case
class
ServiceReport
(
id
:
String
,
status
:
String
,
message
:
String
)
...
...
@@ -43,6 +44,7 @@ case class ServiceReport(id: String, status: String, message: String)
object
ServiceReport
{
implicit
val
reader
:
Reader
[
ServiceReport
]
=
macroRW
def
apply
(
msg
:
String
)
:
ServiceReport
=
{
val
json
=
upickle
.
default
.
read
[
ServiceReport
](
msg
)
new
ServiceReport
(
json
.
id
,
json
.
status
,
json
.
message
)
...
...
@@ -51,8 +53,9 @@ object ServiceReport {
/**
* Declares the size of a data set to be expected by a job in an import process
* @param processId Id of import process
* @param jobName Name of job inside process
*
* @param processId Id of import process
* @param jobName Name of job inside process
* @param dataSetSize Size of data set
*/
case
class
DataSetSize
(
processId
:
String
,
jobName
:
String
,
dataSetSize
:
Long
)
...
...
@@ -60,8 +63,9 @@ case class DataSetSize(processId: String, jobName: String, dataSetSize: Long)
object
DataSetSize
{
implicit
val
reader
:
Reader
[
DataSetSize
]
=
macroRW
def
apply
(
msg
:
String
)
:
DataSetSize
=
{
val
json
=
upickle
.
default
.
read
[
DataSetSize
](
msg
)
new
DataSetSize
(
json
.
processId
,
json
.
jobName
,
json
.
dataSetSize
)
}
}
\ No newline at end of file
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment