Class RecordUtils


  • public class RecordUtils
    extends java.lang.Object
    This class translate an IMNode into a bytebuffer, or otherwise. Expected to support record as entry of segment-level index further. Coupling with IMNode structure.
    • Constructor Summary

      Constructors 
      Constructor Description
      RecordUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static IMNode buffer2Node​(java.lang.String nodeName, java.nio.ByteBuffer buffer)
      NOTICE: Make sure that buffer has set its position and limit clearly before pass to this method.
      static java.lang.String buffer2String​(java.nio.ByteBuffer buffer)  
      static boolean getAlignment​(java.nio.ByteBuffer recBuf)  
      static java.lang.String getRecordAlias​(java.nio.ByteBuffer recBuf)  
      static short getRecordLength​(java.nio.ByteBuffer recBuf)
      These methods need a buffer whose position is ready to read.
      static long getRecordSegAddr​(java.nio.ByteBuffer recBuf)  
      static byte getRecordType​(java.nio.ByteBuffer recBuf)  
      static byte[] getSchemaBytes​(java.nio.ByteBuffer recBuf)  
      static java.nio.ByteBuffer node2Buffer​(IMNode node)  
      static void updateSegAddr​(java.nio.ByteBuffer recBuf, long newSegAddr)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RecordUtils

        public RecordUtils()
    • Method Detail

      • node2Buffer

        public static java.nio.ByteBuffer node2Buffer​(IMNode node)
      • buffer2Node

        public static IMNode buffer2Node​(java.lang.String nodeName,
                                         java.nio.ByteBuffer buffer)
                                  throws org.apache.iotdb.commons.exception.MetadataException
        NOTICE: Make sure that buffer has set its position and limit clearly before pass to this method.
        Parameters:
        nodeName - name of the constructed node
        buffer - content of the node
        Returns:
        node constructed from buffer
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getRecordLength

        public static short getRecordLength​(java.nio.ByteBuffer recBuf)
        These methods need a buffer whose position is ready to read.
      • getRecordType

        public static byte getRecordType​(java.nio.ByteBuffer recBuf)
      • getRecordSegAddr

        public static long getRecordSegAddr​(java.nio.ByteBuffer recBuf)
      • getSchemaBytes

        public static byte[] getSchemaBytes​(java.nio.ByteBuffer recBuf)
      • getAlignment

        public static boolean getAlignment​(java.nio.ByteBuffer recBuf)
      • getRecordAlias

        public static java.lang.String getRecordAlias​(java.nio.ByteBuffer recBuf)
      • updateSegAddr

        public static void updateSegAddr​(java.nio.ByteBuffer recBuf,
                                         long newSegAddr)
      • buffer2String

        public static java.lang.String buffer2String​(java.nio.ByteBuffer buffer)
                                              throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException