Home » Author Archives: Mark Needham

Author Archives: Mark Needham

Kubernetes: Simulating a network partition

devops-logo

A couple of weeks ago I wrote a post explaining how to create a Neo4j causal cluster using Kubernetes and … the I wanted to work out how to simulate a network partition which would put the leader on the minority side and force an election. We’ve done this on our internal tooling on AWS using the iptables command but ...

Read More »

Kubernetes: Spinning up a Neo4j 3.1 Causal Cluster

neo4j-logo

A couple of weeks ago I wrote a blog post explaining how I’d created a Neo4j causal cluster using docker containers directly and for my next pet project I wanted to use Kubernetes as an orchestration layer so that I could declaratively change the number of servers in my cluster. I’d never used Kubernetes before but I saw a presentation ...

Read More »

Kubernetes: Writing hostname to a file

devops-logo

Over the weekend I spent a bit of time playing around with Kubernetes and to get the hang of the technology I set myself the task of writing the hostname of the machine to a file. I’m using the excellent minikube tool to create a local Kubernetes cluster for my experiments so the first step is to spin that up: ...

Read More »

Neo4j: Find the intermediate point between two lat/longs

neo4j-logo

Yesterday I wrote a blog post showing how to find the midpoint between two lat/longs using Cypher which worked well as a first attempt at filling in missing locations, but I realised I could do better. As I mentioned in the last post, when I find a stop that’s missing lat/long coordinates I can usually find two nearby stops that ...

Read More »

Neo4j: Find the midpoint between two lat/longs

neo4j-logo

Over the last couple of weekends I’ve been playing around with some transport data and I wanted to run the A* algorithm to find the quickest route between two stations. The A* algorithm takes an estimateEvaluator as one of its parameters and the evaluator looks at lat/longs of nodes to work out whether a path is worth following or not. ...

Read More »

Neo4j: Dynamically add property/Set dynamic property

neo4j-logo

I’ve been playing around with a dataset which has the timetable for the national rail in the UK and they give you departure and arrival times of each train in a textual format. For example, the node to represent a stop could be created like this: CREATE (stop:Stop {arrival: "0802", departure: "0803H"}) That time format isn’t particular amenable to querying ...

Read More »

Neo4j: Detecting rogue spaces in CSV headers with LOAD CSV

java-logo

Last week I was helping someone load the data from a CSV file into Neo4j and we were having trouble filtering out rows which contained a null value in one of the columns. This is what the data looked like: load csv with headers from "file:///foo.csv" as row RETURN row ╒══════════════════════════════════╕ │row │ ╞══════════════════════════════════╡ │{key1: a, key2: (null), key3: c}│ ...

Read More »

Hadoop: DataNode not starting

apache-hadoop-logo

In my continued playing with Mahout I eventually decided to give up using my local file system and use a local Hadoop instead since that seems to have much less friction when following any examples. Unfortunately all my attempts to upload any files from my local file system to HDFS were being met with the following exception: java.io.IOException: File /user/markneedham/book2.txt ...

Read More »

Neo4j: Cypher – Detecting duplicates using relationships

neo4j-logo

I’ve been building a graph of computer science papers on and off for a couple of months and now that I’ve got a few thousand loaded in I realised that there are quite a few duplicates. They’re not duplicates in the sense that there are multiple entries with the same identifier but rather have different identifiers but seem to be ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns