Table of Contents |
---|
Apache Ignite 2.0 incorporate tremendous changes that make it different from Apache Ignite 1.x releases. Apache Ignite 2.0 is incompatible with previous versions and, most likely, application code has to be altered if someone plans to migrate to 2.0. Below you will find the main public API changes introduced in version 2.0.
...
Apache Ignite 2.0 and later versions are is based on the new off-heap page memory architecture that is well explained in this documentation: https://apacheignite.readme.io/docs/page-memory
Look over the documentation above to learn more about new concepts and configuration parameters. The sections below list APIs existed prior to 2.0 and that was reworked in the latest version.
Cache Memory Modes:
...
. Data is always stored offheap, with ability to optionally cache small portion in Java heap. See documentation for more information [1].
gridName
- deprecated, use igniteInstanceName
failureDetectionTimeout
- now this property affects only server nodes, use IgniteConfiguration.clientFailureDetectionTimeout
for client nodesmarshallerCacheThreadPoolSize
- removed due to changes in marshaller metadata handling
marshallerCacheKeepAliveTime
- removed due to changes in marshaller metadata handling
clockSyncSamples
- removed because CLOCK
mode is no longer supported for ATOMIC
cache
clockSyncFrequency
- removed because CLOCK
mode is no longer supported for ATOMIC
cache
swapSpaceSpi
- removed due to new Ignite page memory architecture [1]
The following properties have been changed/removed:
atomicWriteOrderMode
- removed because CLOCK
mode is no longer supported for ATOMIC
cache
name
- null
name is not allowed any more
typeMetadata
- removed, use queryEntities
property
The following properties have been removed due to new Ignite page memory architecture [1]:
evictSynchronized
evictSynchronizedKeyBufferSize
evictSynchronizedConcurrencyLevel
evictSynchronizedTimeout
evictMaxOverflowRatio
memoryMode
offHeapMaxMemory
snapshotableIndex
sqlOnheapRowCacheSize
startSize
swapEnabled
Previously existed eviction mechanisms based on EvictionPolicy
is
...
Eviction Policies
Previously existed eviction mechanisms based on `EvictionPolicy` is now supported only for optional near and Java heap caching of the data stored in the off-heap offheap page memory. To enable the eviction for the page memory, use `DataPageEvictionMode` enumeration. Refer to this documentation for more details: https://apacheignite.readme.io/docs/evictions
Cache and Memory Metrics
The following methods were removed from `CacheMetrics` interface as part of a migration to the off-heap memory architecture: getOverflowSize, getOffHeapMaxSize, getSwapGets, getSwapPuts, getSwapRemovals, getSwapHits, getSwapMisses, getSwapEntriesCount, getSwapSize, getSwapHitPercentage, getSwapMissPercentage.
To support the new memory architecture, `MemoryMetrics` interface was introduced in order to get insights on a state and behavior of the memory in runtime. Refer to this documentation if you plan to leverage from this interface: https://apacheignite.readme.io/docs/memory-metrics
Default Cache Name
`null` can no longer be used as a cache name. If a cache is started with an empty named then it will be named `default` and you can get it using either `Ignite.cache(null)` or `Ignite.cache("default")` calls.
...
IgniteConfiguration's `getGridName/setGridName` methods are deprecated and will be removed in later releases. Use IgniteConfiguration's `getIgniteInstanceName/setIgniteInstanceName` instead.
...
use DataPageEvictionMode
enumeration. See documentation for more details [2].
memoryMode
property has been removed due to new Ignite page memory architecture [1]name
- null
name is no longer allowedmetaCacheName
- removed, use metaCacheConfiguration
dataCacheName
- removed, use dataCacheConfiguration
streamBufferSize
- renamed to bufferSize
maxSpace
- removed, maximum memory is now controlled through MemoryPolicy
[1]initializeDefaultPathModes
- removedtrashPurgeTimeout
- removedfragmentizerLocWritesRatio
- removed dualModePutExecutorService
- removeddualModePutExecutorServiceShutdown
- removeddualModeMaxPendingPutsSize
- removedHeartbeat-related properties have been removed. Now heartbeat frequency is controlled through IgniteConfiguration.metricsUpdateFrequency
property.
maxMissedClientHeartbeats
heartbeatFrequency
Several deprecated properties have been removed:
connectionBufferSize
connectionBufferFlushFrequency
minimumBufferedMessageCount
awsCredentials
- renamed to awsCredentialsProvider
IgniteAsyncSupport
interface is now deprecated and will be removed in future Apache Ignite releases. Use methods with Async
suffix instead. See documentation for more information [4].
Old style:
Code Block |
---|
IgniteCache<K, V> asyncCache = cache.withAsync();
asyncCache.getAsync(key);
IgniteFuture<V> future = asyncCache.future(); |
New style:
Code Block |
---|
IgniteFuture<V> future = сache.getAsync(key); |
Implementation has been removed from public API and is not expected to be used directly anymore.
SPI has been removed due to new Ignite page memory architecture [1]. The swapping tier can only be used if a swapping file is set via MemoryPolicyConfiguration.swapFilePath
property.
Interface has been removed. Now key hash code and equality is calculated based on content of serialized object.
Several event types have been removed due to new Ignite page memory architecture:
EVT_CACHE_OBJECT_SWAPPED
EVT_CACHE_OBJECT_UNSWAPPED
EVT_SWAP_SPACE_DATA_READ
EVT_SWAP_SPACE_DATA_STORED
EVT_SWAP_SPACE_DATA_REMOVED
EVT_SWAP_SPACE_CLEARED
EVT_SWAP_SPACE_DATA_EVICTED
EVT_CACHE_OBJECT_TO_OFFHEAP
EVT_CACHE_OBJECT_FROM_OFFHEAP
mapKeysToNodes
- removed, use Affinity.mapKeysToNodes
mapKeyToNode
- removed, use Affinity.mapKeyToNode
Several methods were removed with no replacement:
startTime
duration
randomEntry
- removedlocalPromote
- removed due to new Ignite page memory architecture [1]updateTime
method was removed
The following methods were removed as part of a migration to page memory architecture [1]. New MemoryMetrics
interface has been introduced in order to monitor memory usage in runtime [3].
getOverflowSize
getOffHeapMaxSize
getSwapGets
getSwapPuts
getSwapRemovals
getSwapHits
getSwapMisses
getSwapEntriesCount
getSwapSize
getSwapHitPercentage
getSwapMissPercentage
Enumeration has been removed due to new Ignite page memory architecture [1]. Offheap is used as the main storage tier with an ability to enable Java heap caching via CacheConfiguration.onheapCacheEnabled
property.
Enumeration has been removed because CLOCK
mode is no longer supported for ATOMIC
cache.
SWAP value has been removed due to new Ignite page memory architecture [1]. The swapping tier can only be used if a swapping file is set via MemoryPolicyConfiguration.swapFilePath
property.
No longer allowed on methods.
Implementation has been removed due to well-known problems with co-location between caches on different versions of cluster topology. Use RendezvousAffinityFunction
.
Interface has been removed. Use IgniteConfiguration.consistentId
property.
Implementation has been removed with no replacement.
No longer allowed on methods.
Before Apache Ignite 2.0 SqlFieldsQuery
in the form "SELECT * FROM ..."
returned special _key
and _val
columns representing actual cache entry key and value respectively. These columns are not returned anymore unless specified explicitly.
Classes have been removed. Use QueryEntity
class and CacheConfiguration.queryEntities
property.
Ignite process different types of requests in special thread pools to provide clear separation of concerns and avoid starvation. Several new thread pools were added in Apache Ignite 2.0:
Service Grid calls are now processed in dedicated thread pool (see IgniteConfiguration.serviceThreadPoolSize
property)
IgniteConfiguration.dataStreamerThreadPoolSize
property)IgniteConfiguration.queryThreadPoolSize
property)Utility has been removed. Please use Web Console [7].
Spring Framework dependency has been upgraded to 4.3.7.RELEASE
version.
Apache Ignite 2.0 integrates with Hibernate 5.0. The previous integration with a legacy Hibernate version of 4.2 can be used by importing ignite-hibernate_4.2
maven artifact or taking a respective JAR file from distribution. See documentation for more details [5]
Default Redis cache name was changed from null
to default
. See documentation for more details [6]
Class was removed. Please use CompiledQuery
.
LockId
property has been removed.
DefaultNameMapper
- renamed to NameMapper
DefaultIdMapper
- renamed to IdMapper
DefaultKeepDeserialized
- renamed to KeepDeserialized
Renamed to ILifecycleHandler
. {{IgniteConfiguration.LifecycleBeans}} property renamed to IgniteConfiguration.LifecycleHandlers
.
...
Redis Integration
Default Redis cache name was changed from 'null' to 'redis_cache'.
...
BinaryConfiguration
is is no longer required: , any type can be used in Cache and Compute straight right away. All objects are written in Ignite binary format, including types implementing interface. See documentation for more information [8].
Ignite.NET 1.9 and earlier uses simple name mapping only, which means Object.GetType().Name
is used to map type name to type id. Ignite.NET 2.0 uses full name mapping by default, which includes namespace, generics and array dimensions. This change may affect multi-platform Ignite applications where Java and .NET types are mapped to each other. See documentation for more information [9].
CachePeekMode: IGNITE_PEEK_MODE_*
->
CachePeekMode::*
(e.g. IGNITE_PEEK_MODE_PRIMARY -> CachePeekMode::PRIMARY
)TransactionConcurrency: IGNITE_TX_CONCURRENCY_* -> TransactionConcurrency::*
(e.g. IGNITE_TX_CONCURRENCY_OPTIMISTIC -> TransactionConcurrency::OPTIMISTIC
)TransactionIsolation: IGNITE_TX_ISOLATION_* -> TransactionIsolation::*
(e.g. IGNITE_TX_ISOLATION_READ_COMMITTED -> TransactionIsolation::REPEATABLE_READ
)TransactionState: IGNITE_TX_STATE_* -> TransactionState::*
(e.g. IGNITE_TX_STATE_ACTIVE -> TransactionState::ACTIVE
)CollectionType: IGNITE_COLLECTION_* -> CollectionType::*
(e.g. IGNITE_COLLECTION_ARRAY_LIST -> CollectionType::ARRAY_LIST
)MapType: IGNITE_MAP_* -> MapType::*
(e.g. IGNITE_MAP_HASH_MAP -> MapType::HASH_MAP
)IgniteError
now should be passed by reference and not by pointer everywhere.
BinaryWriter::WriteObject
and BinaryRawWriter::WriteObject
now take constant references instead of value. This probably won't require any changes from you.
BinaryType
have been heavily refactored:
BinaryType
methods, meaning you are now going to have compilation errors instead of runtime errors if you have not implemented some essential method for your binary type. If you don't want to implement some method and you are sure that you will not be needing it then you should explicitly provide implementation of such method which asserts or throws exception upon call.GetHashCode
and GetIdentityResolver
methods are not used any more.BinaryType::Write
now takes object argument by constant reference and not by value: void Write(BinaryWriter&, T) -> static void Write(BinaryWriter&, const T&)
BinaryType::Read
now returns object by argument reference and not as return value (method does not return any value any more): T Read(BinaryReader&) -> static void Read(BinaryReader&, T&)
BinaryType::GetTypeName
now return name by argument reference and not as return value: std::string GetTypeName() -> static void GetTypeName(std::string&)
BinaryType::GetNull
now return null value by argument reference and not as return value: T GetNull() -> static void GetNull(T&)
QueryArgument
and QueryArgumentBase
classes are not public any more. This should not affect any users as these classes were not meant for use by users from the beginning.
[1] https://apacheignite.readme.io/docs/page-memory
[2] https://apacheignite.readme.io/docs/evictions
[3] https://apacheignite.readme.io/docs/memory-metrics
[4] https://apacheignite.readme.io/docs/async-support
[5] https://apacheignite-mix.readme.io/docs/hibernate-l2-cache
[6] https://apacheignite.readme.io/docs/redis
[7] https://apacheignite-tools.readme.io/docs/automatic-rdbms-integration
[8] https://apacheignite-net.readme.io/docs/serialization
[9] https://apacheignite-net.readme.io/docs/platform-interoperability
which means IBinary and SQL APIs always work).Serializable types (including those which implement ISerializable) are also written using Ignite binary format.