public class FileMetadata extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CURRENT_VERSION
The current journal version number.
|
protected static boolean |
DEBUG |
File |
file
The file that was opened.
|
static int |
headerSize0
The size of the journal header, including MAGIC, version, and both root
blocks.
|
protected static boolean |
INFO |
protected static org.apache.log4j.Logger |
log
Logger.
|
static int |
MAGIC
Magic value for journal (the root blocks have their own magic value).
|
static int |
OFFSET_ROOT_BLOCK0
Offset of the first root block in the file.
|
static int |
OFFSET_ROOT_BLOCK1
Offset of the second root block in the file.
|
boolean |
readOnly
True iff the file was opened in a read-only mode.
|
IRootBlockView |
rootBlock
The current root block.
|
static int |
VERSION1
The original journal version number (version 1).
|
int |
writeCacheBufferCount
The #of write cache buffers to be used if the write cache is enabled.
|
Modifier and Type | Method and Description |
---|---|
static FileMetadata |
createInstance(Properties properties,
boolean isScaleout,
long quorumToken)
Prepare a journal file for use by an
IBufferStrategy . |
BufferMode |
getBufferMode() |
protected static String |
getProperty(Properties properties,
String name,
String defaultValue) |
protected static <E> E |
getProperty(Properties properties,
String name,
String defaultValue,
IValidator<E> validator) |
String |
getProperty(String name,
String defaultValue)
retrieve the property value from the properties object used to
initialize this object.
|
RandomAccessFile |
getRandomAccessFile()
The interface for IO performed on that file.
|
protected static final org.apache.log4j.Logger log
protected static final boolean INFO
protected static final boolean DEBUG
public static final int MAGIC
public static final int VERSION1
public static final int CURRENT_VERSION
Note: This could be used to create major versioning changes of the file structure. There is only one version to date.
public final File file
public final int writeCacheBufferCount
public final boolean readOnly
public static final int OFFSET_ROOT_BLOCK0
public static final int OFFSET_ROOT_BLOCK1
public static final int headerSize0
public final IRootBlockView rootBlock
public RandomAccessFile getRandomAccessFile()
Note: this method is only safe for use during the initial file create/open. It is not safe to use once a file has been closed, whether directly or by an interrupt during an IO operation.
public static FileMetadata createInstance(Properties properties, boolean isScaleout, long quorumToken)
IBufferStrategy
. The file
will be created if necessary as permitted and instructed by the specified
Options
. The root blocks will be created or read from the file
and verified. A variety of interesting properties are set on the returned
FileMetadata
object.protected static String getProperty(Properties properties, String name, String defaultValue)
protected static <E> E getProperty(Properties properties, String name, String defaultValue, IValidator<E> validator)
public String getProperty(String name, String defaultValue)
public BufferMode getBufferMode()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.