public class TsFileSequenceReaderForV2 extends TsFileSequenceReader implements AutoCloseable
TsFileSequenceReader.LocateStatusconfig, file, fileMetadataPos, fileMetadataSize, tsFileInput, tsFileMetaData| Constructor and Description |
|---|
TsFileSequenceReaderForV2(String file)
Create a file reader of the given file.
|
TsFileSequenceReaderForV2(String file,
boolean loadMetadataSize)
construct function for TsFileSequenceReader.
|
TsFileSequenceReaderForV2(TsFileInput input)
Create a file reader of the given file.
|
TsFileSequenceReaderForV2(TsFileInput input,
boolean loadMetadataSize)
construct function for TsFileSequenceReader.
|
TsFileSequenceReaderForV2(TsFileInput input,
long fileMetadataPos,
int fileMetadataSize)
construct function for TsFileSequenceReader.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAllDevices() |
Map<String,List<TimeseriesMetadata>> |
getAllTimeseriesMetadata(boolean needChunkMetadata) |
boolean |
isComplete()
whether the file is a complete TsFile: only if the head magic and tail magic string exists.
|
ChunkGroupHeader |
readChunkGroupFooter()
read data from current position of the input, and deserialize it to a CHUNK_GROUP_FOOTER.
|
ChunkHeader |
readChunkHeader()
read data from current position of the input, and deserialize it to a CHUNK_HEADER.
|
Map<String,List<ChunkMetadata>> |
readChunkMetadataInDevice(String device)
read all ChunkMetaDatas of given device
|
ArrayList<ChunkMetadata> |
readChunkMetaDataList(TimeseriesMetadata timeseriesMetaData)
get ChunkMetaDatas in given TimeseriesMetaData
|
TsFileMetadata |
readFileMetadata()
this function does not modify the position of the file reader.
|
List<ITimeSeriesMetadata> |
readITimeseriesMetadata(String device,
Set<String> measurements) |
Chunk |
readMemChunk(ChunkMetadata metaData)
read memory chunk.
|
PageHeader |
readPageHeader(TSDataType type)
not thread safe.
|
TimeseriesMetadata |
readTimeseriesMetadata(Path path,
boolean ignoreNotExists) |
List<TimeseriesMetadata> |
readTimeseriesMetadata(Path path,
Set<String> allSensors) |
long |
readVersion() |
String |
readVersionNumberV2()
this function reads version number and checks compatibility of TsFile.
|
binarySearchInTimeseriesMetadataList, checkChunkAndPagesStatistics, close, fileSize, getAlignedChunkMetadata, getAllDevicesIteratorWithIsAligned, getAllMeasurements, getAllPaths, getChunkMetadataList, getChunkMetadataList, getDeviceMeasurementsMap, getDeviceNameInRange, getFileMetadataPos, getFileMetadataSize, getFileName, getIChunkMetadataList, getMaxPlanIndex, getMeasurementChunkMetadataListMapIterator, getMetadataAndEndOffset, getMetadataIndexNode, getMinPlanIndex, getPathsIterator, getTsFileMetadataSize, hashCode, loadMetadataSize, position, position, readBloomFilter, readChunkGroupHeader, readChunkGroupHeader, readChunkHeader, readCompressedPage, readData, readData, readDeviceMetadata, readHeadMagic, readIChunkMetaDataList, readITimeseriesMetadata, readMarker, readMemChunk, readPage, readPageHeader, readPlanIndex, readRaw, readTailMagic, readVersionNumber, selfCheck, selfCheckWithInfo, skipPageDataclone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, waitclosepublic TsFileSequenceReaderForV2(String file) throws IOException
file - the data fileIOException - If some I/O error occurspublic TsFileSequenceReaderForV2(String file, boolean loadMetadataSize) throws IOException
file - -given file nameloadMetadataSize - -whether load meta data sizeIOExceptionpublic TsFileSequenceReaderForV2(TsFileInput input) throws IOException
input - given inputIOExceptionpublic TsFileSequenceReaderForV2(TsFileInput input, boolean loadMetadataSize) throws IOException
input - -given inputloadMetadataSize - -load meta data sizeIOExceptionpublic TsFileSequenceReaderForV2(TsFileInput input, long fileMetadataPos, int fileMetadataSize)
input - the input of a tsfile. The current position should be a markder and then a chunk
Header, rather than the magic numberfileMetadataPos - the position of the file metadata in the TsFileInput from the beginning
of the input to the current positionfileMetadataSize - the byte size of the file metadata in the inputpublic boolean isComplete()
throws IOException
isComplete in class TsFileSequenceReaderIOExceptionpublic String readVersionNumberV2() throws IOException
IOExceptionpublic TsFileMetadata readFileMetadata() throws IOException
readFileMetadata in class TsFileSequenceReaderIOException - io errorpublic TimeseriesMetadata readTimeseriesMetadata(Path path, boolean ignoreNotExists) throws IOException
readTimeseriesMetadata in class TsFileSequenceReaderIOExceptionpublic List<TimeseriesMetadata> readTimeseriesMetadata(Path path, Set<String> allSensors) throws IOException
readTimeseriesMetadata in class TsFileSequenceReaderIOExceptionpublic List<ITimeSeriesMetadata> readITimeseriesMetadata(String device, Set<String> measurements) throws IOException
readITimeseriesMetadata in class TsFileSequenceReaderIOExceptionpublic List<String> getAllDevices() throws IOException
getAllDevices in class TsFileSequenceReaderIOExceptionpublic Map<String,List<ChunkMetadata>> readChunkMetadataInDevice(String device) throws IOException
readChunkMetadataInDevice in class TsFileSequenceReaderdevice - nameIOException - io errorpublic Map<String,List<TimeseriesMetadata>> getAllTimeseriesMetadata(boolean needChunkMetadata) throws IOException
getAllTimeseriesMetadata in class TsFileSequenceReaderIOExceptionpublic ChunkGroupHeader readChunkGroupFooter() throws IOException
IOException - io errorpublic ChunkHeader readChunkHeader() throws IOException
IOException - io errorpublic Chunk readMemChunk(ChunkMetadata metaData) throws IOException
readMemChunk in class TsFileSequenceReadermetaData - -given chunk meta dataIOExceptionpublic PageHeader readPageHeader(TSDataType type) throws IOException
type - given tsfile data typeIOExceptionpublic long readVersion()
throws IOException
IOExceptionpublic ArrayList<ChunkMetadata> readChunkMetaDataList(TimeseriesMetadata timeseriesMetaData) throws IOException
readChunkMetaDataList in class TsFileSequenceReaderIOExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.