Class Template
- java.lang.Object
-
- org.apache.iotdb.db.metadata.template.Template
-
- All Implemented Interfaces:
java.io.Serializable
public class Template extends java.lang.Object implements java.io.Serializable- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Template()Template(CreateSchemaTemplateStatement statement)build a template from a CreateSchemaTemplateStatementTemplate(CreateTemplatePlan plan)build a template from a createTemplatePlan
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAlignedMeasurements(java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding[] encodings, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType[] compressors)voidaddUnalignedMeasurements(java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding[] encodings, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType[] compressors)voiddeleteAlignedPrefix(java.lang.String path)voiddeleteMeasurements(java.lang.String path)voiddeleteSeriesCascade(java.lang.String path)voiddeserialize(java.nio.ByteBuffer buffer)booleanequals(java.lang.Object t)java.util.List<java.lang.String>getAlignedMeasurements(java.lang.String prefix)java.util.List<java.lang.String>getAllAlignedPrefix()java.util.List<java.lang.String>getAllMeasurementsPaths()IMNodegetDirectNode(java.lang.String nodeName)java.util.Collection<IMNode>getDirectNodes()intgetId()intgetMeasurementsCount()java.util.List<java.lang.String>getMeasurementsUnderPath(java.lang.String path)java.lang.StringgetName()IMNodegetPathNodeInTemplate(java.lang.String path)IMNodegetPathNodeInTemplate(org.apache.iotdb.commons.path.PartialPath path)java.util.Set<org.apache.iotdb.commons.consensus.SchemaRegionId>getRelatedSchemaRegion()java.util.Set<org.apache.iotdb.commons.consensus.SchemaRegionId>getRelatedSchemaRegionInStorageGroup(java.lang.String storageGroup)org.apache.iotdb.tsfile.write.schema.IMeasurementSchemagetSchema(java.lang.String measurementId)java.util.Map<java.lang.String,org.apache.iotdb.tsfile.write.schema.IMeasurementSchema>getSchemaMap()inthashCode()booleanhasSchema(java.lang.String suffixPath)booleanisDirectAligned()booleanisDirectNodeInTemplate(java.lang.String nodeName)booleanisPathExistInTemplate(java.lang.String path)booleanisPathMeasurement(java.lang.String path)voidmarkSchemaRegion(java.lang.String storageGroup, org.apache.iotdb.commons.consensus.SchemaRegionId schemaRegionId)java.nio.ByteBufferserialize()voidserialize(java.io.OutputStream outputStream)voidserialize(java.nio.ByteBuffer buffer)voidsetId(int id)voidsetName(java.lang.String name)voidsetRehash(int code)If the original hash code above clashes with existed template inside TemplateManager, needs to be rehashedvoidunmarkSchemaRegion(java.lang.String storageGroup, org.apache.iotdb.commons.consensus.SchemaRegionId schemaRegionId)voidunmarkStorageGroup(java.lang.String storageGroup)
-
-
-
Constructor Detail
-
Template
public Template()
-
Template
public Template(CreateTemplatePlan plan) throws org.apache.iotdb.commons.exception.IllegalPathException
build a template from a createTemplatePlan- Parameters:
plan- createTemplatePlan- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
Template
public Template(CreateSchemaTemplateStatement statement) throws org.apache.iotdb.commons.exception.IllegalPathException
build a template from a CreateSchemaTemplateStatement- Parameters:
statement- CreateSchemaTemplateStatement- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
-
Method Detail
-
getId
public int getId()
-
setId
public void setId(int id)
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
getSchemaMap
public java.util.Map<java.lang.String,org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> getSchemaMap()
-
hasSchema
public boolean hasSchema(java.lang.String suffixPath)
-
getSchema
public org.apache.iotdb.tsfile.write.schema.IMeasurementSchema getSchema(java.lang.String measurementId)
-
isDirectAligned
public boolean isDirectAligned()
-
getAllAlignedPrefix
public java.util.List<java.lang.String> getAllAlignedPrefix()
-
getAlignedMeasurements
public java.util.List<java.lang.String> getAlignedMeasurements(java.lang.String prefix) throws org.apache.iotdb.commons.exception.IllegalPathException- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
getAllMeasurementsPaths
public java.util.List<java.lang.String> getAllMeasurementsPaths()
-
getMeasurementsUnderPath
public java.util.List<java.lang.String> getMeasurementsUnderPath(java.lang.String path) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getMeasurementsCount
public int getMeasurementsCount()
-
getPathNodeInTemplate
public IMNode getPathNodeInTemplate(org.apache.iotdb.commons.path.PartialPath path)
-
getPathNodeInTemplate
public IMNode getPathNodeInTemplate(java.lang.String path) throws org.apache.iotdb.commons.exception.IllegalPathException
- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
isPathExistInTemplate
public boolean isPathExistInTemplate(java.lang.String path) throws org.apache.iotdb.commons.exception.IllegalPathException- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
isDirectNodeInTemplate
public boolean isDirectNodeInTemplate(java.lang.String nodeName)
-
isPathMeasurement
public boolean isPathMeasurement(java.lang.String path) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getDirectNode
public IMNode getDirectNode(java.lang.String nodeName)
-
getDirectNodes
public java.util.Collection<IMNode> getDirectNodes()
-
getRelatedSchemaRegion
public java.util.Set<org.apache.iotdb.commons.consensus.SchemaRegionId> getRelatedSchemaRegion()
-
getRelatedSchemaRegionInStorageGroup
public java.util.Set<org.apache.iotdb.commons.consensus.SchemaRegionId> getRelatedSchemaRegionInStorageGroup(java.lang.String storageGroup)
-
markSchemaRegion
public void markSchemaRegion(java.lang.String storageGroup, org.apache.iotdb.commons.consensus.SchemaRegionId schemaRegionId)
-
unmarkSchemaRegion
public void unmarkSchemaRegion(java.lang.String storageGroup, org.apache.iotdb.commons.consensus.SchemaRegionId schemaRegionId)
-
unmarkStorageGroup
public void unmarkStorageGroup(java.lang.String storageGroup)
-
addAlignedMeasurements
public void addAlignedMeasurements(java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding[] encodings, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType[] compressors) throws org.apache.iotdb.commons.exception.IllegalPathException- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
addUnalignedMeasurements
public void addUnalignedMeasurements(java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding[] encodings, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType[] compressors) throws org.apache.iotdb.commons.exception.IllegalPathException- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
deleteMeasurements
public void deleteMeasurements(java.lang.String path) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
deleteSeriesCascade
public void deleteSeriesCascade(java.lang.String path) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
deleteAlignedPrefix
public void deleteAlignedPrefix(java.lang.String path) throws org.apache.iotdb.commons.exception.IllegalPathException- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
serialize
public void serialize(java.nio.ByteBuffer buffer)
-
serialize
public void serialize(java.io.OutputStream outputStream) throws java.io.IOException- Throws:
java.io.IOException
-
serialize
public java.nio.ByteBuffer serialize()
-
deserialize
public void deserialize(java.nio.ByteBuffer buffer)
-
equals
public boolean equals(java.lang.Object t)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
setRehash
public void setRehash(int code)
If the original hash code above clashes with existed template inside TemplateManager, needs to be rehashed- Parameters:
code- solve the hash collision by increment, and 0 to be exceptional value
-
-