You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by Ramasubramanian Narayanan <ra...@gmail.com> on 2013/09/05 07:28:34 UTC

How to update the timestamp of a file in HDFS

Hi,

Can you please help on to update the date & timestamp of a file in HDFS.

regards,
Rams

Re: How to update the timestamp of a file in HDFS

Posted by Harsh J <ha...@cloudera.com>.
Murali,

The touchz creates a zero sized file. It does not allow modifying a
timestamp like Linux's touch command does, which is what the OP seems
to be asking about.

On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy
<mu...@gmail.com> wrote:
> right usage of command is:
>
> hadoop fs - touchz filename
>
>
> On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy <mu...@gmail.com>
> wrote:
>>
>> Hi ,
>>
>> Try this "touchz" hadoop command.
>>
>> hadoop -touchz filename
>>
>>
>> Thanks and Regards,
>> Adi Reddy Murali
>>
>>
>> On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:
>>>
>>> There's no shell command (equivalent to Linux's touch) but you can use
>>> the Java API:
>>> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>>>
>>> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
>>> <ra...@gmail.com> wrote:
>>> > Hi,
>>> >
>>> > Can you please help on to update the date & timestamp of a file in
>>> > HDFS.
>>> >
>>> > regards,
>>> > Rams
>>>
>>>
>>>
>>> --
>>> Harsh J
>>
>>
>



-- 
Harsh J

Re: How to update the timestamp of a file in HDFS

Posted by Harsh J <ha...@cloudera.com>.
Murali,

The touchz creates a zero sized file. It does not allow modifying a
timestamp like Linux's touch command does, which is what the OP seems
to be asking about.

On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy
<mu...@gmail.com> wrote:
> right usage of command is:
>
> hadoop fs - touchz filename
>
>
> On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy <mu...@gmail.com>
> wrote:
>>
>> Hi ,
>>
>> Try this "touchz" hadoop command.
>>
>> hadoop -touchz filename
>>
>>
>> Thanks and Regards,
>> Adi Reddy Murali
>>
>>
>> On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:
>>>
>>> There's no shell command (equivalent to Linux's touch) but you can use
>>> the Java API:
>>> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>>>
>>> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
>>> <ra...@gmail.com> wrote:
>>> > Hi,
>>> >
>>> > Can you please help on to update the date & timestamp of a file in
>>> > HDFS.
>>> >
>>> > regards,
>>> > Rams
>>>
>>>
>>>
>>> --
>>> Harsh J
>>
>>
>



-- 
Harsh J

Re: How to update the timestamp of a file in HDFS

Posted by Harsh J <ha...@cloudera.com>.
Murali,

The touchz creates a zero sized file. It does not allow modifying a
timestamp like Linux's touch command does, which is what the OP seems
to be asking about.

On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy
<mu...@gmail.com> wrote:
> right usage of command is:
>
> hadoop fs - touchz filename
>
>
> On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy <mu...@gmail.com>
> wrote:
>>
>> Hi ,
>>
>> Try this "touchz" hadoop command.
>>
>> hadoop -touchz filename
>>
>>
>> Thanks and Regards,
>> Adi Reddy Murali
>>
>>
>> On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:
>>>
>>> There's no shell command (equivalent to Linux's touch) but you can use
>>> the Java API:
>>> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>>>
>>> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
>>> <ra...@gmail.com> wrote:
>>> > Hi,
>>> >
>>> > Can you please help on to update the date & timestamp of a file in
>>> > HDFS.
>>> >
>>> > regards,
>>> > Rams
>>>
>>>
>>>
>>> --
>>> Harsh J
>>
>>
>



-- 
Harsh J

Re: How to update the timestamp of a file in HDFS

Posted by Harsh J <ha...@cloudera.com>.
Murali,

The touchz creates a zero sized file. It does not allow modifying a
timestamp like Linux's touch command does, which is what the OP seems
to be asking about.

