Skip to content

Instantly share code, notes, and snippets.

View mahedi-kaysar's full-sized avatar

Md. Mahedi Kaysar mahedi-kaysar

View GitHub Profile
@mahedi-kaysar
mahedi-kaysar / System Design.md
Created January 19, 2021 12:20 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@mahedi-kaysar
mahedi-kaysar / Job.scala
Created September 12, 2020 12:41 — forked from samklr/Job.scala
Spark Streaming Websocket Receiver
val ssc = new StreamingContext("local", "datastream", Seconds(15))
// create InputDStream
ssc.registerInputStream(stream)
// interact with stream
ssc.start()
@mahedi-kaysar
mahedi-kaysar / spark-sql-parquet-graphx
Created January 16, 2016 14:45 — forked from koeninger/spark-sql-parquet-graphx
Spark SQL, Parquet, GraphX examples
import org.apache.spark.sql.{ SQLContext, Row }
val sqlContext = new SQLContext(sc)
import sqlContext._
/*
Next you'll need to get your data registered as a table. Note that in order to infer the schema (column names and types) it must be a case class. A normal class won't work, unless you manually implement much of what a case class would do, e.g. extend Product and Serializable.
Any data source can be used, as long as you can transform it to an rdd of case classes. For now, we'll just use some dummy data:
*/
@mahedi-kaysar
mahedi-kaysar / WsChatServlet.java
Created November 14, 2015 16:48 — forked from chitan/WsChatServlet.java
How to use WebSocket of Tomcat
//This sample is how to use websocket of Tomcat.
package wsapp;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.util.ArrayList;
import org.apache.catalina.websocket.MessageInbound;
import org.apache.catalina.websocket.StreamInbound;
import org.apache.catalina.websocket.WebSocketServlet;