How to convert an ArrayList containing Integers to primitive int array?

public static int[] convertIntegers(List integers) { int[] ret = new int; for (int i=0; i < ret.length; i++) { ret = integers.get(i).intValue(); } return ret; } Google Guava: List list = ...; int[] values =... Read More | Share it now!

UGI – UserGroupInformation

Using user group information for hadoop job submitting. UserGroupInformation ugi = UserGroupInformation.createRemoteUser("hdfs"); try { ugi.doAs(new PrivilegedExceptionAction() { public Void run()... Read More | Share it now!

DistributedCache Hadoop

Create a util for adding jar to distributed cache. path: local jar path conf: hadoop conf private static void addJarToDistributedCache( String path, Configuration conf) throws IOException { File jarFile = new... Read More | Share it now!

Hashing issue between guava versions

I was using guava 14 to do String hashing like so: Hashing.sha256().newHasher().putString("String").hash().toString(); => 4d1ca6dce72e20ce214b706168340683bb6b571a7c977c1a9fe029a1cc1c4d06 just upgraded to guava16, calling this... Read More | Share it now!

HashMap遍历的两种方式

第一种: Map map = new HashMap(); Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) {     Map.Entry entry = (Map.Entry) iter.next();     Object key = entry.getKey();     Object val = entry.getValue(); }... Read More | Share it now!

uname-Print Linux info

NAME      uname — Print operating system name SYNOPSIS      uname DESCRIPTION      The uname utility writes symbols representing one or more system charac-      teristics to the standard output.      The following options are... Read More | Share it now!

how to use ssh to run shell script on a remote machine?

ssh user@host <<'ENDSSH' #commands to run on remote host ENDSSH ... Read More | Share it now!

java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.()V

java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.()V from class org.apache.hadoop.mapred.FileInputFormat at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:312) at... Read More | Share it now!

Upgrade’s application-identifier entitlement string does not match installed application -> rejecting upgrade

Remove the app on your device.   http://stackoverflow.com/questions/31678568/upgrades-application-identifier-entitlement-string-does-not-match-installed-app ... Read More | Share it now!

bdutil

bdutil bdutil is a command-line script used to manage Hadoop instances on Google Compute Engine. bdutil manages deployment, configuration, and shutdown of your Hadoop instances. Requirements bdutil depends on the Google Cloud SDK. bdutil is supported... Read More | Share it now!