Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS streaming transformer should use default chain to set S3 region #1346

Closed
wants to merge 1 commit into from
Closed
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 @@ -12,10 +12,13 @@ package com.snowplowanalytics.snowplow.rdbloader.transformer.stream.kinesis

import cats.Parallel
import cats.effect._
import org.apache.hadoop.conf.Configuration
import software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain
import com.snowplowanalytics.snowplow.rdbloader.aws.KinesisProducer.{BackoffPolicy, RequestLimits}
import com.snowplowanalytics.snowplow.rdbloader.aws._
import com.snowplowanalytics.snowplow.rdbloader.common.cloud.{BlobStorage, Queue}
import com.snowplowanalytics.snowplow.rdbloader.transformer.stream.common.{Config, Run}
import com.snowplowanalytics.snowplow.rdbloader.transformer.stream.common.parquet.ParquetOps
import com.snowplowanalytics.snowplow.rdbloader.transformer.stream.kinesis.generated.BuildInfo
import com.snowplowanalytics.snowplow.scalatracker.emitters.http4s.ceTracking

Expand All @@ -38,7 +41,8 @@ object Main extends IOApp {
c => mkSink(c),
c => mkBadQueue(c),
mkQueue,
KinesisCheckpointer.checkpointer
KinesisCheckpointer.checkpointer,
parquetOps
)

private def mkSource[F[_]: Async](
Expand Down Expand Up @@ -106,4 +110,17 @@ object Main extends IOApp {
case _ =>
Resource.eval(Async[F].raiseError(new IllegalArgumentException(s"Message queue is not SQS or SNS")))
}

private def parquetOps: ParquetOps = new ParquetOps {

override def transformPath(p: String): String =
ParquetOps.noop.transformPath(p)

override def hadoopConf: Configuration = {
val s3Conf = new Configuration()
s3Conf.set("fs.s3a.endpoint.region", (new DefaultAwsRegionProviderChain).getRegion.id)
s3Conf
}

}
}
Loading