On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy
<mu...@gmail.com> wrote:
> right usage of command is:
>
> hadoop fs - touchz filename
>
>
> On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy <mu...@gmail.com>
> wrote:
>>
>> Hi ,
>>
>> Try this "touchz" hadoop command.
>>
>> hadoop -touchz filename
>>
>>
>> Thanks and Regards,
>> Adi Reddy Murali
>>
>>
>> On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:
>>>
>>> There's no shell command (equivalent to Linux's touch) but you can use
>>> the Java API:
>>> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>>>
>>> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
>>> <ra...@gmail.com> wrote:
>>> > Hi,
>>> >
>>> > Can you please help on to update the date & timestamp of a file in
>>> > HDFS.
>>> >
>>> > regards,
>>> > Rams
>>>
>>>
>>>
>>> --
>>> Harsh J
>>
>>
>



-- 
Harsh J

Re: How to update the timestamp of a file in HDFS

Posted by murali adireddy <mu...@gmail.com>.
right usage of command is:

hadoop fs - touchz filename


On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy
<mu...@gmail.com>wrote:

> Hi ,
>
> Try this "touchz" hadoop command.
>
> hadoop -touchz filename
>
>
> Thanks and Regards,
> Adi Reddy Murali
>
>
> On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:
>
>> There's no shell command (equivalent to Linux's touch) but you can use
>> the Java API:
>> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>>
>> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
>> <ra...@gmail.com> wrote:
>> > Hi,
>> >
>> > Can you please help on to update the date & timestamp of a file in HDFS.
>> >
>> > regards,
>> > Rams
>>
>>
>>
>> --
>> Harsh J
>>
>
>

Re: How to update the timestamp of a file in HDFS

Posted by murali adireddy <mu...@gmail.com>.
right usage of command is:

hadoop fs - touchz filename


On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy
<mu...@gmail.com>wrote:

> Hi ,
>
> Try this "touchz" hadoop command.
>
> hadoop -touchz filename
>
>
> Thanks and Regards,
> Adi Reddy Murali
>
>
> On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:
>
>> There's no shell command (equivalent to Linux's touch) but you can use
>> the Java API:
>> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>>
>> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
>> <ra...@gmail.com> wrote:
>> > Hi,
>> >
>> > Can you please help on to update the date & timestamp of a file in HDFS.
>> >
>> > regards,
>> > Rams
>>
>>
>>
>> --
>> Harsh J
>>
>
>

Re: How to update the timestamp of a file in HDFS

Posted by murali adireddy <mu...@gmail.com>.
right usage of command is:

hadoop fs - touchz filename


On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy
<mu...@gmail.com>wrote:

> Hi ,
>
> Try this "touchz" hadoop command.
>
> hadoop -touchz filename
>
>
> Thanks and Regards,
> Adi Reddy Murali
>
>
> On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:
>
>> There's no shell command (equivalent to Linux's touch) but you can use
>> the Java API:
>> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>>
>> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
>> <ra...@gmail.com> wrote:
>> > Hi,
>> >
>> > Can you please help on to update the date & timestamp of a file in HDFS.
>> >
>> > regards,
>> > Rams
>>
>>
>>
>> --
>> Harsh J
>>
>
>

Re: How to update the timestamp of a file in HDFS

Posted by murali adireddy <mu...@gmail.com>.
right usage of command is:

hadoop fs - touchz filename


On Thu, Sep 5, 2013 at 12:14 PM, murali adireddy
<mu...@gmail.com>wrote:

> Hi ,
>
> Try this "touchz" hadoop command.
>
> hadoop -touchz filename
>
>
> Thanks and Regards,
> Adi Reddy Murali
>
>
> On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:
>
>> There's no shell command (equivalent to Linux's touch) but you can use
>> the Java API:
>> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>>
>> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
>> <ra...@gmail.com> wrote:
>> > Hi,
>> >
>> > Can you please help on to update the date & timestamp of a file in HDFS.
>> >
>> > regards,
>> > Rams
>>
>>
>>
>> --
>> Harsh J
>>
>
>

Re: How to update the timestamp of a file in HDFS

