-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor TsFile #736
Refactor TsFile #736
Conversation
The travis tests fail |
Yes, there are still lots of works to complete. So it's only a draft. |
return new SnappyCompressor(); | ||
default: | ||
throw new CompressionTypeNotSupportedException(name.toString()); | ||
case UNCOMPRESSED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the indention.
*/ | ||
TSDataType getDataType(String measurement) throws NoMeasurementException; | ||
TSDataType getDataType(Path path) throws NoMeasurementException, IOException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should be updated too.
I think |
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
Outdated
Show resolved
Hide resolved
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
Outdated
Show resolved
Hide resolved
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
Outdated
Show resolved
Hide resolved
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
Outdated
Show resolved
Hide resolved
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
Outdated
Show resolved
Hide resolved
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
Outdated
Show resolved
Hide resolved
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
Show resolved
Hide resolved
tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkGroupWriterImpl.java
Outdated
Show resolved
Hide resolved
tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/IChunkGroupWriter.java
Outdated
Show resolved
Hide resolved
tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TimeseriesMetaData.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please format the code first
private int numOfChunkMetaDatas; | ||
|
||
private String measurementId; | ||
private List<ChunkMetaData> chunkMetaDataList = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to store this in TimeseriesMetaData. I expect TimeseriesMetadata be used in this way:
List TsFileSequenceReader.getAllChunkMetadata(TimeseriesMetaDataIndex metadataIndex)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, fixed.
|
||
import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils; | ||
|
||
public class TimeseriesMetaData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class TimeseriesMetaData { | |
public class TimeseriesMetadataIndex { |
Actually this is an index to ChunkMetadatas of one series. Similar to the TsDeviceMetadataIndex
|
||
private long startOffsetOfChunkMetaDataList; | ||
private int chunkMetaDataListDataSize; | ||
private int numOfChunkMetaDatas; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this field?
We could read ChunkMetadata from a ByteBuffer like this:
List metadatas = new ArrayList();
for (bytebuffer.remaining > 0) {
metadatas.add(bytebuffer.readChunkMetadata());
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thank you.
return 5; | ||
default: | ||
return -1; | ||
case BOOLEAN: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not change this, our google-style contains the blanks.
return PLA; | ||
default: | ||
return UNCOMPRESSED; | ||
case 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change back
return IRREGULAR_FREQ; | ||
default: | ||
return IRREGULAR_FREQ; | ||
case 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change back
return new FloatStatistics(); | ||
default: | ||
throw new UnknownColumnTypeException(type.toString()); | ||
case INT32: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change back
logger.error( | ||
"Failed to get HDFSInput in Hadoop file system. Please check your dependency of Hadoop module.", | ||
e); | ||
logger.error("Failed to get HDFSInput in Hadoop file system. Please check your dependency of Hadoop module.", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to use idea to format the codes......... Maybe this line exceeds the max length.
I changed some UnitTests in IoTDB server, because I added a new kind of MNode |
https://issues.apache.org/jira/browse/IOTDB-243