Member since
10-07-2015
8
Posts
4
Kudos Received
0
Solutions
06-21-2016
09:05 AM
1 Kudo
@milind pandit You can get access time using FileStatus#getAccessTime() as follows: public class HdfsAtime {
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
public static void main(String[] args) throws IOException {
FileSystem fs = FileSystem.get(new Configuration());
printFileStatus(fs, new Path(args[0]));
fs.close();
}
private static void printFileStatus(FileSystem fs, Path root) throws IOException {
FileStatus[] fss = fs.listStatus(root);
for (FileStatus status : fss) {
if (status.isDirectory()) {
printFileStatus(fs, status.getPath());
} else {
System.out.println(
sdf.format(new Date(status.getAccessTime())) + " "
+ sdf.format(new Date(status.getModificationTime())) + " "
+ Path.getPathWithoutSchemeAndAuthority(status.getPath()));
}
}
}
}
And, in order to enable access time, you may need to set dfs.namenode.accesstime.precision an appropriate value (set 0 by HDP default). <property>
<name>dfs.namenode.accesstime.precision</name>
<value>3600000</value>
</property>
... View more
06-20-2016
06:20 AM
3 Kudos
Are you running the command from HBase shell? You don't need to run HBase shell but just run the command from Unix (or Windows) shell. > /usr/bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=',' -Dimporttsv.columns='HBASE_ROW_KEY,temp:in,temp:out,vibration,pressure:in,pressure:out' t2 user/hbase.csv
... View more
06-08-2016
08:36 AM
@Roberto Sancho When you use double quotes for enclosing character, you have to escape '$' such as '\$'. So, please try: --query "SELECT (....) WHERE \$CONDITIONS AND (...)"
... View more
06-08-2016
03:28 AM
HConstants.FOREVER is now defined as follows: /**
* Unlimited time-to-live.
*/
// public static final int FOREVER = -1;
public static final int FOREVER = Integer.MAX_VALUE;
So, you can specify 'FOREVER' for TTL by: create 't1', {NAME => 'f1', TTL => 2147483647} or create 't1', {NAME => 'f1', TTL => 0x7fffffff}
... View more