@InterfaceAudience.Private public class BestEffortLongFile extends Object implements Closeable
long
value, but does not make any effort to make it truly durable. This is in
contrast to PersistentLongFile which fsync()s the value on every
change.
This should be used for values which are updated frequently (such that
performance is important) and not required to be up-to-date for correctness.
This class also differs in that it stores the value as binary data instead
of a textual string.| Constructor and Description |
|---|
BestEffortLongFile(File file,
long defaultVal) |
public BestEffortLongFile(File file, long defaultVal)
public long get()
throws IOException
IOExceptionpublic void set(long newVal)
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2013 Apache Software Foundation. All rights reserved.