Class Template

  • All Implemented Interfaces:
    java.io.Serializable

    public class Template
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.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