Using CURL to test HTTP Requests

$ curl -i -X POST -H “Content-Type:application/json”-d ‘{ “firstName” : “Frodo”, “lastName” : “Baggins” }’ http://localhost:8080/people HTTP/1.1201CreatedServer:Apache-Coyote/1.1Location: http://localhost:8080/people/1Content-Length:0Date:Wed,26Feb201620:26:55 GMT -i ensures you can see the response message including the headers. The URI of the newly created Person is shown -X POST signals this a POST used to create a new entry -H “Content-Type:application/json” sets the…

Creating MongoDB instance using Docker

MongoDB can be installed and run within a docker container with its port=27017 dbpath=/data/db for storage. The docker run can start the process in the container and attach the console to the process’s standard input, output, and standard error. It can even pretend to be a TTY (this is what most command line executables expect)…

Spark Machine Learning Example

Spark Machine Learning Application Machine Learning application using classification technique, specifically collaborative filtering method, to predict the movies to recommend to a user based on other users’ ratings on different movies. Our recommendation engine solution will use Alternating Least Squares (ALS) machine learning algorithm. Even though the data sets used in the code example in…

Spark Streaming Example

Spark Streaming Application This example illustrates a web server log analytics use case to show how Spark Streaming can help with running analytics on data streams that are generated in a continuous manner. These log messages are considered time series data, which is defined as a sequence of data points consisting of successive measurements captured…

Hadoop File Formats

Hadoop can store and process unstructured data like video, text, etc. This is a significant advantage for Hadoop. However, there are many, perhaps more, uses of Hadoop with structured or “flexibly structured” data, meaning it can have fields added, changed or removed over time and even vary amongst concurrently ingested records. Many of the file format…

Java Collections – HashMap and HashSet

HashMap and HashSet are collections in Java which are most commonly used. Here we summarise key features: HashMap   HashSet Duplicates Yes, Duplicate values but  no duplicate keys No Adding or Storing mechanism Hashing technique HashMap object Dummy values No Yes Implements Map Set Number Of Objects required during add operation 2 1 When to…