Package com.alibaba.graphscope.runtime
Class FFITypeFactory
- java.lang.Object
-
- com.alibaba.graphscope.runtime.FFITypeFactory
-
public class FFITypeFactory extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFFITypeFactory.ParameterizedTypeImpl
-
Constructor Summary
Constructors Constructor Description FFITypeFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringfindNativeLibrary(Class<?> clazz, String libraryName)static <T> TgetFactory(Class<?> ffiType)Get the factory from the FFIType.static <T> TgetFactory(Class<?> ffiType, String ffiTypeName)static <T> TgetFactory(Class<T> factoryType, Class<?> ffiType)static <T> TgetFactory(String ffiTypeName)static com.alibaba.fastffi.FFIByteString.FactorygetFFIByteStringFactory()static StringgetFFITypeName(Type ffiType, boolean useDefaultMapping)static <T extends com.alibaba.fastffi.FFIVector.Factory>
TgetFFIVectorFactory(Type elementType)accept primitive types, boxed primitive types, andstatic <T> TgetLibrary(Class<T> libraryInterface)static <T> TgetLibrary(Class<T> libraryInterface, String ffiLibraryName)Get the FFILibrary with the given library interface and ffi namestatic Class<?>getType(Class<?> ffiType)static Class<?>getType(Class<?> ffiType, String ffiTypeName)static Class<?>getType(ClassLoader classLoader, String ffiTypeName)Specifically for us, load different ffi type with different class loaderstatic Class<?>getType(String ffiTypeName)static voidloadClassLoader(ClassLoader classLoader)static ParameterizedTypemakeParameterizedType(Class<?> rawType, Type... arguments)static com.alibaba.fastffi.FFIByteStringnewByteString()static <E> com.alibaba.fastffi.FFIVector<E>newFFIVector(Type elementType)As slow as reflectionstatic voidunloadClassLoader(ClassLoader classLoader)
-
-
-
Method Detail
-
loadClassLoader
public static void loadClassLoader(ClassLoader classLoader)
-
unloadClassLoader
public static void unloadClassLoader(ClassLoader classLoader)
-
makeParameterizedType
public static ParameterizedType makeParameterizedType(Class<?> rawType, Type... arguments)
-
getType
public static Class<?> getType(Class<?> ffiType, String ffiTypeName) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
getType
public static Class<?> getType(ClassLoader classLoader, String ffiTypeName) throws ClassNotFoundException
Specifically for us, load different ffi type with different class loader- Parameters:
classLoader-ffiTypeName-- Returns:
- Throws:
ClassNotFoundException
-
getType
public static Class<?> getType(String ffiTypeName) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
getType
public static Class<?> getType(Class<?> ffiType) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
getFactory
public static <T> T getFactory(String ffiTypeName)
-
getFactory
public static <T> T getFactory(Class<?> ffiType)
Get the factory from the FFIType. The FFIType must not have type parameters, which means it cannot be annotated with CXXTemplate- Type Parameters:
T-- Parameters:
ffiType-- Returns:
-
getLibrary
public static <T> T getLibrary(Class<T> libraryInterface, String ffiLibraryName)
Get the FFILibrary with the given library interface and ffi name- Type Parameters:
T-- Parameters:
libraryInterface-ffiLibraryName-- Returns:
-
getLibrary
public static <T> T getLibrary(Class<T> libraryInterface)
-
newByteString
public static com.alibaba.fastffi.FFIByteString newByteString()
-
getFFIByteStringFactory
public static com.alibaba.fastffi.FFIByteString.Factory getFFIByteStringFactory()
-
newFFIVector
public static <E> com.alibaba.fastffi.FFIVector<E> newFFIVector(Type elementType)
As slow as reflection- Type Parameters:
E-- Parameters:
elementType-- Returns:
-
getFFIVectorFactory
public static <T extends com.alibaba.fastffi.FFIVector.Factory> T getFFIVectorFactory(Type elementType)
accept primitive types, boxed primitive types, and- Type Parameters:
T-- Parameters:
elementType-- Returns:
-
-