@Private
public class PersistentLongFile
extends java.lang.Object
long value. The file is updated atomically
and durably (i.e fsynced).| Constructor | Description |
|---|---|
PersistentLongFile(java.io.File file,
long defaultVal) |
| Modifier and Type | Method | Description |
|---|---|---|
long |
get() |
|
static long |
readFile(java.io.File file,
long defaultVal) |
|
void |
set(long newVal) |
|
static void |
writeFile(java.io.File file,
long val) |
Atomically write the given value to the given file, including fsyncing.
|
public PersistentLongFile(java.io.File file,
long defaultVal)
public long get()
throws java.io.IOException
java.io.IOExceptionpublic void set(long newVal)
throws java.io.IOException
java.io.IOExceptionpublic static void writeFile(java.io.File file,
long val)
throws java.io.IOException
file - destination fileval - value to writejava.io.IOException - if the file cannot be writtenpublic static long readFile(java.io.File file,
long defaultVal)
throws java.io.IOException
java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.