Class BinaryCachingMetadataHandler
- java.lang.Object
-
- org.apache.ignite.internal.binary.BinaryCachingMetadataHandler
-
- All Implemented Interfaces:
BinaryMetadataHandler
public class BinaryCachingMetadataHandler extends Object implements BinaryMetadataHandler
Simple caching metadata handler. Used mainly in tests.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMeta(int typeId, BinaryType type, boolean failIfUnregistered)Adds a new or updates an existing metadata to the latest version.voidaddMetaLocally(int typeId, BinaryType meta, boolean failIfUnregistered)Adds meta data locally on current node without sending any messages.static BinaryCachingMetadataHandlercreate()Create new handler instance.Collection<BinaryType>metadata()Gets all metadata known to the node.BinaryTypemetadata(int typeId)Gets metadata for provided type ID.BinaryTypemetadata(int typeId, int schemaId)Gets metadata for provided type ID and schema ID.BinaryMetadatametadata0(int typeId)Gets unwrapped metadata for provided type ID.
-
-
-
Method Detail
-
create
public static BinaryCachingMetadataHandler create()
Create new handler instance.- Returns:
- New handler.
-
addMeta
public void addMeta(int typeId, BinaryType type, boolean failIfUnregistered) throws BinaryObjectExceptionAdds a new or updates an existing metadata to the latest version. SeeMetadataUpdateProposedMessagejavadoc for detailed protocol description.- Specified by:
addMetain interfaceBinaryMetadataHandler- Parameters:
typeId- Type ID.type- Metadata.failIfUnregistered- Fail if unregistered.- Throws:
BinaryObjectException- In case of error.
-
addMetaLocally
public void addMetaLocally(int typeId, BinaryType meta, boolean failIfUnregistered) throws BinaryObjectExceptionAdds meta data locally on current node without sending any messages.- Specified by:
addMetaLocallyin interfaceBinaryMetadataHandler- Parameters:
typeId- Type ID.meta- Metadata.failIfUnregistered- Fail if unregistered.- Throws:
BinaryObjectException- In case of error.
-
metadata
public BinaryType metadata(int typeId) throws BinaryObjectException
Gets metadata for provided type ID.- Specified by:
metadatain interfaceBinaryMetadataHandler- Parameters:
typeId- Type ID.- Returns:
- Metadata.
- Throws:
BinaryObjectException- In case of error.
-
metadata0
public BinaryMetadata metadata0(int typeId) throws BinaryObjectException
Gets unwrapped metadata for provided type ID.- Specified by:
metadata0in interfaceBinaryMetadataHandler- Parameters:
typeId- Type ID.- Returns:
- Metadata.
- Throws:
BinaryObjectException- In case of error.
-
metadata
public BinaryType metadata(int typeId, int schemaId) throws BinaryObjectException
Gets metadata for provided type ID and schema ID.- Specified by:
metadatain interfaceBinaryMetadataHandler- Parameters:
typeId- Type ID.schemaId- Schema ID.- Returns:
- Metadata.
- Throws:
BinaryObjectException- In case of error.
-
metadata
public Collection<BinaryType> metadata() throws BinaryObjectException
Gets all metadata known to the node.- Specified by:
metadatain interfaceBinaryMetadataHandler- Returns:
- Metadata collection
- Throws:
BinaryObjectException- If failed.
-
-