Class MeasurementSchema
- java.lang.Object
-
- org.apache.iotdb.tsfile.write.schema.MeasurementSchema
-
- All Implemented Interfaces:
Serializable,Comparable<MeasurementSchema>,IMeasurementSchema
public class MeasurementSchema extends Object implements IMeasurementSchema, Comparable<MeasurementSchema>, Serializable
This class describes a measurement's information registered in FileSchema, including measurement id, data type, encoding and compressor type. For each TSEncoding, MeasurementSchema maintains respective TSEncodingBuilder; For TSDataType, only ENUM has TSDataTypeConverter up to now.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MeasurementSchema()MeasurementSchema(String measurementId, byte type, byte encoding, byte compressionType, Map<String,String> props)MeasurementSchema(String measurementId, TSDataType tsDataType)MeasurementSchema(String measurementId, TSDataType type, TSEncoding encoding)set properties as an empty Map.MeasurementSchema(String measurementId, TSDataType type, TSEncoding encoding, CompressionType compressionType)MeasurementSchema(String measurementId, TSDataType type, TSEncoding encoding, CompressionType compressionType, Map<String,String> props)Constructor of MeasurementSchema.
-
Method Summary
-
-
-
Constructor Detail
-
MeasurementSchema
public MeasurementSchema()
-
MeasurementSchema
public MeasurementSchema(String measurementId, TSDataType tsDataType)
-
MeasurementSchema
public MeasurementSchema(String measurementId, TSDataType type, TSEncoding encoding)
set properties as an empty Map.
-
MeasurementSchema
public MeasurementSchema(String measurementId, TSDataType type, TSEncoding encoding, CompressionType compressionType)
-
MeasurementSchema
public MeasurementSchema(String measurementId, TSDataType type, TSEncoding encoding, CompressionType compressionType, Map<String,String> props)
Constructor of MeasurementSchema.props - information in encoding method. For RLE, Encoder.MAX_POINT_NUMBER For PLAIN, Encoder.maxStringLength
-
-
Method Detail
-
deserializeFrom
public static MeasurementSchema deserializeFrom(InputStream inputStream) throws IOException
function for deserializing data from input stream.- Throws:
IOException
-
deserializeFrom
public static MeasurementSchema deserializeFrom(ByteBuffer buffer)
function for deserializing data from byte buffer.
-
partialDeserializeFrom
public static MeasurementSchema partialDeserializeFrom(ByteBuffer buffer)
-
getSchemaType
public MeasurementSchemaType getSchemaType()
- Specified by:
getSchemaTypein interfaceIMeasurementSchema
-
getMeasurementId
public String getMeasurementId()
- Specified by:
getMeasurementIdin interfaceIMeasurementSchema
-
setMeasurementId
public void setMeasurementId(String measurementId)
-
getProps
public Map<String,String> getProps()
- Specified by:
getPropsin interfaceIMeasurementSchema
-
getEncodingType
public TSEncoding getEncodingType()
- Specified by:
getEncodingTypein interfaceIMeasurementSchema
-
getType
public TSDataType getType()
- Specified by:
getTypein interfaceIMeasurementSchema
-
getTypeInByte
public byte getTypeInByte()
- Specified by:
getTypeInBytein interfaceIMeasurementSchema
-
getTimeTSEncoding
public TSEncoding getTimeTSEncoding()
- Specified by:
getTimeTSEncodingin interfaceIMeasurementSchema
-
getTimeEncoder
public Encoder getTimeEncoder()
function for getting time encoder.- Specified by:
getTimeEncoderin interfaceIMeasurementSchema
-
getSubMeasurementsList
public List<String> getSubMeasurementsList()
- Specified by:
getSubMeasurementsListin interfaceIMeasurementSchema
-
getSubMeasurementsTSDataTypeList
public List<TSDataType> getSubMeasurementsTSDataTypeList()
- Specified by:
getSubMeasurementsTSDataTypeListin interfaceIMeasurementSchema
-
getSubMeasurementsTSEncodingList
public List<TSEncoding> getSubMeasurementsTSEncodingList()
- Specified by:
getSubMeasurementsTSEncodingListin interfaceIMeasurementSchema
-
getSubMeasurementsEncoderList
public List<Encoder> getSubMeasurementsEncoderList()
- Specified by:
getSubMeasurementsEncoderListin interfaceIMeasurementSchema
-
getValueEncoder
public Encoder getValueEncoder()
get Encoder of value from encodingConverter by measurementID and data type.- Specified by:
getValueEncoderin interfaceIMeasurementSchema- Returns:
- Encoder for value
-
getCompressor
public CompressionType getCompressor()
- Specified by:
getCompressorin interfaceIMeasurementSchema
-
serializeTo
public int serializeTo(OutputStream outputStream) throws IOException
function for serializing data to output stream.- Specified by:
serializeToin interfaceIMeasurementSchema- Throws:
IOException
-
serializedSize
public int serializedSize()
- Specified by:
serializedSizein interfaceIMeasurementSchema
-
serializeTo
public int serializeTo(ByteBuffer buffer)
function for serializing data to byte buffer.- Specified by:
serializeToin interfaceIMeasurementSchema
-
partialSerializeTo
public int partialSerializeTo(OutputStream outputStream) throws IOException
- Specified by:
partialSerializeToin interfaceIMeasurementSchema- Throws:
IOException
-
isLogicalView
public boolean isLogicalView()
- Specified by:
isLogicalViewin interfaceIMeasurementSchema
-
partialSerializeTo
public int partialSerializeTo(ByteBuffer buffer)
- Specified by:
partialSerializeToin interfaceIMeasurementSchema
-
compareTo
public int compareTo(MeasurementSchema o)
compare by measurementID.- Specified by:
compareToin interfaceComparable<MeasurementSchema>
-
setType
public void setType(TSDataType type)
- Specified by:
setTypein interfaceIMeasurementSchema
-
getSubMeasurementIndex
public int getSubMeasurementIndex(String measurementId)
- Specified by:
getSubMeasurementIndexin interfaceIMeasurementSchema
-
getSubMeasurementsCount
public int getSubMeasurementsCount()
- Specified by:
getSubMeasurementsCountin interfaceIMeasurementSchema
-
containsSubMeasurement
public boolean containsSubMeasurement(String measurementId)
- Specified by:
containsSubMeasurementin interfaceIMeasurementSchema
-
setEncoding
public void setEncoding(byte encoding)
-
setCompressor
public void setCompressor(byte compressor)
-
-