public class SegmentedRaftLogOutputStream extends Object implements Closeable
| 构造器和说明 |
|---|
SegmentedRaftLogOutputStream(File file,
boolean append,
long segmentMaxSize,
long preallocatedSize,
ByteBuffer byteBuffer) |
public SegmentedRaftLogOutputStream(File file, boolean append, long segmentMaxSize, long preallocatedSize, ByteBuffer byteBuffer) throws IOException
IOExceptionpublic void write(org.apache.ratis.proto.RaftProtos.LogEntryProto entry) throws IOException
Format: (1) The serialized size of the entry. (2) The entry. (3) 4-byte checksum of the entry.
Size in bytes to be written: (size to encode n) + n + (checksum size), where n is the entry serialized size and the checksum size is 4.
IOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic void flush()
throws IOException
IOExceptionCopyright © 2017–2022 The Apache Software Foundation. All rights reserved.