annotation annotation processor

An introductory guide to annotations and annotation processors

In Java, annotations and annotation processors are surrounded by a shroud of mystery for most. They seem like a subject reserved for 'experts''. On top of that, I believe there’s also some FUD around them. This post aims to dig into the subject, in the most neutral way possible. This way, everybody can take enlightened decisions based on facts, not by listening to people full of misconceptions or hidden agendas. Annotations are available since Java version 5, codenamed Tiger, and released

logging analytics SLF4J

Logging additional metadata

In February, before the lockdown, I presented my Fast logs talk at ConFoo. At the end, I had an interesting question I had to cut short because of the timing. This blog post aims to describe the relevant points of the talk, the question, as well as some possible answer. One improvement to have faster logs In this talk, I highlight different ways to make logs faster. Nowadays, most logs are aggregated into a single place for later usage. For example, a widespread architecture is based on the E

remote teaching

On teaching remotely

I started teaching in higher education organizations when I was still a student. That was more than 20 years ago. I’ve never stopped since then. I’ve taught in different kind of organizations (i.e. engineering schools, universities, and applied science schools) and two different countries, France and Switzerland. A common trait among all those jobs was the requirement to teach on-site. In fact, my current employer goes to the point of specifying it explicitly in its regulations.

Kubernetes controller java GraalVM

Your own Kubernetes controller - Improving and deploying

In the first post of this series, we described the concept behind a Kubernetes controller. In short, it’s just a plain control loop that reconciles the desired state of the cluster with its current state. In the second post, we implemented a sidecar controller in Java. This third and last post will be focused on where to deploy this Java controller and how to improve it to be on par with a Go one. Running outside the cluster or inside? As mentioned in the first post, there’s no re

Graal VM, AOT, compilation, substitution

Coping with incompatible code in Graal VM AOT compilation

The last two blog posts were focused on how to write a custom Kubernetes controller in Java. As usual, I’m writing a demo along with the posts: that allows me to face real issues, and be able to detail them. In this context, I had to handle a couple of them when implementing the demo code. This post is dedicated to one of them: the compilation of not-compatible Java code with Graal VM’s native image AOT compilation. The context In order for a Java Kubernetes controller to be on pa

Kubernetes controller java Fabric8 sidecar

Your own Kubernetes controller - Developing in Java

In the previous post, we laid out the foundations to create our own custom Kubernetes controller. We detailed what a controller was, and that its only requirement is to be able to communicate with HTTP/JSON. In this post, we are going to finally start developing it. The technology stack can be Python, NodeJS or Ruby. Because this blog is named 'A Java Geek', it’s normal to choose Java. As a use-case, we will implement the sidecar pattern: every time a pod gets scheduled, a sidecar pod w

Kubernetes controller operator

Your own Kubernetes controller - Laying out the work

It’s hard nowadays to ignore Kubernetes. It has become the ubiquitous platform of choice to deploy containerized applications. In a few years, Kubernetes has entrenched itself deeply in the DevOps landscape under the tutelage of the Cloud Native Computing Foundation. One could speculate about the reasons. IMHO, one very compelling argument is that it allows users to be independent of the API of a single cloud provider. If you’ve been living under the monopoly of Microsoft on the deskt


Map merge and compute, hidden API diamonds

If you’ve been working in Java since 'quite some time', you probably are experienced in using Map objects. One very frequent use-case is to check if a Map contains a value: Get the valueIf the value is null, put an initial value.If isn’t, transform the get value and put the new value into the map under the same key Map<String, Integer> map = new HashMap<>(); // ... Integer value = map.get(key); if (value == null) { map.put(key, 1); } else { map.put(key, ++valu

Kubernetes container initialization configuration

The versatility of Kubernetes' initContainer

There are a lot of different ways to configure containers running on Kubernetes: Environment variablesConfig mapsVolumes shared across multiple podsArguments passed to scheduled podsetc. Those alternatives fit a specific context, with specific requirements. For example, none of them allow you to clone a Git repository before the container starts. It would be possible to design that feature into the image itself. Yet, that would introduce coupling, and defeat the Single Responsibility principl

stream processing Jet sources sinks

Stream processing: sources and sinks

This is the 3rd post in the Stream Processing focus series. Last week, we had a look at how stream processing could help us compute mathematical approximations using Hazelcast Jet. We described the Pipeline API, and mentioned that it drew from a source and drained to a sink. This week, I’d like to detail those concepts, what out-of-the-box sinks and sources are available in Jet, and how to create your own should the need be.