Posted by murali adireddy <mu...@gmail.com>.
Hi ,

Try this "touchz" hadoop command.

hadoop -touchz filename


Thanks and Regards,
Adi Reddy Murali


On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:

> There's no shell command (equivalent to Linux's touch) but you can use
> the Java API:
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>
> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
> <ra...@gmail.com> wrote:
> > Hi,
> >
> > Can you please help on to update the date & timestamp of a file in HDFS.
> >
> > regards,
> > Rams
>
>
>
> --
> Harsh J
>

Re: How to update the timestamp of a file in HDFS

Posted by murali adireddy <mu...@gmail.com>.
Hi ,

Try this "touchz" hadoop command.

hadoop -touchz filename


Thanks and Regards,
Adi Reddy Murali


On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:

> There's no shell command (equivalent to Linux's touch) but you can use
> the Java API:
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>
> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
> <ra...@gmail.com> wrote:
> > Hi,
> >
> > Can you please help on to update the date & timestamp of a file in HDFS.
> >
> > regards,
> > Rams
>
>
>
> --
> Harsh J
>

Re: How to update the timestamp of a file in HDFS

Posted by murali adireddy <mu...@gmail.com>.
Hi ,

Try this "touchz" hadoop command.

hadoop -touchz filename


Thanks and Regards,
Adi Reddy Murali


On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:

> There's no shell command (equivalent to Linux's touch) but you can use
> the Java API:
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>
> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
> <ra...@gmail.com> wrote:
> > Hi,
> >
> > Can you please help on to update the date & timestamp of a file in HDFS.
> >
> > regards,
> > Rams
>
>
>
> --
> Harsh J
>

Re: How to update the timestamp of a file in HDFS

Posted by murali adireddy <mu...@gmail.com>.
Hi ,

Try this "touchz" hadoop command.

hadoop -touchz filename


Thanks and Regards,
Adi Reddy Murali


On Thu, Sep 5, 2013 at 11:06 AM, Harsh J <ha...@cloudera.com> wrote:

> There's no shell command (equivalent to Linux's touch) but you can use
> the Java API:
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)
>
> On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
> <ra...@gmail.com> wrote:
> > Hi,
> >
> > Can you please help on to update the date & timestamp of a file in HDFS.
> >
> > regards,
> > Rams
>
>
>
> --
> Harsh J
>

Re: How to update the timestamp of a file in HDFS

Posted by Harsh J <ha...@cloudera.com>.
There's no shell command (equivalent to Linux's touch) but you can use
the Java API: http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)

On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
<ra...@gmail.com> wrote:
> Hi,
>
> Can you please help on to update the date & timestamp of a file in HDFS.
>
> regards,
> Rams



-- 
Harsh J

Re: How to update the timestamp of a file in HDFS

Posted by Harsh J <ha...@cloudera.com>.
There's no shell command (equivalent to Linux's touch) but you can use
the Java API: http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)

On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
<ra...@gmail.com> wrote:
> Hi,
>
> Can you please help on to update the date & timestamp of a file in HDFS.
>
> regards,
> Rams



-- 
Harsh J

Re: How to update the timestamp of a file in HDFS

Posted by Harsh J <ha...@cloudera.com>.
There's no shell command (equivalent to Linux's touch) but you can use
the Java API: http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)

On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
<ra...@gmail.com> wrote:
> Hi,
>
> Can you please help on to update the date & timestamp of a file in HDFS.
>
> regards,
> Rams



-- 
Harsh J

Re: How to update the timestamp of a file in HDFS

Posted by Harsh J <ha...@cloudera.com>.
There's no shell command (equivalent to Linux's touch) but you can use
the Java API: http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#setTimes(org.apache.hadoop.fs.Path,%20long,%20long)

On Thu, Sep 5, 2013 at 10:58 AM, Ramasubramanian Narayanan
<ra...@gmail.com> wrote:
> Hi,
>
> Can you please help on to update the date & timestamp of a file in HDFS.
>
> regards,
> Rams



-- 
Harsh J