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
import java.io.ByteArrayOutputStream | |
import java.nio.ByteBuffer | |
import io.confluent.connect.avro.{AvroAuthentication, AvroPrimaryBrandCreated} | |
import org.apache.avro.io.{BinaryEncoder, EncoderFactory} | |
import org.apache.avro.specific.{SpecificDatumReader, SpecificDatumWriter} | |
import scala.reflect.ClassTag | |
abstract class GenDeserializerOps[T <: SpecificRecordBase: ClassTag] extends Serializable { |
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
import java.util.Properties | |
import org.apache.kafka.clients.admin.{AdminClient, AdminClientConfig, NewTopic} | |
object InternalTopicManager { | |
import scala.collection.JavaConverters._ | |
final def removeNoAlphanumericCharsFromTopic(topicName: String): String = | |
topicName.replaceAll("[^\\p{L}\\p{Nd}]+", "") |
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
sealed case class EvaluableData( | |
value: BigDecimal, | |
threshold: Threshold, | |
serviceClass: String, | |
serviceInstance: String, | |
triggeredEvent: String | |
) | |
sealed case class Threshold(criteria: Criteria.CriteriaValue, | |
critical: BigDecimal, |
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
import scala.concurrent.ExecutionContext | |
import scala.concurrent.ExecutionContext.Implicits._ | |
import slick.dbio.DBIO | |
import cats.{Functor, Monad} | |
object SlickCatsOps { | |
implicit def functor(implicit ex: ExecutionContext): Functor[DBIO] = new Functor[DBIO] { | |
override def map[A, B](fa: DBIO[A])(f: A => B): DBIO[B] = fa map f | |
} |
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
object PhantomBuilder extends App { | |
object Builder { | |
sealed trait State | |
trait Checked extends State | |
trait Unchecked extends State |
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
package ai.igenius.sink | |
import java.util.concurrent.TimeUnit | |
import cats.Functor | |
import cats.effect._ | |
import org.influxdb._ | |
import org.influxdb.dto.Point | |
import pureconfig._ | |
import pureconfig.generic.auto._ |
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
import shapeless._, shapeless.ops.hlist._, shapeless.labelled.FieldType | |
trait Op[A] extends DepFn1[A] | |
trait LowPriority { | |
implicit def identity[A]: Op.Aux[A, A] = Op.createInstance(i => i) | |
} | |
object Op extends LowPriority { | |
type Aux[A, OUT0] = Op[A] { type Out = OUT0 } |