Class DirectTupleSchema

    • Field Detail

      • layout

        protected final int[] layout
      • widths

        protected final int[] widths
      • byteSize

        protected int byteSize
      • addressOffset

        protected long addressOffset
      • wordSize

        protected final int wordSize
    • Constructor Detail

      • DirectTupleSchema

        public DirectTupleSchema​(DirectTupleSchema.Builder builder)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • getLong

        public long getLong​(long address,
                            int index)
      • getInt

        public int getInt​(long address,
                          int index)
      • getShort

        public short getShort​(long address,
                              int index)
      • getChar

        public char getChar​(long address,
                            int index)
      • getByte

        public byte getByte​(long address,
                            int index)
      • getDouble

        public double getDouble​(long address,
                                int index)
      • getFloat

        public float getFloat​(long address,
                              int index)
      • setLong

        public void setLong​(long address,
                            int index,
                            long value)
      • setInt

        public void setInt​(long address,
                           int index,
                           int value)
      • setShort

        public void setShort​(long address,
                             int index,
                             short value)
      • setChar

        public void setChar​(long address,
                            int index,
                            char value)
      • setByte

        public void setByte​(long address,
                            int index,
                            byte value)
      • setFloat

        public void setFloat​(long address,
                             int index,
                             float value)
      • setDouble

        public void setDouble​(long address,
                              int index,
                              double value)
      • getLayout

        public int[] getLayout()
      • getByteSize

        public int getByteSize()
      • createTuple

        public FastTuple createTuple​(long address)
      • createRecord

        public long createRecord()
      • createRecordArray

        public long createRecordArray​(long size)
      • createTuple

        public FastTuple createTuple()
                              throws java.lang.Exception
        Description copied from class: TupleSchema
        Allocates a new tuple, completely separate from any pooling.
        Specified by:
        createTuple in class TupleSchema
        Returns:
        - FastTuple
        Throws:
        java.lang.Exception - - Throws an exception if unable to allocate tuple
      • createTypedTuple

        public <T> T createTypedTuple​(java.lang.Class<T> clazz)
                               throws java.lang.Exception
        Description copied from class: TupleSchema
        Allocates a new typed tuple, completely separate from any pooling. Use care to call TupleSchema.Builder.implementInterface(Class) before using this method
        Specified by:
        createTypedTuple in class TupleSchema
        Type Parameters:
        T - - TupleSchema type parameter
        Parameters:
        clazz - - Class implemented by the Tuple
        Returns:
        - FastTuple case to type TupleSchema
        Throws:
        java.lang.Exception - - Throws an exception if unable to allocate tuple or cast to the specified type
      • createTupleArray

        public FastTuple[] createTupleArray​(int size)
                                     throws java.lang.Exception
        Description copied from class: TupleSchema
        Allocates an array of tuples. This method will try to ensure that tuples get allocated in adjacent memory, however with the heap based allocation this is not guaranteed.
        Specified by:
        createTupleArray in class TupleSchema
        Parameters:
        size - the number of tuples in the array.
        Returns:
        - Array of FastTuple
        Throws:
        java.lang.Exception - - Throws if unable to allocate tuple array
      • createTypedTupleArray

        public <T> T[] createTypedTupleArray​(java.lang.Class<T> clazz,
                                             int size)
                                      throws java.lang.Exception
        Description copied from class: TupleSchema
        * Allocates an array of tuples. This method will try to ensure that tuples get allocated in adjacent memory, however with the heap based allocation this is not guaranteed.
        Specified by:
        createTypedTupleArray in class TupleSchema
        Type Parameters:
        T - - TupleSchema type parameter
        Parameters:
        clazz - - Class implemented by the Tuple
        size - - the number of tuples in the array
        Returns:
        - Array of FastTuple cast to type TupleSchema
        Throws:
        java.lang.Exception - - Throws is unable to allocate tuple array or cast to the specified type
      • destroyTupleArray

        public void destroyTupleArray​(FastTuple[] ary)
        Description copied from class: TupleSchema
        Deallocates memory for an array of tuples. Assumes that they were allocated as an array.
        Specified by:
        destroyTupleArray in class TupleSchema
        Parameters:
        ary - - Array of FastTuple to deallocate
      • destroyTypedTupleArray

        public <T> void destroyTypedTupleArray​(T[] ary)
        Description copied from class: TupleSchema
        Deallocates memory for an array of typed tuples. Assumes that they were allocated as an array.
        Specified by:
        destroyTypedTupleArray in class TupleSchema
        Type Parameters:
        T - - TupleSchema underlying class implemented by tuples
        Parameters:
        ary - - Array of typed FastTuple to deallocate
      • destroy

        public void destroy​(FastTuple tuple)
      • destroy

        public void destroy​(long address)
      • generateClass

        protected void generateClass()
                              throws java.lang.Exception
        Specified by:
        generateClass in class TupleSchema
        Throws:
        java.lang.Exception
      • generateLayout

        protected void generateLayout()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class TupleSchema