@Test public void writeTablet() throws IOException, WriteProcessException { Tablet tablet = new Tablet("d1", Arrays.asList( new MeasurementSchema("s1", TSDataType.FLOAT, TSEncoding.RLE, CompressionType.SNAPPY), new MeasurementSchema("s2", TSDataType.INT32, TSEncoding.RLE, CompressionType.SNAPPY))); tablet.timestamps[0] = 10000; ((float[]) tablet.values[0])[0] = 5.0f; ((int[]) tablet.values[1])[0] = 5; tablet.rowSize = 1; writer.write(tablet); closeFile(); readOneRow(); }
public boolean write(TSRecord record) throws IOException, WriteProcessException { checkIsTimeSeriesExist(record); groupWriters.get(record.deviceId).write(record.time, record.dataPointList); ++recordCount; return checkMemorySizeAndMayFlushChunks(); }
TsFileWriter implements AutoCloseable { public boolean write(TSRecord record) throws IOException, WriteProcessException { checkIsTimeSeriesExist(record); groupWriters.get(record.deviceId).write(record.time, record.dataPointList); ++recordCount; return checkMemorySizeAndMayFlushChunks(); } }
TsFileWriter implements AutoCloseable { public boolean write(TSRecord record) throws IOException, WriteProcessException { checkIsTimeSeriesExist(record); groupWriters.get(record.deviceId).write(record.time, record.dataPointList); ++recordCount; return checkMemorySizeAndMayFlushChunks(); } TsFileWriter(File file);  TsFileWriter(TsFileIOWriter fileWriter);  TsFileWriter(File file, Schema schema);  TsFileWriter(TsFileOutput output, Schema schema);  TsFileWriter(File file, Schema schema, TSFileConfig conf); protected  TsFileWriter(TsFileIOWriter fileWriter, Schema schema, TSFileConfig conf); }
TsFileWriter implements AutoCloseable { public boolean write(TSRecord record) throws IOException, WriteProcessException { checkIsTimeSeriesExist(record); groupWriters.get(record.deviceId).write(record.time, record.dataPointList); ++recordCount; return checkMemorySizeAndMayFlushChunks(); } TsFileWriter(File file);  TsFileWriter(TsFileIOWriter fileWriter);  TsFileWriter(File file, Schema schema);  TsFileWriter(TsFileOutput output, Schema schema);  TsFileWriter(File file, Schema schema, TSFileConfig conf); protected  TsFileWriter(TsFileIOWriter fileWriter, Schema schema, TSFileConfig conf); void registerDeviceTemplate(String templateName, Map<String, MeasurementSchema> template); void registerDevice(String deviceId, String templateName); void registerTimeseries(Path path, MeasurementSchema measurementSchema); boolean write(TSRecord record); boolean write(Tablet tablet); boolean flushAllChunkGroups(); @Override void close(); TsFileIOWriter getIOWriter(); void writeVersion(long versionPair); }
TsFileWriter implements AutoCloseable { public boolean write(TSRecord record) throws IOException, WriteProcessException { checkIsTimeSeriesExist(record); groupWriters.get(record.deviceId).write(record.time, record.dataPointList); ++recordCount; return checkMemorySizeAndMayFlushChunks(); } TsFileWriter(File file);  TsFileWriter(TsFileIOWriter fileWriter);  TsFileWriter(File file, Schema schema);  TsFileWriter(TsFileOutput output, Schema schema);  TsFileWriter(File file, Schema schema, TSFileConfig conf); protected  TsFileWriter(TsFileIOWriter fileWriter, Schema schema, TSFileConfig conf); void registerDeviceTemplate(String templateName, Map<String, MeasurementSchema> template); void registerDevice(String deviceId, String templateName); void registerTimeseries(Path path, MeasurementSchema measurementSchema); boolean write(TSRecord record); boolean write(Tablet tablet); boolean flushAllChunkGroups(); @Override void close(); TsFileIOWriter getIOWriter(); void writeVersion(long versionPair);  }