Use this path: System.getProperty("java.io.tmpdir")
Learning Log
Learning Log for Hadoop, Spring, Hibernate, CUDA, Weka and so on.
Monday, May 7, 2018
Thursday, April 12, 2018
java - command not found - Fix for CentOS
Add the following lines after adjusting the path for your system to /etc/.bash_profile
Or simply exporting the following in the given terminal session would also work:
export JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera/bin
export PATH=$PATH:$JAVA_HOME
Or simply exporting the following in the given terminal session would also work:
export JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera/bin
export PATH=$PATH:$JAVA_HOME
Log out and log in if you chose to edit the .bash_profile file. Try by entering java to see if the same error message is thrown or not.
Saturday, September 30, 2017
Steps for Java 8 setup on Cloudera Distribution Hadoop
- Stop Cloudera Management Service
- Stop Cloudera Cluster
- Stop all Cloudera Agents (on all nodes) - sudo service cloudera-scm-agent stop
- Stop the Cloudera Manager Server - sudo service cloudera-scm-server stop
- Download JAVA 8 from Oracle using wget
- Extract the JDK
- gunzip jdk-8u60-linux-x64.tar.gz
- tar -xvf jdk-8u60-linux-x64.tar jdk1.8.0_60/
- Copy the JDK folder to /usr/java/
- Append export JAVA_HOME=/usr/java/jdk1.8.0_60/ to file /etc/default/cloudera-scm-server
- Start Cloudera Manager Server - sudo service cloudera-scm-server start
- Start all Cloudera Manager Agents - sudo service cloudera-scm-agent start
- Navigate to Hosts -> Configuration -> Java Home Directory, and set it to/usr/java/jdk1.8.0_60
- Finally, inside Cloudera Manager page, start the Cluster and the CM service. DONE!
Friday, September 29, 2017
Apache Spark Resource Allocation Guide
This site does a great job at explaining how to divide available resources of every node in a cluster to Spark application in order to harness the full capacity of the cluster.
http://site.clairvoyantsoft.com/understanding-resource-allocation-configurations-spark-application/
Another one!
A 2 part guide by Cloudera Engineering team explaning how to tune Spark-application parameters to achieve optimal performance!
http://blog.cloudera.com/blog/2015/03/how-to-tune-your-apache-spark-jobs-part-1/
https://blog.cloudera.com/blog/2015/03/how-to-tune-your-apache-spark-jobs-part-2/
http://site.clairvoyantsoft.com/understanding-resource-allocation-configurations-spark-application/
Another one!
A 2 part guide by Cloudera Engineering team explaning how to tune Spark-application parameters to achieve optimal performance!
http://blog.cloudera.com/blog/2015/03/how-to-tune-your-apache-spark-jobs-part-1/
https://blog.cloudera.com/blog/2015/03/how-to-tune-your-apache-spark-jobs-part-2/
Friday, September 22, 2017
Some Spring MVC-Javascript Notes
- When there's a page locked to a session and one would like the page to detach from the session if the user navigates to some other page, this can be done by Javascript. JS's 'onunload' event comes pretty hand in situations like these.
- Let's say you make a post request with a modelattribute inside a form. The modelattribute fails to bind because of JavaBeans constraint annotations on the Java entity definition class. This could happen for several reasons. For eg, let's say you had a constraint on the length of the name and the supplied length was smaller than required. The binding shall fail and the BindingResult object shall have the errors. Now, you don't have to reattach the modelattribute to the ModelMap object. All you have to do is to return the String in the requestMapping method and have necessary Spring-error fields ready to display the related binding error.
- There has been this confusion about BindingResult and @InitBinder for quite some time now. In short, modelAttributes bind automatically with the Java object, as long as the fields within are of primary types. When there's a user-defined or complicated object field inside modelattribute class, to help them bind with the received modelAttribute, you need @InitBinder definition, for each one of the complex fields. BindingResult will simply hold all that went wrong while trying to bind the received modelAttribute into a Java object.
Monday, February 13, 2017
Subscribe to:
Posts (Atom)