@InterfaceAudience.Private public class PersistentLongFile extends Object
long value. The file is updated atomically
and durably (i.e fsynced).| Constructor and Description |
|---|
PersistentLongFile(File file,
long defaultVal) |
public PersistentLongFile(File file, long defaultVal)
public long get()
throws IOException
IOExceptionpublic void set(long newVal)
throws IOException
IOExceptionpublic static void writeFile(File file, long val) throws IOException
file - destination fileval - value to writeIOException - if the file cannot be writtenpublic static long readFile(File file, long defaultVal) throws IOException
IOExceptionCopyright © 2013 Apache Software Foundation. All rights reserved.