Skip to content

Instantly share code, notes, and snippets.

View heinrichreimer's full-sized avatar

Jan Heinrich Reimer heinrichreimer

View GitHub Profile
@heinrichreimer
heinrichreimer / AddOnlyCollections.kt
Created January 20, 2020 11:22
Add-only Kotlin collections.
package de.webis.webisstud.thesis.reimer
/**
* A generic collection of elements that supports adding elements.
*
* @param E the type of elements contained in the collection.
* The mutable collection is invariant on its element type.
*/
interface AddOnlyCollection<E> : Collection<E> {
@heinrichreimer
heinrichreimer / keybase.md
Created February 12, 2020 08:49
Keybase proof

Keybase proof

I hereby claim:

  • I am heinrichreimer on github.
  • I am heinrichreimer (https://keybase.io/heinrichreimer) on keybase.
  • I have a public key ASBY23krwrFBLQ-MswPfhYQ1Gv8KMy9-fNP0dzT4wuj1cgo

To claim this, I am signing this object:

@heinrichreimer
heinrichreimer / EsSparkExtensions.kt
Created April 1, 2020 22:37
Elasticsearch Spark extension functions for Kotlin.
package de.webis.webisstud.thesis.reimer.clueweb.graph
import org.apache.spark.SparkConf
import org.apache.spark.api.java.JavaPairRDD
import org.apache.spark.api.java.JavaRDD
import org.apache.spark.api.java.JavaSparkContext
import org.elasticsearch.hadoop.cfg.ConfigurationOptions.*
import org.elasticsearch.spark.rdd.api.java.JavaEsSpark
fun JavaSparkContext.esRDD(): JavaPairRDD<String, Map<String, Any>> =