public class SnapStream extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SnapStream.StreamMode |
| Modifier and Type | Field and Description |
|---|---|
static String |
ZOOKEEPER_SHAPSHOT_STREAM_MODE |
| Constructor and Description |
|---|
SnapStream() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkSealIntegrity(CheckedInputStream is,
InputArchive ia)
Verify the integrity of the seal, only CheckedInputStream will verify
the checkSum of the content.
|
static CheckedInputStream |
getInputStream(File file)
Return the CheckedInputStream based on the extension of the fileName.
|
static CheckedOutputStream |
getOutputStream(File file,
boolean fsync)
Return the OutputStream based on predefined stream mode.
|
static SnapStream.StreamMode |
getStreamMode() |
static SnapStream.StreamMode |
getStreamMode(String fileName)
Detect the stream mode from file name extension
|
static boolean |
isValidSnapshot(File file)
Verifies that the file is a valid snapshot.
|
static void |
sealStream(CheckedOutputStream os,
OutputArchive oa)
Write specific seal to the OutputArchive and close the OutputStream.
|
static void |
setStreamMode(SnapStream.StreamMode mode) |
public static final String ZOOKEEPER_SHAPSHOT_STREAM_MODE
public static CheckedInputStream getInputStream(File file) throws IOException
file - the file the InputStream read fromIOExceptionpublic static CheckedOutputStream getOutputStream(File file, boolean fsync) throws IOException
file - the file the OutputStream writes tofsync - sync the file immediately after writeIOExceptionpublic static void sealStream(CheckedOutputStream os, OutputArchive oa) throws IOException
IOExceptionpublic static void checkSealIntegrity(CheckedInputStream is, InputArchive ia) throws IOException
IOExceptionpublic static boolean isValidSnapshot(File file) throws IOException
file - file to verifyIOExceptionpublic static void setStreamMode(SnapStream.StreamMode mode)
public static SnapStream.StreamMode getStreamMode()
public static SnapStream.StreamMode getStreamMode(String fileName)
fileName - Copyright © 2008–2026 The Apache Software Foundation. All rights reserved.