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 class
FFITypeFactory.ParameterizedTypeImpl
-
Constructor Summary
Constructors Constructor Description FFITypeFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
findNativeLibrary(Class<?> clazz, String libraryName)
static <T> T
getFactory(Class<?> ffiType)
Get the factory from the FFIType.static <T> T
getFactory(Class<?> ffiType, String ffiTypeName)
static <T> T
getFactory(Class<T> factoryType, Class<?> ffiType)
static <T> T
getFactory(String ffiTypeName)
static com.alibaba.fastffi.FFIByteString.Factory
getFFIByteStringFactory()
static String
getFFITypeName(Type ffiType, boolean useDefaultMapping)
static <T extends com.alibaba.fastffi.FFIVector.Factory>
TgetFFIVectorFactory(Type elementType)
accept primitive types, boxed primitive types, andstatic <T> T
getLibrary(Class<T> libraryInterface)
static <T> T
getLibrary(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 void
loadClassLoader(ClassLoader classLoader)
static ParameterizedType
makeParameterizedType(Class<?> rawType, Type... arguments)
static com.alibaba.fastffi.FFIByteString
newByteString()
static <E> com.alibaba.fastffi.FFIVector<E>
newFFIVector(Type elementType)
As slow as reflectionstatic void
unloadClassLoader(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:
-
-