You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using 3.3-EA the method returns values like 314897071 which does not seem like a plausible access time in any imaginable unit
similarly all other time values in entryview return something unusable
creationTime=314894976,expirationTime=0,hits=53,lastAccessTime=314897071,lastStoredTime=0,lastUpdateTime=314896015,version=16,evictionCriteriaNumber=53,ttl=0
The text was updated successfully, but these errors were encountered:
@Test
public void testIssue2581() throws Exception {
long startTime = new Date().getTime();
IMap<String, String> map = createHazelcastInstance().getMap("map");
map.put("foo", "bar");
EntryView<String, String> foo = map.getEntryView("foo");
assertTrue(foo.getCreationTime() >= startTime);
}
The reason is the MapService uses System.nanoTime() to set a timestamps and entryView treat it as "number of nanoseconds since epoch". However the JavaDoc in System::nanoTime() says:
"This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time. The value returned represents nanoseconds since some fixed but arbitrary origin time (perhaps in the future, so values may be negative)."
Therefore nanoTime() cannot be used to obtain a (global) timestamp.
using 3.3-EA the method returns values like 314897071 which does not seem like a plausible access time in any imaginable unit
similarly all other time values in entryview return something unusable
creationTime=314894976,expirationTime=0,hits=53,lastAccessTime=314897071,lastStoredTime=0,lastUpdateTime=314896015,version=16,evictionCriteriaNumber=53,ttl=0
The text was updated successfully, but these errors were encountered: