hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nataraj Rashmi - rnatar <Rashmi.Nata...@acxiom.com>
Subject RE: How to get the file creation date/time of a hdfs file using java hdfs API
Date Sun, 04 Nov 2012 23:40:35 GMT
Thank you. Is this is the best way to get the time stamp for a inputSplit also in my mapper?
Basically I have to skip the splits that don't have yesterday's timestamp in my mapper. Can
that be done?

Thanks
Rashmi

-----Original Message-----
From: Harsh J [mailto:harsh@cloudera.com] 
Sent: Sunday, November 04, 2012 5:08 PM
To: user@hadoop.apache.org
Subject: Re: How to get the file creation date/time of a hdfs file using java hdfs API

Rashmi,

Use FileSystem#getFileStatus(Path) [0] and then get the epoch mtime via FileStatus#getModificationTime()
[1]

[0] - http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#getFileStatus(org.apache.hadoop.fs.Path)

[1] - http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileStatus.html#getModificationTime()

On Mon, Nov 5, 2012 at 4:19 AM, Nataraj Rashmi - rnatar <Rashmi.Nataraj@acxiom.com>
wrote:
> Hello,
>
>
>
> What is the best way to get the date a file was created on hdfs using 
> java hdfs API?
>
>
>
> Thanks
>
> Rashmi
>
> **********************************************************************
> ***** The information contained in this communication is confidential, 
> is intended only for the use of the recipient named above, and may be 
> legally privileged.
>
> If the reader of this message is not the intended recipient, you are 
> hereby notified that any dissemination, distribution or copying of 
> this communication is strictly prohibited.
>
> If you have received this communication in error, please resend this 
> communication to the sender and delete the original message or any 
> copy of it from your computer system.
>
> Thank You.
> **********************************************************************
> ******



--
Harsh J

Mime
View raw message