public class RootBlockUtility extends Object
Modifier and Type | Field and Description |
---|---|
IRootBlockView |
rootBlock
The current root block.
|
IRootBlockView |
rootBlock0
The 1st root block.
|
IRootBlockView |
rootBlock1
The 2nd root block.
|
Constructor and Description |
---|
RootBlockUtility(BufferMode bufferMode,
int offsetBits,
long createTime,
long quorumToken,
UUID storeUUID)
Generate the root blocks.
|
RootBlockUtility(IReopenChannel<FileChannel> opener,
File file,
boolean validateChecksum,
boolean alternateRootBlock,
boolean ignoreBadRootBlock) |
RootBlockUtility(IRootBlockView rb0,
IRootBlockView rb1) |
Modifier and Type | Method and Description |
---|---|
IRootBlockView |
chooseRootBlock()
Return the chosen root block.
|
static IRootBlockView |
chooseRootBlock(IRootBlockView rootBlock0,
IRootBlockView rootBlock1)
Return the chosen root block.
|
static IRootBlockView |
chooseRootBlock(IRootBlockView rootBlock0,
IRootBlockView rootBlock1,
boolean alternateRootBlock,
boolean ignoreBadRootBlock)
Return the chosen root block.
|
static void |
main(String[] args)
Dumps the root blocks for the specified file.
|
public final IRootBlockView rootBlock0
public final IRootBlockView rootBlock1
public final IRootBlockView rootBlock
public RootBlockUtility(IReopenChannel<FileChannel> opener, File file, boolean validateChecksum, boolean alternateRootBlock, boolean ignoreBadRootBlock) throws IOException
opener
- file
- validateChecksum
- alternateRootBlock
- When true
, the alternate root block will be
chosen. This flag only makes sense when you have two root
blocks to choose from and you want to choose the other one.ignoreBadRootBlock
- When true
, a bad root block will be ignored.IOException
Options.ALTERNATE_ROOT_BLOCK
,
Options.IGNORE_BAD_ROOT_BLOCK
public RootBlockUtility(IRootBlockView rb0, IRootBlockView rb1)
public RootBlockUtility(BufferMode bufferMode, int offsetBits, long createTime, long quorumToken, UUID storeUUID)
bufferMode
- offsetBits
- createTime
- quorumToken
- storeUUID
- public static IRootBlockView chooseRootBlock(IRootBlockView rootBlock0, IRootBlockView rootBlock1)
commit counter
is chosen by
default.
Note: For historical compatibility, rootBlock1
is chosen if
both root blocks have the same IRootBlockView.getCommitCounter()
.
rootBlock0
- Root block 0 (may be null
if this root block is bad).rootBlock1
- Root block 1 (may be null
if this root block is bad).RuntimeException
- if no root block satisfies the criteria.public IRootBlockView chooseRootBlock()
commit counter
is chosen by
default.
Note: For historical compatibility, rootBlock1
is chosen if
both root blocks have the same IRootBlockView.getCommitCounter()
.
RuntimeException
- if no root block satisfies the criteria.public static IRootBlockView chooseRootBlock(IRootBlockView rootBlock0, IRootBlockView rootBlock1, boolean alternateRootBlock, boolean ignoreBadRootBlock)
commit counter
is chosen by
default.
Note: For historical compatibility, rootBlock1
is chosen if
both root blocks have the same IRootBlockView.getCommitCounter()
.
rootBlock0
- Root block 0 (may be null
if this root block is
bad).rootBlock1
- Root block 1 (may be null
if this root block is
bad).alternateRootBlock
- When true
, the alternate root block will be
chosen. This flag only makes sense when you have two root
blocks to choose from and you want to choose the other one.ignoreBadRootBlock
- When true
, a bad root block will be ignored.RuntimeException
- if no root block satisfies the criteria.public static void main(String[] args) throws IOException
args
- filename
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.