Skip to content

Instantly share code, notes, and snippets.

View sutugin's full-sized avatar

Andrey Sutugin sutugin

View GitHub Profile
def main(args: Array[String]): Unit = {
val sc = SparkSession
  .builder()
  .appName(JOB_NAME)
  .getOrCreate()
  .sparkContext
val ssc = new StreamingContext(sc, Seconds(BATCH_DURATION_SECONDS))
package com.outbrain.datainfra.jester;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
@sutugin
sutugin / 1 - scalac options 2.13.scala
Created August 21, 2022 18:37 — forked from guilgaly/1 - scalac options 2.13.scala
Scala compiler options I typically use
val scalacOptions = Seq(
"-encoding",
"utf-8", // Specify character encoding used by source files.
"-Ybackend-parallelism", //
"8",
"-explaintypes", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
// "-Ymacro-annotations", // Enable support for macro annotations, formerly in macro paradise.
@sutugin
sutugin / App.scala
Created October 16, 2019 14:12 — forked from timvw/App.scala
Spark structured streaming: Commit source offsets to Kafka on QueryProgress
val groupId = "demo-consumer"
val bootstrapServers = "localhost:9092"
val spark = SparkSession
.builder()
.master("local[*]")
.appName("demo")
//.config("spark.sql.streaming.stateStore.maintenanceInterval", "10s")
//.config("spark.sql.streaming.metricsEnabled", true)
.config("spark.sql.streaming.minBatchesToRetain", 2)
@sutugin
sutugin / docker-cleanup-resources.md
Created September 13, 2018 10:43 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm