RSS

Category Archives: java

How to decrease the Maven build time of your Java projects


There are good resources on the web that shows how you can decrease the Maven build times of Java projects, but since I couldn’t find the following information in most of them, I wanted to note this down for future reference. One of the simplest things you can do to decrease the Maven build time is to add the following to your command line:

-Dmaven.javadoc.skip=true

But is it worth it? Let’s check. Take an example project such as Hadoop that is about 2 million lines of source code. Without skipping the generation of Javadoc, Read the rest of this entry »

 
2 Comments

Posted by on May 23, 2016 in java, Programlama

 

Tags: , ,

How to comment your code: an example from Hadoop


How to comment your source code? This topic comes up every once in a while, and sometimes it leads to heated discussions. The consensus is something like “comment why, and not how”. Useful as it seems, I think it is important to give examples from real-world scenarios. So, let’s look at such a case.

I’ve been working on the integration between Hadoop and HGST Active Archive S3 Object Storage product recently, and while dealing with the internals of the S3A File System that we are improving at the company, as well its interaction with YARN,  I’ve come across an interesting piece of code in the Hadoop code base. Before going into its details, look at it without any comments:

Read the rest of this entry »

 
Leave a comment

Posted by on March 11, 2016 in java, Programlama

 

Tags: , , ,

Book review: Java Performance


9780137142521Drinking from the Firehose

Even though the Java platform (along with JVM) is one of the most ubiquotus software develoment platforms, it was surprisingly difficult to find a self-contained book dedicated to performance aspects of Java platform. “Java Performance” by Charlie Hunt and Binu John can be considered the only solid and contemporary reference in the domain of performance analysis and tuning of Java based systems. No matter which programming language you use to run on JVM, this book is the essential reference until something better comes along.

On the other hand, make no mistake, this is not a lightweight book, or a cookbook which you can consult for a few performance tuning recipes. Reading Java Performance is more like drinking from the firehose. Whether you are a beginner, or a seasoned developer, it will take time to digest the gory details presented. Luckily, the book’s logical organization is close to perfect and some of the chapters are pretty self-contained.

From start to finish, it is not difficult to see that if you want to consider yourself a serious Java performance engineer, you need to master the majority of the book. Chapter 2 starts with an overview of the basics of operating systems performance and monitoring, setting the stage for the upcoming chapters and acting as a refresher. The authors are very careful to explain concepts concretely by giving examples from Linux, Solaris and MS Windows systems, which makes sense given the portability of JVM. Chapter 3 and 4, if taken together, provide the most comprehensive technical explanation of Java Virtual Machine and Just-in Time compilation from a performance perspective. Even if you are not facing performance problems (yet), this two chapters make a very solid and clear reference for understanding JVM and JIT technology. The terminology, concepts and details in these chapters are very important: Without a solid understanding of them, it is not easy to understand the discussions in the following chapters.

Read the rest of this entry »

 
Leave a comment

Posted by on December 8, 2013 in Books, java, Programlama

 

Tags: , , , ,

Java 8, Lambda Expressions and the Psychology of the Masters of the Universe (devoxx style)


A quick quiz: Take a look at the words / phrases below and tell me in what kind of talk can you hear them?

scary, scared, lazy, don’t want to scare, risk, risky, ivory tower, functional, real life, scary, no functional, reality, customers, complex

Those are some of the words I remember from the keynote given by Mark Reinhold and Brian Goetz, and titled “Java 8 and Beyond” at Devoxx 2013 conference. And I think this fact shows the real and biggest difference between designing a programming language and marketing one.

Let me explain: Devoxx, which does not need much introduction, is the biggest Java conference in Europe, including anything related to Java, JVM, Android, languages running on JVM (and even Microsoft, this year). Close to 4000 Java developers, as well as team leads, and software project managers come together from all over the world for 5 days. And just like Devoxx, Brian Goetz, one of the keynote speakers, does not need much introduction: He is a Java and concurrency expert, having written one of the best books in this field, and  serving many JCP Expert Groups and working at Oracle as the Java Language Architect. In other words, when a heavyweight Java expert such as Goetz gives a keynote at a conference such as Devoxx, and talks about the upcoming version of Java 8, and stressing features such as lambda expressions and streams, thousands of developers do listen, and they listen very carefully.

So far, so good. But there is one thing surprising. Some of those developers, I, for example, feel like listening to the aspects of human psychology and the finer points of marketing to the masses, albeit technical masses. The reasons I felt like that can be summarized as the following:

devoxx_java8_1 Read the rest of this entry »

 

Tags: , , , , , , , , , , ,

Book review: The Well-Grounded Java Developer: Vital techniques of Java 7 and polyglot programming


Very well balanced in its breadth, somehow lacking in depthwell_grounded_java

If you have ever had the chance to witness the live performance of the authors, you know what a dynamic duo they are, taking a no-nonsense, pragmatic and very down to earth attitude towards the perils and treasures of modern day Java development. It is easy to see that almost every page of ‘The Well-Grounded Java Developer: Vital techniques of Java 7 and polyglot programming‘ is full of that energy.

The world of Java development is wide and this book is very well-balanced in its selection of topics. In other words, almost any serious Java development team would welcome a new developer well versed in the topics of this book, or to put it differently, unless you don’t know much about most of those topics, do not consider yourself fit for a sharp and focused Java development team. Read the rest of this entry »

 
2 Comments

Posted by on September 30, 2013 in Books, java, Programlama

 

Tags: , , , , , , , ,

Does GWT (Google Web Toolkit) support Java 7 constructs?


The short answer is: No, as of version 2.5.1. If you’re building web applications with GWT and try to use Java 7 constructs, be careful. A few days ago I was bitten by a nasty surprise when I tried to write use Strings in a switch statement, for demonstration purposes please see the code below that I have adapted from the Hello World example of GWT in Action:

The code above compiles perfectly fine with the latest version of GWT, Eclipse and Java 7, but if you try to run in using the Development Mode, instead of the expected output in your web browser window, you will get run-time error in Eclipse: Read the rest of this entry »

 
2 Comments

Posted by on September 17, 2013 in java, Programlama

 

Tags: , , , , , , ,

Book review: “RabbitMQ in Action: Distributed Messaging for Everyone”


rabbitVery high Signal to Noise Ratio, in other words a treasure trove of information

Some technical authors have a very formal, dry style when presenting useful information, whereas some become too friendly, informal and get lost in jokes and jargon, forgetting that the main purpose is to convey concepts and techniques as clearly as possible. This book is important and valuable because it combines a friendly, informal style with a mentality that always keeps presenting information clearly as the main objective.

One of the nice things about the book is that it does not assume the reader to know anything about messaging technologies, enterprise service buses and other concepts. It starts with a short history of messaging middleware, presents ‘why’s as well as ‘how’s and then describes how RabbitMQ came to be. Giving the reader a well-founded context is important for future explanations and discussions, not only particularly for RabbitMQ but for messaging challenges in general. Read the rest of this entry »

 
Leave a comment

Posted by on September 15, 2013 in Books, Erlang, java, Programlama

 

Tags: , , , , ,