Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sam Bessalah samklr

🎯
Focusing
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 =
org.apache.hadoop.fs.FileSystem.get(
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() = ri.next()
@jaceklaskowski
jaceklaskowski / spark-jobserver-docker-macos.md
Last active Aug 1, 2018
How to run spark-jobserver on Docker and Mac OS (using docker-machine)
View spark-jobserver-docker-macos.md
@mp911de
mp911de / Client.java
Created Sep 24, 2015
JMX Monitoring Demo of lettuce 3.4-SNAPSHOT
View Client.java
package com.lambdaworks.redis.experimental.mbean;
import java.lang.management.ManagementFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import javax.management.JMException;
import javax.management.MBeanServer;
@MLnick
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
mp911de / JedisCluster.java
Last active Nov 27, 2015
Connecting a Redis Cluster
View JedisCluster.java
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
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()
.setAppName("....")
val sc = new SparkContext(conf)
// TODO: Bug in Spark: http://stackoverflow.com/questions/30323212
val ctx = new HiveContext(sc)
ctx.setConf("spark.sql.hive.convertMetastoreParquet", "false")
View MyExtendedRedisClient.java
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
mbostock / .block
Last active Sep 13, 2018
Smallest Enclosing Circle
View .block
license: gpl-3.0
@harlow
harlow / golang_job_queue.md
Last active Jan 17, 2020
Job queues in Golang
View golang_job_queue.md
You can’t perform that action at this time.