public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor
GridComponent.DiscoveryDataExchangeTypectx, diagnosticLog, log| Constructor and Description |
|---|
CacheObjectBinaryProcessorImpl(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBinaryMetadataUpdateListener(BinaryMetadataUpdatedListener lsnr) |
void |
addMeta(int typeId,
BinaryType newMeta) |
BinaryField |
affinityKeyField(int typeId)
Get affinity key field.
|
IgniteBinary |
binary() |
BinaryContext |
binaryContext() |
BinaryObject |
buildEnum(String typeName,
int ord) |
BinaryObject |
buildEnum(String typeName,
String name) |
BinaryObjectBuilder |
builder(BinaryObject binaryObj)
Creates builder initialized by existing binary object.
|
BinaryObjectBuilder |
builder(String clsName) |
void |
collectGridNodeData(DiscoveryDataBag dataBag)
Collects discovery data on nodes already in grid on receiving
TcpDiscoveryNodeAddedMessage. |
CacheObjectContext |
contextForCache(CacheConfiguration cfg) |
GridComponent.DiscoveryDataExchangeType |
discoveryDataType()
Gets unique component type to distinguish components providing discovery data.
|
Object |
field(Object obj,
String fieldName) |
boolean |
hasField(Object obj,
String fieldName)
Checks whether field is set in the object.
|
boolean |
isBinaryEnabled(CacheConfiguration<?,?> ccfg)
Checks whether given class is binary.
|
boolean |
isBinaryObject(Object obj)
Checks whether object is binary object.
|
byte[] |
marshal(CacheObjectValueContext ctx,
Object val) |
byte[] |
marshal(Object obj) |
GridBinaryMarshaller |
marshaller() |
Object |
marshalToBinary(Object obj) |
Collection<BinaryType> |
metadata() |
Map<Integer,BinaryType> |
metadata(Collection<Integer> typeIds) |
BinaryType |
metadata(int typeId) |
BinaryType |
metadata(int typeId,
int schemaId) |
BinaryMetadata |
metadata0(int typeId) |
void |
onDisconnected(IgniteFuture<?> reconnectFut)
Client disconnected callback.
|
void |
onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
Receives discovery data object from remote nodes (called
on new node during discovery process).
|
void |
onKernalStart(boolean active)
Callback that notifies that kernal has successfully started,
including all managers and processors.
|
BinaryType |
registerEnum(String typeName,
Map<String,Integer> vals)
Register enum type
|
void |
start()
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
Object |
toBinary(Object obj) |
KeyCacheObject |
toCacheKeyObject(CacheObjectContext ctx,
GridCacheContext cctx,
Object obj,
boolean userObj) |
CacheObject |
toCacheObject(CacheObjectContext ctx,
byte type,
byte[] bytes) |
CacheObject |
toCacheObject(CacheObjectContext ctx,
Object obj,
boolean userObj) |
KeyCacheObject |
toKeyCacheObject(CacheObjectContext ctx,
byte type,
byte[] bytes) |
int |
typeId(Object obj) |
int |
typeId(String typeName) |
Object |
unmarshal(CacheObjectValueContext ctx,
byte[] bytes,
ClassLoader clsLdr) |
Object |
unmarshal(long ptr,
boolean forceHeap) |
Object |
unwrapTemporary(GridCacheContext ctx,
Object obj)
Converts temporary off-heap object to heap-based.
|
void |
updateMetadata(int typeId,
String typeName,
String affKeyFieldName,
Map<String,BinaryFieldMetadata> fieldTypeIds,
boolean isEnum,
Map<String,Integer> enumMap) |
IgniteNodeValidationResult |
validateNode(ClusterNode rmtNode)
Validates that new node can join grid topology, this method is called on coordinator
node before new node joins topology.
|
immutable, onContinuousProcessorStarted, partition, prepareForCache, toCacheKeyObject0, toCacheObject, toCacheObject, toCacheObject0, toKeyCacheObjectassertParameter, collectJoiningNodeData, onJoiningNodeDataReceived, onKernalStop, onReconnected, printMemoryStats, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitimmutable, onContinuousProcessorStarted, prepareForCache, toCacheObject, toCacheObject, toKeyCacheObjectcollectJoiningNodeData, onJoiningNodeDataReceived, onKernalStop, onReconnected, printMemoryStatspublic CacheObjectBinaryProcessorImpl(GridKernalContext ctx)
ctx - Kernal context.public void start()
throws IgniteCheckedException
start in interface GridComponentstart in class GridProcessorAdapterIgniteCheckedException - Throws in case of any errors.public void addBinaryMetadataUpdateListener(BinaryMetadataUpdatedListener lsnr)
lsnr - Listener.public void stop(boolean cancel)
stop in interface GridComponentstop in class GridProcessorAdaptercancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException
onDisconnected in interface GridComponentonDisconnected in class GridProcessorAdapterreconnectFut - Reconnect future.IgniteCheckedException - If failed.public void onKernalStart(boolean active)
throws IgniteCheckedException
onKernalStart in interface GridComponentonKernalStart in class GridProcessorAdapteractive - Cluster active flag (note: should be used carefully since state can
change concurrently).IgniteCheckedException - Thrown in case of any errors.public int typeId(String typeName)
typeId in interface IgniteCacheObjectProcessortypeId in class IgniteCacheObjectProcessorImpltypeName - Type name.public byte[] marshal(@Nullable
Object obj)
throws BinaryObjectException
obj - Object.BinaryObjectException - If failed.public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectException
ptr - Off-heap pointer.forceHeap - If true creates heap-based object.BinaryObjectException - If failed.public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException
marshalToBinary in interface CacheObjectBinaryProcessorobj - Original object.BinaryObjectExceptionpublic GridBinaryMarshaller marshaller()
public BinaryObjectBuilder builder(String clsName)
builder in interface CacheObjectBinaryProcessorclsName - Class name.public BinaryObjectBuilder builder(BinaryObject binaryObj)
builder in interface CacheObjectBinaryProcessorbinaryObj - Binary object to edit.public void updateMetadata(int typeId,
String typeName,
@Nullable
String affKeyFieldName,
Map<String,BinaryFieldMetadata> fieldTypeIds,
boolean isEnum,
@Nullable
Map<String,Integer> enumMap)
throws BinaryObjectException
updateMetadata in interface CacheObjectBinaryProcessortypeId - Type ID.typeName - Type name.affKeyFieldName - Affinity key field name.fieldTypeIds - Fields map.isEnum - Enum flag.enumMap - Enum name to ordinal mapping.BinaryObjectExceptionpublic void addMeta(int typeId,
BinaryType newMeta)
throws BinaryObjectException
addMeta in interface CacheObjectBinaryProcessortypeId - Type ID.newMeta - New meta data.BinaryObjectException@Nullable public BinaryType metadata(int typeId)
metadata in interface CacheObjectBinaryProcessortypeId - Type ID.@Nullable public BinaryMetadata metadata0(int typeId)
typeId - Type ID.IgniteException - In case of error.@Nullable public BinaryType metadata(int typeId, int schemaId)
metadata in interface CacheObjectBinaryProcessortypeId - Type ID.schemaId - Schema ID.public Map<Integer,BinaryType> metadata(Collection<Integer> typeIds) throws BinaryObjectException
metadata in interface CacheObjectBinaryProcessortypeIds - Type ID.BinaryObjectExceptionpublic Collection<BinaryType> metadata() throws BinaryObjectException
metadata in interface CacheObjectBinaryProcessorBinaryObjectExceptionpublic BinaryObject buildEnum(String typeName, int ord) throws BinaryObjectException
buildEnum in interface CacheObjectBinaryProcessortypeName - Type name.ord - ordinal.BinaryObjectExceptionpublic BinaryObject buildEnum(String typeName, String name) throws BinaryObjectException
buildEnum in interface CacheObjectBinaryProcessortypeName - Type name.name - Name.BinaryObjectExceptionpublic BinaryType registerEnum(String typeName, Map<String,Integer> vals) throws BinaryObjectException
registerEnum in interface CacheObjectBinaryProcessortypeName - Type name.vals - Mapping of enum constant names to ordinals.BinaryObjectExceptionpublic IgniteBinary binary() throws IgniteException
binary in interface CacheObjectBinaryProcessorbinary in interface IgniteCacheObjectProcessorbinary in class IgniteCacheObjectProcessorImplIgniteException - If failed.public boolean isBinaryObject(Object obj)
isBinaryObject in interface IgniteCacheObjectProcessorisBinaryObject in class IgniteCacheObjectProcessorImplobj - Object to check.True if object is already a binary object, false otherwise.public boolean isBinaryEnabled(CacheConfiguration<?,?> ccfg)
isBinaryEnabled in interface IgniteCacheObjectProcessorisBinaryEnabled in class IgniteCacheObjectProcessorImpltrue If binary objects are enabled.public BinaryField affinityKeyField(int typeId)
typeId - Binary object type ID.public int typeId(Object obj)
typeId in interface IgniteCacheObjectProcessortypeId in class IgniteCacheObjectProcessorImplobj - Object to get type ID for.public Object field(Object obj, String fieldName)
field in interface IgniteCacheObjectProcessorfield in class IgniteCacheObjectProcessorImplobj - Binary object to get field from.fieldName - Field name.public boolean hasField(Object obj, String fieldName)
hasField in interface IgniteCacheObjectProcessorhasField in class IgniteCacheObjectProcessorImplobj - Object.fieldName - Field name.true if field is set.public BinaryContext binaryContext()
public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException
contextForCache in interface IgniteCacheObjectProcessorcontextForCache in class IgniteCacheObjectProcessorImplcfg - Cache configuration.IgniteCheckedException - If failed.public byte[] marshal(CacheObjectValueContext ctx, Object val) throws IgniteCheckedException
marshal in interface IgniteCacheObjectProcessormarshal in class IgniteCacheObjectProcessorImplctx - Cache object context.val - Value.IgniteCheckedException - If failed.public Object unmarshal(CacheObjectValueContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException
unmarshal in interface IgniteCacheObjectProcessorunmarshal in class IgniteCacheObjectProcessorImplctx - Context.bytes - Bytes.clsLdr - Class loader.IgniteCheckedException - If failed.public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, @Nullable GridCacheContext cctx, Object obj, boolean userObj)
toCacheKeyObject in interface IgniteCacheObjectProcessortoCacheKeyObject in class IgniteCacheObjectProcessorImplctx - Cache objects context.cctx - Cache context if cache is available.obj - Key value.userObj - If true then given object is object provided by user and should be copied
before stored in cache.@Nullable public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj)
toCacheObject in interface IgniteCacheObjectProcessortoCacheObject in class IgniteCacheObjectProcessorImplctx - Cache context.obj - Object.userObj - If true then given object is object provided by user and should be copied
before stored in cache.public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes)
toCacheObject in interface IgniteCacheObjectProcessortoCacheObject in class IgniteCacheObjectProcessorImplctx - Cache context.type - Object type.bytes - Object bytes.public KeyCacheObject toKeyCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) throws IgniteCheckedException
toKeyCacheObject in interface IgniteCacheObjectProcessortoKeyCacheObject in class IgniteCacheObjectProcessorImplctx - Cache context.type - Object type.bytes - Object bytes.IgniteCheckedExceptionpublic Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException
unwrapTemporary in interface IgniteCacheObjectProcessorunwrapTemporary in class IgniteCacheObjectProcessorImplctx - Context.obj - Object.BinaryObjectException@Nullable public Object toBinary(@Nullable Object obj) throws IgniteException
obj - Object.IgniteException - In case of error.@Nullable public IgniteNodeValidationResult validateNode(ClusterNode rmtNode)
validateNode in interface GridComponentvalidateNode in class GridProcessorAdapterrmtNode - Joining node.null in case of success.@Nullable public GridComponent.DiscoveryDataExchangeType discoveryDataType()
GridComponent.collectJoiningNodeData(DiscoveryDataBag)
or GridComponent.collectGridNodeData(DiscoveryDataBag).discoveryDataType in interface GridComponentdiscoveryDataType in class GridProcessorAdapterpublic void collectGridNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryNodeAddedMessage.collectGridNodeData in interface GridComponentcollectGridNodeData in class GridProcessorAdapterdataBag - container object to store discovery data in.public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
onGridDataReceived in interface GridComponentonGridDataReceived in class GridProcessorAdapterdata - DiscoveryDataBag.GridDiscoveryData interface to retrieve discovery data collected on remote nodes
(data common for all nodes in grid and specific for each node).
Follow @ApacheIgnite
Ignite Fabric : ver. 2.1.0 Release Date : July 20 2017