Interface BinariesFactory
-
public interface BinariesFactoryFactory for binaries classes creation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.ignite.internal.binary.BinaryIdentityResolverarrayIdentityResolver()BinaryObjectExbinaryEnum(BinaryContext ctx, byte[] arr)Creates binary enum.BinaryObjectExbinaryEnum(BinaryContext ctx, int typeId, @Nullable String clsName, int ord)Creates binary enum.Class<?>binaryEnumClass()BinaryObjectExbinaryObject(BinaryContext ctx, byte[] bytes)Creates new instance of binary object.BinaryObjectExbinaryObject(BinaryContext ctx, byte[] arr, int start)Creates new instance of binary object.BinaryObjectbinaryObject(BinaryContext ctx, byte[] valBytes, CacheObjectValueContext coCtx)Creates new instance of binary object.Class<?>binaryObjectImplClass()BinaryObjectExbinaryOffheapObject(BinaryContext ctx, long ptr, int start, int size)intcompareForDml(Object first, Object second)Compare two objects for DML operation.org.apache.ignite.internal.binary.BinaryFieldDescriptorcreate(Field field, int id)Create accessor for the field.Map<Class<?>,Integer>predefinedTypes()BinaryReaderExreader(BinaryContext ctx, BinaryInputStream in, ClassLoader ldr, boolean forUnmarshal)Creates reader instance.BinaryReaderExreader(BinaryContext ctx, BinaryInputStream in, ClassLoader ldr, @Nullable org.apache.ignite.internal.binary.BinaryReaderHandles hnds, boolean forUnmarshal)Creates reader instance.BinaryReaderExreader(BinaryContext ctx, BinaryInputStream in, ClassLoader ldr, @Nullable org.apache.ignite.internal.binary.BinaryReaderHandles hnds, boolean skipHdrCheck, boolean forUnmarshal)Constructor.Map<Class<?>,ToIntFunction<Object>>sizeProviders()BinaryWriterExwriter(BinaryContext ctx, boolean failIfUnregistered, int typeId)BinaryWriterExwriter(BinaryContext ctx, BinaryOutputStream out)BinaryWriterExwriter(BinaryContext ctx, BinaryOutputStream out, org.apache.ignite.internal.binary.BinaryWriterSchemaHolder schema)
-
-
-
Method Detail
-
reader
BinaryReaderEx reader(BinaryContext ctx, BinaryInputStream in, ClassLoader ldr, boolean forUnmarshal)
Creates reader instance.- Parameters:
ctx- Context.in- Input stream.ldr- Class loader.forUnmarshal-Trueif reader is needed to unmarshal object.
-
reader
BinaryReaderEx reader(BinaryContext ctx, BinaryInputStream in, ClassLoader ldr, @Nullable @Nullable org.apache.ignite.internal.binary.BinaryReaderHandles hnds, boolean forUnmarshal)
Creates reader instance.- Parameters:
ctx- Context.in- Input stream.ldr- Class loader.hnds- Context.forUnmarshal-Trueif reader is needed to unmarshal object.
-
reader
BinaryReaderEx reader(BinaryContext ctx, BinaryInputStream in, ClassLoader ldr, @Nullable @Nullable org.apache.ignite.internal.binary.BinaryReaderHandles hnds, boolean skipHdrCheck, boolean forUnmarshal)
Constructor.- Parameters:
ctx- Context.in- Input stream.ldr- Class loader.hnds- Context.skipHdrCheck- Whether to skip header check.forUnmarshal-Trueif reader is needed to unmarshal object.
-
writer
BinaryWriterEx writer(BinaryContext ctx, boolean failIfUnregistered, int typeId)
- Parameters:
ctx- Context.failIfUnregistered- Flag to fail while writing object of unregistered type.typeId- Type id.- Returns:
- Writer instance.
-
writer
BinaryWriterEx writer(BinaryContext ctx, BinaryOutputStream out)
- Parameters:
ctx- Context.out- Output stream.- Returns:
- Writer instance.
-
writer
BinaryWriterEx writer(BinaryContext ctx, BinaryOutputStream out, org.apache.ignite.internal.binary.BinaryWriterSchemaHolder schema)
- Parameters:
ctx- Context.out- Output stream.schema- Schema holder- Returns:
- Writer instance.
-
create
org.apache.ignite.internal.binary.BinaryFieldDescriptor create(Field field, int id)
Create accessor for the field.- Parameters:
field- Field.id- Field ID.- Returns:
- Accessor.
-
binaryEnum
BinaryObjectEx binaryEnum(BinaryContext ctx, int typeId, @Nullable @Nullable String clsName, int ord)
Creates binary enum.- Parameters:
typeId- Type ID.clsName- Class name.ord- Ordinal.ctx- Context.
-
binaryEnum
BinaryObjectEx binaryEnum(BinaryContext ctx, byte[] arr)
Creates binary enum.- Parameters:
ctx- Context.arr- Array.
-
binaryOffheapObject
BinaryObjectEx binaryOffheapObject(BinaryContext ctx, long ptr, int start, int size)
- Parameters:
ctx- Context.ptr- Memory address.start- Object start.size- Memory size.- Returns:
- Binary object based on offheap memory.
-
binaryEnumClass
Class<?> binaryEnumClass()
- Returns:
- Binary enum class.
-
binaryObjectImplClass
Class<?> binaryObjectImplClass()
- Returns:
- Binary object impl class.
-
sizeProviders
Map<Class<?>,ToIntFunction<Object>> sizeProviders()
- Returns:
- Map of function returning size of the object.
-
compareForDml
int compareForDml(Object first, Object second)
Compare two objects for DML operation.- Parameters:
first- First.second- Second.- Returns:
- Comparison result which is aligned with the
Comparator.compare(Object, Object)contract.
-
binaryObject
BinaryObjectEx binaryObject(BinaryContext ctx, byte[] arr, int start)
Creates new instance of binary object.
-
binaryObject
BinaryObjectEx binaryObject(BinaryContext ctx, byte[] bytes)
Creates new instance of binary object.
-
binaryObject
BinaryObject binaryObject(BinaryContext ctx, byte[] valBytes, CacheObjectValueContext coCtx)
Creates new instance of binary object.
-
arrayIdentityResolver
org.apache.ignite.internal.binary.BinaryIdentityResolver arrayIdentityResolver()
-
-