Monthly Archives: November 2015

Clone , Shallow and Deep Copy

 

 

The default Object.clone() is indeed a shallow copy. However, it’s designed to throw a CloneNotSupportedException unless your object implements Cloneable.

And when you implement Cloneable, you should override clone() to make it do a deep copy, by calling clone() on all fields that are themselves cloneable.

Hadoop System Environment Variables

JAVA_HOME=/usr/local/java/jdk1.8.0_66
PATH=$PATH:$JAVA_HOME/bin
JRE_HOME=/usr/local/java/jre1.8.0_66
PATH=$PATH:$JRE_HOME/bin
HADOOP_INSTALL=/usr/local/hadoop

# — HADOOP ENVIRONMENT VARIABLES START — #

export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS=”-Djava.library.path=$HADOOP_HOME/lib”
export HADOOP_OPTS=$HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/native
# — HADOOP ENVIRONMENT VARIABLES END — #

PATH=$PATH:$HADOOP_INSTALL/bin
export JAVA_HOME
export JRE_HOME
export PATH
export HADOOP_INSTALL

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS=”-Djava.library.path=$HADOOP_HOME/lib”
export HADOOP_OPTS=”$HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/native”
export JAVA_HOME

# Add following hostname and their ip in host table
10.12.32.110    HadoopMaster
10.12.32.109    HadoopSlave1