Pages

Saturday, November 9, 2019

Docker container unhealthy

The other day I was just starting all my docker instances by running docker-compose up -d like I often do, but it started failing telling me that some of the containers were unhealthy.


results-db is up-to-date
Starting db cnlts_main-db_1 ...

Starting db cnlts_main-db_1 ... done


ERROR: for cnlts-db-flyway Container "0ab31508826c" is unhealthy.
ERROR: Encountered errors while bringing up the project.


After running docker logs "0ab31508826c" to see what was going on in the container, I noticed this:



initdb: could not create directory "/var/lib/postgresql/data/pg_xlog": No space left on device

So went to the docker preferences page using the docker GUI to try to find the memory allocation in the disk settings

                                 

So there I say that the Disk image size was close to the max. One option was to increase it but I didn't want to do that because it would take unnecessarily more resources from my laptop. I think 64GB is more than enough. So what I just had to do was to delete that file called Docker.raw

The path to that file was written in the gui. I just had to go to that directory and delete it.
rm /Users/<username>/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw 



Sunday, September 1, 2019

Easy versioning explanation




Major: for incompatible API changes,
Minor: for backwards compatible  functionality
Patch: for backwards compatible bug fixes.
pre-release label and metadata:  optional extensions.


Source: https://semver.org/

Sunday, June 16, 2019

Enhance your functional java experience with VAVR

In this video I briefly show some features that Vavr has and Java-8 doesn't.




Code examples: https://github.com/SFRJ/vavrExamples

Tuesday, January 8, 2019

Monday, December 17, 2018

Java Developer interview questions.

I decided to make a compilation of possible interview questions for Java developers. I personally don't really like when in interviews this kind of academically oriented questions appear but unfortunately not every company does live coding exercises.

Hopefully this blog post will be useful as a mind refreshing tool when going to one of those interviews where the interviewer reads questions from a script(sometimes managers or semi-technical tech leads, etc ...) and you have to explain technical things with your own words. 

This compilation are real questions that can appear and they did in fact appear in interviews I've been in, at some point in my career. I will try to include more questions to this video in the future as I remember them.

For Kafka related F.A.Q have a look at
http://javing.blogspot.com/2020/02/kafka-faq.html


What is the equals and hashcode contract in Java?


What is the difference between an ArrayList and a Linked list?


What is the final keyword in java and where it can be used?

Can you describe the inner workings of a Java HashMap?


What is "try with resources" in Java? 


Do you know what "volatile" is?


Can you write code to check if a String is a Palindrome?


How can you reverse a String using Java?


How can you reverse an Integer using Java?

@Component vs @Service vs @Repository



What is database indexing?


Explain asynchronous non blocking calls and what are circuit breakers
                    








Java 8 Refactoring Part 5: Improving enum with a BiFunction

This is the last refactoring that Victor Rentea did in the devoxx conference in London. He used a BiFunction to be able to provide more flexibility to an Enum. A very interesting refactor.



Thursday, December 13, 2018

Java 8 Refactoring Part 4: Composition Over Inheritance using the Loan Design Pattern

The Loan design pattern is a pattern that follows the principle of favouring composition over inheritance. It was explained in the Devoxx conference in London.



Share with your friends