GiraffaFS / giraffa

Giraffa FileSystem (Slack: giraffa-fs.slack.com)
https://giraffa.ci.cloudbees.com
Apache License 2.0
17 stars 6 forks source link

Eliminate redundant now() methods #102

Closed shvachko closed 9 years ago

shvachko commented 9 years ago

One in BlockManagementAgent, another in NamespaceProcessor, and a bunch of direct use of o.a.h.u.Time.now(). I propose to do static import of o.a.h.u.Time.now(), and use now() in the code. That way it will be easy to replace it with giraffa impl. of now() if needed.

octo47 commented 9 years ago

There is another similar thing in hbase org.apache.hadoop.hbase.util.EnvironmentEdgeManager and it provides org.apache.hadoop.hbase.util.EnvironmentEdge. This interface has a couple of useful implementations to make it possible to control time. HBase uses this EnvironmentEdge in many places, so we can write tests with controlled timestamps, that is good for testing edge situations of eventual consistency in our storage.

shvachko commented 9 years ago

I just removed the now() methods and imported Time.now() from hadoop. See branch issue-102 for review. Good to know about HBase EnvironmentEdge Andrey. Funny how every project has same tools.

shvachko commented 9 years ago

Got an approval from Plamen for this.

shvachko commented 9 years ago

Just committed.