Class SortUtil


  • public class SortUtil
    extends Object
    Util for sort.
    • Constructor Summary

      Constructors 
      Constructor Description
      SortUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int compareBinary​(byte[] a, byte[] b)  
      static int compareBinary​(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2)  
      static void maxNormalizedKey​(org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)
      Max unsigned byte is -1.
      static void minNormalizedKey​(org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)  
      static void putBinaryNormalizedKey​(byte[] value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)  
      static void putBooleanNormalizedKey​(boolean value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)  
      static void putByteNormalizedKey​(byte value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)  
      static void putDecimalNormalizedKey​(org.apache.flink.table.data.DecimalData record, org.apache.flink.core.memory.MemorySegment target, int offset, int len)
      Just support the compact precision decimal.
      static void putDoubleNormalizedKey​(double value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)
      See http://stereopsis.com/radix.html for more details.
      static void putFloatNormalizedKey​(float value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)
      See http://stereopsis.com/radix.html for more details.
      static void putIntNormalizedKey​(int value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)  
      static void putLongNormalizedKey​(long value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)  
      static void putShortNormalizedKey​(short value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)  
      static void putStringNormalizedKey​(org.apache.flink.table.data.StringData value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)
      UTF-8 supports bytes comparison.
      static void putTimestampNormalizedKey​(org.apache.flink.table.data.TimestampData value, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes)
      Support the compact precision TimestampData.
    • Constructor Detail

      • SortUtil

        public SortUtil()
    • Method Detail

      • minNormalizedKey

        public static void minNormalizedKey​(org.apache.flink.core.memory.MemorySegment target,
                                            int offset,
                                            int numBytes)
      • maxNormalizedKey

        public static void maxNormalizedKey​(org.apache.flink.core.memory.MemorySegment target,
                                            int offset,
                                            int numBytes)
        Max unsigned byte is -1.
      • putShortNormalizedKey

        public static void putShortNormalizedKey​(short value,
                                                 org.apache.flink.core.memory.MemorySegment target,
                                                 int offset,
                                                 int numBytes)
      • putByteNormalizedKey

        public static void putByteNormalizedKey​(byte value,
                                                org.apache.flink.core.memory.MemorySegment target,
                                                int offset,
                                                int numBytes)
      • putBooleanNormalizedKey

        public static void putBooleanNormalizedKey​(boolean value,
                                                   org.apache.flink.core.memory.MemorySegment target,
                                                   int offset,
                                                   int numBytes)
      • putStringNormalizedKey

        public static void putStringNormalizedKey​(org.apache.flink.table.data.StringData value,
                                                  org.apache.flink.core.memory.MemorySegment target,
                                                  int offset,
                                                  int numBytes)
        UTF-8 supports bytes comparison.
      • putDecimalNormalizedKey

        public static void putDecimalNormalizedKey​(org.apache.flink.table.data.DecimalData record,
                                                   org.apache.flink.core.memory.MemorySegment target,
                                                   int offset,
                                                   int len)
        Just support the compact precision decimal.
      • putIntNormalizedKey

        public static void putIntNormalizedKey​(int value,
                                               org.apache.flink.core.memory.MemorySegment target,
                                               int offset,
                                               int numBytes)
      • putLongNormalizedKey

        public static void putLongNormalizedKey​(long value,
                                                org.apache.flink.core.memory.MemorySegment target,
                                                int offset,
                                                int numBytes)
      • putFloatNormalizedKey

        public static void putFloatNormalizedKey​(float value,
                                                 org.apache.flink.core.memory.MemorySegment target,
                                                 int offset,
                                                 int numBytes)
        See http://stereopsis.com/radix.html for more details.
      • putDoubleNormalizedKey

        public static void putDoubleNormalizedKey​(double value,
                                                  org.apache.flink.core.memory.MemorySegment target,
                                                  int offset,
                                                  int numBytes)
        See http://stereopsis.com/radix.html for more details.
      • putBinaryNormalizedKey

        public static void putBinaryNormalizedKey​(byte[] value,
                                                  org.apache.flink.core.memory.MemorySegment target,
                                                  int offset,
                                                  int numBytes)
      • putTimestampNormalizedKey

        public static void putTimestampNormalizedKey​(org.apache.flink.table.data.TimestampData value,
                                                     org.apache.flink.core.memory.MemorySegment target,
                                                     int offset,
                                                     int numBytes)
        Support the compact precision TimestampData.
      • compareBinary

        public static int compareBinary​(byte[] a,
                                        byte[] b)
      • compareBinary

        public static int compareBinary​(byte[] buffer1,
                                        int offset1,
                                        int length1,
                                        byte[] buffer2,
                                        int offset2,
                                        int length2)