Search in sources :

Example 1 with ReadOnlyMetastorage

use of org.apache.ignite.internal.processors.cache.persistence.metastorage.ReadOnlyMetastorage in project ignite by apache.

the class DistributedMetaStorageImpl method start.

/**
 * {@inheritDoc}
 * <br/>
 * Create all required listeners.
 */
@Override
public void start() throws IgniteCheckedException {
    if (!isPersistenceEnabled)
        ver = INITIAL_VERSION;
    else {
        isp.registerMetastorageListener(new MetastorageLifecycleListener() {

            /**
             * {@inheritDoc}
             */
            @Override
            public void onReadyForRead(ReadOnlyMetastorage metastorage) throws IgniteCheckedException {
                onMetaStorageReadyForRead(metastorage);
            }

            /**
             * {@inheritDoc}
             */
            @Override
            public void onReadyForReadWrite(ReadWriteMetastorage metastorage) {
                onMetaStorageReadyForWrite(metastorage);
            }
        });
    }
    GridDiscoveryManager discovery = ctx.discovery();
    discovery.setCustomEventListener(DistributedMetaStorageUpdateMessage.class, this::onUpdateMessage);
    discovery.setCustomEventListener(DistributedMetaStorageUpdateAckMessage.class, this::onAckMessage);
}
Also used : ReadWriteMetastorage(org.apache.ignite.internal.processors.cache.persistence.metastorage.ReadWriteMetastorage) MetastorageLifecycleListener(org.apache.ignite.internal.processors.cache.persistence.metastorage.MetastorageLifecycleListener) DistributedMetastorageLifecycleListener(org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener) GridDiscoveryManager(org.apache.ignite.internal.managers.discovery.GridDiscoveryManager) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) ReadOnlyMetastorage(org.apache.ignite.internal.processors.cache.persistence.metastorage.ReadOnlyMetastorage)

Aggregations

IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 GridDiscoveryManager (org.apache.ignite.internal.managers.discovery.GridDiscoveryManager)1 MetastorageLifecycleListener (org.apache.ignite.internal.processors.cache.persistence.metastorage.MetastorageLifecycleListener)1 ReadOnlyMetastorage (org.apache.ignite.internal.processors.cache.persistence.metastorage.ReadOnlyMetastorage)1 ReadWriteMetastorage (org.apache.ignite.internal.processors.cache.persistence.metastorage.ReadWriteMetastorage)1 DistributedMetastorageLifecycleListener (org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener)1