Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.apache.hadoop.security.UserGroupInformation
import org.json4s.jackson.Serialization
import org.json4s.{Formats, NoTypeHints}
import org.slf4j.LoggerFactory
import org.springframework.context.annotation.Lazy
import org.springframework.stereotype.Service
import za.co.absa.hyperdrive.trigger.api.rest.utils.ScalaUtil.swap

Expand All @@ -41,8 +42,9 @@ class HdfsParameters(
val checkpointLocation: String
)

@Lazy
@Service
class CheckpointServiceImpl @Inject() (hdfsService: HdfsService) extends CheckpointService {
class CheckpointServiceImpl @Inject() (@Lazy hdfsService: HdfsService) extends CheckpointService {
private val logger = LoggerFactory.getLogger(this.getClass)
private val offsetsDirName = "offsets"
private val commitsDirName = "commits"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.apache.hadoop.fs._
import org.apache.hadoop.security.UserGroupInformation
import org.apache.spark.deploy.SparkHadoopUtil
import org.slf4j.LoggerFactory
import org.springframework.context.annotation.Lazy
import org.springframework.stereotype.Service

import java.nio.charset.StandardCharsets.UTF_8
Expand All @@ -36,6 +37,7 @@ trait HdfsService {
): Try[Option[R]]
}

@Lazy
@Service
class HdfsServiceImpl extends HdfsService {
private val logger = LoggerFactory.getLogger(this.getClass)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.apache.commons.configuration2.{BaseConfiguration, Configuration}
import org.apache.hadoop.security.UserGroupInformation
import org.apache.kafka.clients.consumer.ConsumerConfig
import org.slf4j.LoggerFactory
import org.springframework.context.annotation.Lazy
import org.springframework.stereotype.Service
import za.co.absa.hyperdrive.trigger.configuration.application.SparkConfig
import za.co.absa.hyperdrive.trigger.models.enums.JobTypes
Expand All @@ -36,9 +37,10 @@ trait HyperdriveOffsetComparisonService {
}

@Service
@Lazy
class HyperdriveOffsetComparisonServiceImpl @Inject() (sparkConfig: SparkConfig,
checkpointService: CheckpointService,
userGroupInformationService: UserGroupInformationService,
@Lazy checkpointService: CheckpointService,
@Lazy userGroupInformationService: UserGroupInformationService,
kafkaService: KafkaService
) extends HyperdriveOffsetComparisonService {
private val logger = LoggerFactory.getLogger(this.getClass)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Copyright 2018 ABSA Group Limited
*
Expand All @@ -17,12 +16,14 @@
package za.co.absa.hyperdrive.trigger.api.rest.services

import org.apache.hadoop.security.UserGroupInformation
import org.springframework.context.annotation.Lazy
import org.springframework.stereotype.Service

trait UserGroupInformationService {
def loginUserFromKeytab(principal: String, keytab: String): UserGroupInformation
}

@Lazy
@Service
class UserGroupInformationServiceImpl extends UserGroupInformationService {
override def loginUserFromKeytab(principal: String, keytab: String): UserGroupInformation =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import za.co.absa.hyperdrive.trigger.scheduler.executors.spark.{
}
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.BeanFactory
import org.springframework.context.annotation.Lazy
import za.co.absa.hyperdrive.trigger.scheduler.executors.shell.ShellExecutor
import org.springframework.stereotype.Component
import za.co.absa.hyperdrive.trigger.api.rest.services.HyperdriveOffsetComparisonService
Expand All @@ -48,7 +49,7 @@ class Executors @Inject() (
beanFactory: BeanFactory,
implicit val sparkConfig: SparkConfig,
schedulerConfig: SchedulerConfig,
hyperdriveOffsetComparisonService: HyperdriveOffsetComparisonService
@Lazy hyperdriveOffsetComparisonService: HyperdriveOffsetComparisonService
) {
private val logger = LoggerFactory.getLogger(this.getClass)
private implicit val executionContext: ExecutionContextExecutor =
Expand Down
Loading