Class MetadataIndexConstructor


  • public class MetadataIndexConstructor
    extends java.lang.Object
    • Method Detail

      • constructMetadataIndex

        public static MetadataIndexNode constructMetadataIndex​(java.util.Map<java.lang.String,​java.util.List<TimeseriesMetadata>> deviceTimeseriesMetadataMap,
                                                               TsFileOutput out)
                                                        throws java.io.IOException
        Construct metadata index tree.
        Parameters:
        deviceTimeseriesMetadataMap - device => TimeseriesMetadata list
        out - tsfile output
        Throws:
        java.io.IOException - exception when operating stream
      • checkAndBuildLevelIndex

        public static MetadataIndexNode checkAndBuildLevelIndex​(java.util.Map<java.lang.String,​MetadataIndexNode> deviceMetadataIndexMap,
                                                                TsFileOutput out)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • generateRootNode

        public static MetadataIndexNode generateRootNode​(java.util.Queue<MetadataIndexNode> metadataIndexNodeQueue,
                                                         TsFileOutput out,
                                                         MetadataIndexNodeType type)
                                                  throws java.io.IOException
        Generate root node, using the nodes in the queue as leaf nodes. The final metadata tree has two levels: measurement leaf nodes will generate to measurement root node; device leaf nodes will generate to device root node
        Parameters:
        metadataIndexNodeQueue - queue of metadataIndexNode
        out - tsfile output
        type - MetadataIndexNode type
        Throws:
        java.io.IOException - exception when operating stream
      • addCurrentIndexNodeToQueue

        public static void addCurrentIndexNodeToQueue​(MetadataIndexNode currentIndexNode,
                                                      java.util.Queue<MetadataIndexNode> metadataIndexNodeQueue,
                                                      TsFileOutput out)
                                               throws java.io.IOException
        Throws:
        java.io.IOException