Skip to content

Instantly share code, notes, and snippets.

@pppsunil
pppsunil / pom.xml
Last active April 9, 2023 13:18
Maven Build file for creating scala fat jar
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.spnotes.spark</groupId>
<artifactId>HelloSparkStreaming</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
@pppsunil
pppsunil / SysLogEventProducer.java
Created November 24, 2015 04:10
Sample Java Program for generating SysLog messages at given host and port
package com.spnotes.sparkstreaming;
import org.apache.log4j.Logger;
import org.apache.log4j.helpers.LogLog;
import java.io.IOException;
import java.net.*;
public class SysLogEventProducer {
private static final Logger logger = Logger.getLogger(SysLogEventProducer.class);
@pppsunil
pppsunil / HelloHDFS.java
Created July 2, 2014 01:25
Sample HDFS Client that demonstrates how to read file from HDFS and how to set replication factor
package com.spnotes.hadoop;
import org.apache.commons.io.IOUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.DistributedFileSystem;
import java.io.Console;
import java.io.IOException;