Home » Java

Java

Java 13: Enhancements to Switch Expressions

You may remember from my previous post that, in Java 12, the traditional switch statement was enhanced so that it could be used as an expression. In Java 13, there has been a further change to this feature. The break statement can no longer return a value. Instead, you have to use the new yield statement, as shown below: 01 ...

Read More »

AtomicInteger on Java and Round-Robin

java-interview-questions-answers

AtomicInteger belongs to the family of Atomic Variables. The main benefit is that using it, is not blocking instead of doing a blocking synchronization, thus you avoid the suspension and rescheduling of thread. The AtomicInteger is based on the Compare and Swap mechanism and is part of the scalar group of the atomic variables. Our first use case would be a ...

Read More »

Restoring Cassandra Priam Backup With sstableloader

I’ve previously written about setting up Cassandra and Priam for backup and cluster management. The example that I gave for backup restore there, however, is not applicable in every situation – it may not work on a completely separate cluster, for example. Or in case of partial restore to just one table, rather than the whole database. In such cases ...

Read More »

SQL as a Service

java-interview-questions-answers

I’ve been thinking about this since 2007, somewhere around the time S3 was launched by Amazon. I even tried to implement it a few times, but failed right after the design phase. I’ve heard about a startup, which tried to do it too, but also failed. I’m still not sure whether it’s possible to do, but it could definitely become ...

Read More »

Apache Ivy 2.5.0 released

java-interview-questions-answers

This week, we released 2.5.0 version of Apache Ivy. Apache Ivy is a build dependency manager that is integrated with the Apache Ant build tool. The download is available as usual at https://ant.apache.org/ivy/download.cgi. This 2.5.0 version comes after a long gap in releases of Ivy. 2.4.0 was released way back on December 26 2014. After that, the project has seen ...

Read More »

Stream Big Data with Apache Kafka Integration

java-interview-questions-answers

Apache Kafka is being increasingly integrated into a variety of systems and solutions, from filtering and processing large amounts of data real-time, to logging and creating metric data into a centralized handler from different sources. Using CData Sync, such solutions can easily be applied to any CRM, ERP or Analytics software. Configuring Apache Kafka Destination for CData Sync Setting up the ...

Read More »

Benchmark for new string methods of Java 11

While I was checking what’s new in Java 11, I saw that there are several new methods for String class. So I wanted to do a microbenchmark with old way of doing things and by using new methods. These new methods are; boolean isBlank() String strip() Stream lines() isBlank() is tested agains trim().isEmpty(), strip() is tested agains trim() and lines() ...

Read More »

Spring Boot Microservices , Docker and Kubernetes workshop – part3

In the previous posts we build few micro services (Order Service, Product Service, Customer Service) for an order management system using Docker and Spring Boot. We used Netflix libraries to manage, discover and load balance the micro services. Managing these micro services and their multiple containers could get a bit tricky; especially in terms of Scalability, Observability, Security, Monitoring and ...

Read More »

Locks In Java

A lock is a thread synchronization mechanism like synchronized blocks. Locks are implemented internally using synchronized blocks. Therefore, we can use locks instead of synchronized keywords in Java. A Lock is more flexible and more sophisticated than a synchronized block. From Java 5 version, JDK provides several implementations of locks, like ReentrantReadWriteLock, ReentrantLock, and StampedLock, etc. 1. Differences between Synchronization ...

Read More »