@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
IOException
public void set(long newVal) throws IOException
IOException
public 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
IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.