Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.tsfile.write.chunk.TableChunkGroupWriterImpl;
import org.apache.tsfile.write.schema.Schema;
import org.apache.tsfile.write.writer.TsFileIOWriter;
import org.apache.tsfile.write.writer.TsFileOutput;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -85,9 +86,21 @@ abstract class AbstractTableModelTsFileWriter implements ITsFileWriter {
@TsFileApi
protected AbstractTableModelTsFileWriter(File file, long chunkGroupSizeThreshold)
throws IOException {
this(new TsFileIOWriter(file), chunkGroupSizeThreshold);
}

@TsFileApi
protected AbstractTableModelTsFileWriter(TsFileOutput output, long chunkGroupSizeThreshold)
throws IOException {
this(new TsFileIOWriter(output), chunkGroupSizeThreshold);
}

@TsFileApi
protected AbstractTableModelTsFileWriter(
TsFileIOWriter tsFileIOWriter, long chunkGroupSizeThreshold) {
Schema schema = new Schema();
TSFileConfig conf = TSFileDescriptor.getInstance().getConfig();
this.fileWriter = new TsFileIOWriter(file);
this.fileWriter = tsFileIOWriter;
fileWriter.setSchema(schema);

this.pageSize = conf.getPageSizeInByte();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.tsfile.utils.WriteUtils;
import org.apache.tsfile.write.record.Tablet;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.writer.TsFileOutput;

import java.io.File;
import java.io.IOException;
Expand All @@ -48,6 +49,12 @@ public DeviceTableModelWriter(File file, TableSchema tableSchema, long memoryThr
registerTableSchema(tableSchema);
}

public DeviceTableModelWriter(
TsFileOutput tsFileOutput, TableSchema tableSchema, long memoryThreshold) throws IOException {
super(tsFileOutput, memoryThreshold);
registerTableSchema(tableSchema);
}

/**
* Write the tablet in to the TsFile with the table-view. The method will try to split the tablet
* by device.
Expand Down