Compressing File in snappy Format in Hadoop - Java Program
This post shows how to compress an input file in snappy format in Hadoop. The Java program will read input file from the local file system and copy it to HDFS in compressed snappy format. Input file...
View ArticleHow to Compress Intermediate Map Output in Hadoop
In order to speed up the MaReduce job it is helpful to compress the intermediate map output in Hadoop. Since output of the map phase is- Stored to disk. Mapper output is transferred to the reducers on...
View ArticleHow to Compress MapReduce Job Output in Hadoop
You can choose to compress the output of a Map-Reduce job in Hadoop. You can configure to do it for all the jobs in a cluster or you can set properties for specific jobs. Configuration parameters for...
View ArticleMain Thread in Java
When a Java program starts one thread starts running immediately that thread is known as main thread in Java.If you run the following program where you have not created any thread, still on printing...
View ArticlePrinting Numbers in Sequence Using Threads - Java Program
This post shows how you can print numbers in sequence using three threads in Java. If there are three threads thread1, thread2 and thread3 then numbers should be printed alternatively by these threads...
View ArticleHow to Configure And Use LZO Compression in Hadoop
In this post we’ll see how to configure and use LZO compression in Hadoop. Since LZO is GPL licensed it doesn't come bundled with Hadoop installation. You will have to install it separately. By...
View ArticleConstructor Chaining in Java
In case when we have a hierarchy of classes (in case of inheritance) it is important to know the order in which constructors for the classes are executed. That order is known as constructor chaining in...
View Articlesuper in Java
The super keyword in java is essentially a reference variable that can be used to refer to class' immediate parent class.Usage of super in JavaInvoke the constructor of the super class.Accessing the...
View ArticleJava Automatic Numeric Type Promotion
In Java numeric promotion happens automatically in case of primitive types when those primitives are used in an expression.As example byte a = 100; byte b = 50; int i = a * b; in the above code a * b...
View ArticleJava Pass by Value or Pass by Reference
Parameter passing in Java is pass by value or pass by reference is one question which causes a bit of confusion so let's try to clarify it in this post. Before going into whether Java is pass by value...
View ArticleConstructor Overloading in Java
Like method overloading in Java there is also an option to have multiple constructors within the same class where the constructors differ in number and/or types of parameters, that process is known as...
View ArticleConverting String to Byte Array - Java Program
In this post we'll see a Java program to convert a String to byte array and vice versa.String class has getBytes() method which can be used to convert String to byte array in Java.getBytes() - Encodes...
View ArticleConverting String to int - Java Program
While working on an application there are several instances when you want to convert a string to int because-Your web application page takes every thing as string and later you convert values to int...
View ArticleJava OOP Interview Questions
In this post some of the Java OOP Questions are listed. This compilation will help the Java developers in preparing for their interviews.What is encapsulation?Encapsulation means keeping together the...
View Articlethis in Java
this in java is a reference to the current object on which the method or constructor was invoked. this can be used inside any method or constructor to refer to the current object. If the definition is...
View ArticleAssociation, Aggregation And Composition in Java
When you model a system you can see that most of the classes collaborate with each other in many ways. In object-oriented modelling there are broadly three kind of relationships....
View ArticleClass in Java
In object-oriented terms class provides a blue print for the individual objects created from that class.Once a class is defined it can be used to create objects of that type, thus it can be said that...
View ArticleObject in Java
In object-oriented terms object is an instance of the class, which gets its state and related behavior from the class. As explained in the post Class in Java when a new class is created essentially a...
View ArticleMethod Overriding in Java
In a parent-child relation between classes, if a method in subclass has the same signature as the parent class method then the method is said to be overridden by the subclass and this process is called...
View ArticleMethod Overloading in Java
When two or more methods with in the same class or with in the parent-child relationship classes, have the same name but the parameters are different in types or number, the methods are said to be...
View Article