Class TupleSchema

    • Field Detail

      • fieldNames

        protected final java.lang.String[] fieldNames
      • fieldTypes

        protected final java.lang.Class[] fieldTypes
      • iface

        protected final java.lang.Class iface
      • clazz

        protected java.lang.Class clazz
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • tupleClass

        public java.lang.Class tupleClass()
      • getFieldNames

        public java.lang.String[] getFieldNames()
      • getFieldTypes

        public java.lang.Class[] getFieldTypes()
      • generateClass

        protected abstract void generateClass()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createTuple

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

        public abstract <T> T createTypedTuple​(java.lang.Class<T> clazz)
                                        throws java.lang.Exception
        Allocates a new typed tuple, completely separate from any pooling. Use care to call TupleSchema.Builder.implementInterface(Class) before using this method
        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 abstract FastTuple[] createTupleArray​(int size)
                                              throws java.lang.Exception
        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.
        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 abstract <T> T[] createTypedTupleArray​(java.lang.Class<T> clazz,
                                                      int size)
                                               throws java.lang.Exception
        * 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.
        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
      • destroyTuple

        public abstract void destroyTuple​(FastTuple tuple)
        Deallocates memory for a tuple.
        Parameters:
        tuple - - FastTuple to deallocate
      • destroyTypedTuple

        public abstract <T> void destroyTypedTuple​(T tuple)
        Deallocates memory for a typed tuple.
        Type Parameters:
        T - - TupleSchema underlying class implemented by tuples
        Parameters:
        tuple - - FastTuple cast to type TupleSchema
      • destroyTupleArray

        public abstract void destroyTupleArray​(FastTuple[] ary)
        Deallocates memory for an array of tuples. Assumes that they were allocated as an array.
        Parameters:
        ary - - Array of FastTuple to deallocate
      • destroyTypedTupleArray

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

        public TuplePool<FastTuple> pool()
        Returns the tuple pool for this schema. Each individual thread accessing this method will see a different pool.
        Returns:
        - TuplePool of FastTuple
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()