Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase, mail # user - how to get the timestamp of hfile, like when it's generated.


Copy link to this message
-
RE: how to get the timestamp of hfile, like when it's generated.
Ramkrishna.S.Vasudevan 2012-10-17, 04:06
Hi Yun Peng

You want to know the creation time? I could see the getModificationTime()
api.  Internally it is used to get a store file with minimum timestamp.
I have not tried it out.  Let me know if it solves your purpose.
Just try it out.

Regards
Ram
> -----Original Message-----
> From: yun peng [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 17, 2012 1:55 AM
> To: [EMAIL PROTECTED]
> Subject: how to get the timestamp of hfile, like when it's generated.
>
> Hi, All
> Given ``hfile`` in ``hbase`` is immutable, I want to know the timestamp
> like when the ``hfile`` is generated. Does ``hbase`` have API to allow
> user-applications to know this? I  need to know in postCompact() stage.
>
> As a first attempt, I have tried using
> ``StoreFile.getBulkLoadTimestamp()``. By following code snippet, I
> constantly get ``NullPointerException``.
>   public void postCompact(ObserverContext<RegionCoprocessorEnvironment>
> c,
> Store store, StoreFile resultFile) {
>     if(resultFile == null) {
>         return;
>     }
>     int timestampLastCompact = resultFile.getBulkLoadTimestamp();
>     ...
>   }
>
> Any ideas are appreciated. Thanks.
> Yun