Creates projection that will operate with binary objects.
Projection returned by this method will force cache not to deserialize binary objects,
so keys and values will be returned from cache API methods without changes. Therefore,
signature of the projection can contain only following types:
org.gridgain.grid.binary.BinaryObject
for binary classes
- All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)
- Arrays of primitives (byte[], int[], ...)
-
String and array of
Strings
-
UUID and array of
UUIDs
-
Date and array of
Dates
-
Timestamp and array of
Timestamps
- Enums and array of enums
-
Maps, collections and array of objects (but objects inside
them will still be converted if they are binary)
For example, if you use
Integer as a key and
Value class as a value
(which will be stored in binary format), you should acquire following projection
to avoid deserialization:
IgniteInternalCache prj = cache.keepBinary();
// Value is not deserialized and returned in binary format.
GridBinaryObject po = prj.get(1);
Note that this method makes sense only if cache is working in binary mode
(org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled()
returns
true. If not,
this method is no-op and will return current projection.