@Test public void testOnlyOneChunkGroupAndOneMask() throws Exception { File file = fsFactory.getFile(FILE_NAME); TsFileWriter writer = new TsFileWriter(file); writer.registerTimeseries(new Path("d1", "s1"), new MeasurementSchema("s1", TSDataType.FLOAT, TSEncoding.RLE)); writer.registerTimeseries(new Path("d1", "s2"), new MeasurementSchema("s2", TSDataType.FLOAT, TSEncoding.RLE)); writer.write(new TSRecord(1, "d1").addTuple(new FloatDataPoint("s1", 5)) .addTuple(new FloatDataPoint("s2", 4))); writer.write(new TSRecord(2, "d1").addTuple(new FloatDataPoint("s1", 5)) .addTuple(new FloatDataPoint("s2", 4))); writer.flushAllChunkGroups(); writer.getIOWriter().writeChunkMaskForTest(); writer.getIOWriter().close(); RestorableTsFileIOWriter rWriter = new RestorableTsFileIOWriter(file); writer = new TsFileWriter(rWriter); writer.close(); assertNotEquals(TsFileIOWriter.magicStringBytes.length, rWriter.getTruncatedSize()); TsFileSequenceReader reader = new TsFileSequenceReader(FILE_NAME); List<ChunkMetadata> chunkMetadataList = reader.getChunkMetadataList(new Path("d1", "s1")); assertNotNull(chunkMetadataList); chunkMetadataList = reader.getChunkMetadataList(new Path("d1", "s2")); assertNotNull(chunkMetadataList); reader.close(); assertTrue(file.delete()); }
long getTruncatedSize() { return truncatedSize; }
RestorableTsFileIOWriter extends TsFileIOWriter { long getTruncatedSize() { return truncatedSize; } }
RestorableTsFileIOWriter extends TsFileIOWriter { long getTruncatedSize() { return truncatedSize; } RestorableTsFileIOWriter(File file); }
RestorableTsFileIOWriter extends TsFileIOWriter { long getTruncatedSize() { return truncatedSize; } RestorableTsFileIOWriter(File file); static RestorableTsFileIOWriter getWriterForAppendingDataOnCompletedTsFile(File file); Map<Path, MeasurementSchema> getKnownSchema(); List<ChunkMetadata> getVisibleMetadataList(String deviceId, String measurementId,
      TSDataType dataType); Map<String, Map<String, List<ChunkMetadata>>> getMetadatasForQuery(); void makeMetadataVisible(); boolean hasCrashed(); void addSchema(Path path, MeasurementSchema schema); }
RestorableTsFileIOWriter extends TsFileIOWriter { long getTruncatedSize() { return truncatedSize; } RestorableTsFileIOWriter(File file); static RestorableTsFileIOWriter getWriterForAppendingDataOnCompletedTsFile(File file); Map<Path, MeasurementSchema> getKnownSchema(); List<ChunkMetadata> getVisibleMetadataList(String deviceId, String measurementId,
      TSDataType dataType); Map<String, Map<String, List<ChunkMetadata>>> getMetadatasForQuery(); void makeMetadataVisible(); boolean hasCrashed(); void addSchema(Path path, MeasurementSchema schema);  }