Skip to content

Instantly share code, notes, and snippets.

@tommyshiou
Created March 15, 2018 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommyshiou/49fbff744a91c6872196d78dabd4b279 to your computer and use it in GitHub Desktop.
Save tommyshiou/49fbff744a91c6872196d78dabd4b279 to your computer and use it in GitHub Desktop.
class StatusUpdateStreamingListener(
pipelineName: String,
pipelineId: Long) extends StreamingListener {
@Inject var statusTrackerClient: StatusTrackerClient = _
override def onBatchCompleted(batch: StreamingListenerBatchCompleted): Unit = {
val msg = StreamingStatusMessage.newBuilder()
.setPipelineName(pipelineName)
.setId(pipelineId)
.setBatchTime(batch.batchInfo.batchTime.milliseconds)
.build
statusTrackerClient.send(msg)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment