Skip to content

Instantly share code, notes, and snippets.


Sam Bessalah samklr

Block or report user

Report or block samklr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View parquet-size.scala
val hdfs: org.apache.hadoop.fs.FileSystem =
new org.apache.hadoop.conf.Configuration())
val hadoopPath= new org.apache.hadoop.fs.Path("hdfs://localhost:9000/tmp")
val recursive = false
val ri = hdfs.listFiles(hadoopPath, recursive)
val it = new Iterator[org.apache.hadoop.fs.LocatedFileStatus]() {
override def hasNext = ri.hasNext
override def next() =
jaceklaskowski /
Last active Aug 1, 2018
How to run spark-jobserver on Docker and Mac OS (using docker-machine)
mp911de /
Created Sep 24, 2015
JMX Monitoring Demo of lettuce 3.4-SNAPSHOT
package com.lambdaworks.redis.experimental.mbean;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
MLnick / HyperLogLogStoreUDAF.scala
Last active Apr 11, 2018
Experimenting with Spark SQL UDAF - HyperLogLog UDAF for distinct counts, that stores the actual HLL for each row to allow further aggregation
View HyperLogLogStoreUDAF.scala
class HyperLogLogStoreUDAF extends UserDefinedAggregateFunction {
override def inputSchema = new StructType()
.add("stringInput", BinaryType)
override def update(buffer: MutableAggregationBuffer, input: Row) = {
// This input Row only has a single column storing the input value in String (or other Binary data).
// We only update the buffer when the input value is not null.
if (!input.isNullAt(0)) {
if (buffer.isNullAt(0)) {
View TestLabelledGeneric.scala
package testGeneric
import scala.language.higherKinds
import scalaz.Functor
object TestLabelledGeneric {
case class Ahoy(name:String, y:Int, l:Int)
mp911de /
Last active Nov 27, 2015
Connecting a Redis Cluster
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;
import java.util.HashSet;
import java.util.Set;
public class JedisCluster {
public static void main(String[] args) {
Set<HostAndPort> connectionPoints = new HashSet<HostAndPort>();
ezhulenev / spark-thred-safe.scala
Created Aug 11, 2015
Thread-safe Spark Sql Context
View spark-thred-safe.scala
object ServerSparkContext {
private[this] lazy val _sqlContext = {
val conf = new SparkConf()
val sc = new SparkContext(conf)
// TODO: Bug in Spark:
val ctx = new HiveContext(sc)
ctx.setConf("spark.sql.hive.convertMetastoreParquet", "false")
import javax.enterprise.inject.Alternative;
import com.lambdaworks.redis.RedisClient;
import com.lambdaworks.redis.RedisURI;
import com.lambdaworks.redis.StatefulRedisConnectionImpl;
import com.lambdaworks.redis.codec.RedisCodec;
import com.lambdaworks.redis.protocol.CommandHandler;
import com.lambdaworks.redis.pubsub.PubSubCommandHandler;
import com.lambdaworks.redis.pubsub.StatefulRedisPubSubConnectionImpl;
mbostock / .block
Last active Sep 13, 2018
Smallest Enclosing Circle
View .block
license: gpl-3.0
harlow /
Last active Jan 17, 2020
Job queues in Golang
You can’t perform that action at this time.