Monthly Archives: January 2017

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!


第一种: Map map = new HashMap(); Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) {     Map.Entry entry = (Map.Entry);     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!