Search in sources :

Example 26 with GridCacheAdapter

use of org.apache.ignite.internal.processors.cache.GridCacheAdapter in project ignite by apache.

the class GridContinuousProcessor method start.

/** {@inheritDoc} */
@Override
public void start(boolean activeOnStart) throws IgniteCheckedException {
    if (ctx.config().isDaemon())
        return;
    retryDelay = ctx.config().getNetworkSendRetryDelay();
    retryCnt = ctx.config().getNetworkSendRetryCount();
    marsh = ctx.config().getMarshaller();
    ctx.event().addLocalEventListener(new GridLocalEventListener() {

        @SuppressWarnings({ "fallthrough", "TooBroadScope" })
        @Override
        public void onEvent(Event evt) {
            assert evt instanceof DiscoveryEvent;
            assert evt.type() == EVT_NODE_LEFT || evt.type() == EVT_NODE_FAILED;
            UUID nodeId = ((DiscoveryEvent) evt).eventNode().id();
            clientInfos.remove(nodeId);
            // Unregister handlers created by left node.
            for (Map.Entry<UUID, RemoteRoutineInfo> e : rmtInfos.entrySet()) {
                UUID routineId = e.getKey();
                RemoteRoutineInfo info = e.getValue();
                if (nodeId.equals(info.nodeId)) {
                    if (info.autoUnsubscribe)
                        unregisterRemote(routineId);
                    if (info.hnd.isQuery())
                        info.hnd.onNodeLeft();
                }
            }
            for (Map.Entry<IgniteUuid, SyncMessageAckFuture> e : syncMsgFuts.entrySet()) {
                SyncMessageAckFuture fut = e.getValue();
                if (fut.nodeId().equals(nodeId)) {
                    SyncMessageAckFuture fut0 = syncMsgFuts.remove(e.getKey());
                    if (fut0 != null) {
                        ClusterTopologyCheckedException err = new ClusterTopologyCheckedException("Node left grid while sending message to: " + nodeId);
                        fut0.onDone(err);
                    }
                }
            }
        }
    }, EVT_NODE_LEFT, EVT_NODE_FAILED);
    ctx.event().addLocalEventListener(new GridLocalEventListener() {

        @Override
        public void onEvent(Event evt) {
            cancelFutures(new IgniteCheckedException("Topology segmented"));
        }
    }, EVT_NODE_SEGMENTED);
    ctx.discovery().setCustomEventListener(StartRoutineDiscoveryMessage.class, new CustomEventListener<StartRoutineDiscoveryMessage>() {

        @Override
        public void onCustomEvent(AffinityTopologyVersion topVer, ClusterNode snd, StartRoutineDiscoveryMessage msg) {
            if (!snd.id().equals(ctx.localNodeId()) && !ctx.isStopping())
                processStartRequest(snd, msg);
        }
    });
    ctx.discovery().setCustomEventListener(StartRoutineAckDiscoveryMessage.class, new CustomEventListener<StartRoutineAckDiscoveryMessage>() {

        @Override
        public void onCustomEvent(AffinityTopologyVersion topVer, ClusterNode snd, StartRoutineAckDiscoveryMessage msg) {
            StartFuture fut = startFuts.remove(msg.routineId());
            if (fut != null) {
                if (msg.errs().isEmpty()) {
                    LocalRoutineInfo routine = locInfos.get(msg.routineId());
                    // Update partition counters.
                    if (routine != null && routine.handler().isQuery()) {
                        Map<UUID, Map<Integer, T2<Long, Long>>> cntrsPerNode = msg.updateCountersPerNode();
                        Map<Integer, T2<Long, Long>> cntrs = msg.updateCounters();
                        GridCacheAdapter<Object, Object> interCache = ctx.cache().internalCache(routine.handler().cacheName());
                        GridCacheContext cctx = interCache != null ? interCache.context() : null;
                        if (cctx != null && cntrsPerNode != null && !cctx.isLocal() && cctx.affinityNode())
                            cntrsPerNode.put(ctx.localNodeId(), cctx.topology().updateCounters(false));
                        routine.handler().updateCounters(topVer, cntrsPerNode, cntrs);
                    }
                    fut.onRemoteRegistered();
                } else {
                    IgniteCheckedException firstEx = F.first(msg.errs().values());
                    fut.onDone(firstEx);
                    stopRoutine(msg.routineId());
                }
            }
        }
    });
    ctx.discovery().setCustomEventListener(StopRoutineDiscoveryMessage.class, new CustomEventListener<StopRoutineDiscoveryMessage>() {

        @Override
        public void onCustomEvent(AffinityTopologyVersion topVer, ClusterNode snd, StopRoutineDiscoveryMessage msg) {
            if (!snd.id().equals(ctx.localNodeId())) {
                UUID routineId = msg.routineId();
                unregisterRemote(routineId);
            }
            for (Map<UUID, LocalRoutineInfo> clientInfo : clientInfos.values()) {
                if (clientInfo.remove(msg.routineId()) != null)
                    break;
            }
        }
    });
    ctx.discovery().setCustomEventListener(StopRoutineAckDiscoveryMessage.class, new CustomEventListener<StopRoutineAckDiscoveryMessage>() {

        @Override
        public void onCustomEvent(AffinityTopologyVersion topVer, ClusterNode snd, StopRoutineAckDiscoveryMessage msg) {
            StopFuture fut = stopFuts.remove(msg.routineId());
            if (fut != null)
                fut.onDone();
        }
    });
    ctx.io().addMessageListener(TOPIC_CONTINUOUS, new GridMessageListener() {

        @Override
        public void onMessage(UUID nodeId, Object obj) {
            GridContinuousMessage msg = (GridContinuousMessage) obj;
            if (msg.data() == null && msg.dataBytes() != null) {
                try {
                    msg.data(U.unmarshal(marsh, msg.dataBytes(), U.resolveClassLoader(ctx.config())));
                } catch (IgniteCheckedException e) {
                    U.error(log, "Failed to process message (ignoring): " + msg, e);
                    return;
                }
            }
            switch(msg.type()) {
                case MSG_EVT_NOTIFICATION:
                    processNotification(nodeId, msg);
                    break;
                case MSG_EVT_ACK:
                    processMessageAck(msg);
                    break;
                default:
                    assert false : "Unexpected message received: " + msg.type();
            }
        }
    });
    ctx.cacheObjects().onContinuousProcessorStarted(ctx);
    ctx.service().onContinuousProcessorStarted(ctx);
    if (log.isDebugEnabled())
        log.debug("Continuous processor started.");
}
Also used : GridLocalEventListener(org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener) GridMessageListener(org.apache.ignite.internal.managers.communication.GridMessageListener) DiscoveryEvent(org.apache.ignite.events.DiscoveryEvent) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) GridCacheAdapter(org.apache.ignite.internal.processors.cache.GridCacheAdapter) UUID(java.util.UUID) T2(org.apache.ignite.internal.util.typedef.T2) ClusterNode(org.apache.ignite.cluster.ClusterNode) GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) AffinityTopologyVersion(org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion) AtomicLong(java.util.concurrent.atomic.AtomicLong) Event(org.apache.ignite.events.Event) DiscoveryEvent(org.apache.ignite.events.DiscoveryEvent) GridTimeoutObject(org.apache.ignite.internal.processors.timeout.GridTimeoutObject) Map(java.util.Map) HashMap(java.util.HashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) ClusterTopologyCheckedException(org.apache.ignite.internal.cluster.ClusterTopologyCheckedException)

Example 27 with GridCacheAdapter

use of org.apache.ignite.internal.processors.cache.GridCacheAdapter in project ignite by apache.

the class GridQueryProcessor method processIndexOperationLocal.

/**
     * Process index operation.
     *
     * @param op Operation.
     * @param type Type descriptor.
     * @param depId Cache deployment ID.
     * @param cancelTok Cancel token.
     * @throws SchemaOperationException If failed.
     */
public void processIndexOperationLocal(SchemaAbstractOperation op, QueryTypeDescriptorImpl type, IgniteUuid depId, SchemaIndexOperationCancellationToken cancelTok) throws SchemaOperationException {
    if (log.isDebugEnabled())
        log.debug("Started local index operation [opId=" + op.id() + ']');
    String cacheName = op.cacheName();
    GridCacheAdapter cache = ctx.cache().internalCache(cacheName);
    if (cache == null || !F.eq(depId, cache.context().dynamicDeploymentId()))
        throw new SchemaOperationException(SchemaOperationException.CODE_CACHE_NOT_FOUND, cacheName);
    try {
        if (op instanceof SchemaIndexCreateOperation) {
            SchemaIndexCreateOperation op0 = (SchemaIndexCreateOperation) op;
            QueryIndexDescriptorImpl idxDesc = QueryUtils.createIndexDescriptor(type, op0.index());
            SchemaIndexCacheVisitor visitor = new SchemaIndexCacheVisitorImpl(this, cache.context(), cacheName, op0.tableName(), cancelTok);
            idx.dynamicIndexCreate(op0.schemaName(), op0.tableName(), idxDesc, op0.ifNotExists(), visitor);
        } else if (op instanceof SchemaIndexDropOperation) {
            SchemaIndexDropOperation op0 = (SchemaIndexDropOperation) op;
            idx.dynamicIndexDrop(op0.schemaName(), op0.indexName(), op0.ifExists());
        } else
            throw new SchemaOperationException("Unsupported operation: " + op);
    } catch (Exception e) {
        if (e instanceof SchemaOperationException)
            throw (SchemaOperationException) e;
        else
            throw new SchemaOperationException("Schema change operation failed: " + e.getMessage(), e);
    }
}
Also used : SchemaOperationException(org.apache.ignite.internal.processors.query.schema.SchemaOperationException) GridCacheAdapter(org.apache.ignite.internal.processors.cache.GridCacheAdapter) SchemaIndexCacheVisitor(org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitor) SchemaIndexCreateOperation(org.apache.ignite.internal.processors.query.schema.operation.SchemaIndexCreateOperation) SchemaIndexCacheVisitorImpl(org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitorImpl) SchemaIndexDropOperation(org.apache.ignite.internal.processors.query.schema.operation.SchemaIndexDropOperation) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) NodeStoppingException(org.apache.ignite.internal.NodeStoppingException) SQLException(java.sql.SQLException) CacheException(javax.cache.CacheException) SchemaOperationException(org.apache.ignite.internal.processors.query.schema.SchemaOperationException) GridClosureException(org.apache.ignite.internal.util.lang.GridClosureException)

Example 28 with GridCacheAdapter

use of org.apache.ignite.internal.processors.cache.GridCacheAdapter in project ignite by apache.

the class GridDiscoveryManager method createMetricsProvider.

/**
     * @return Metrics provider.
     */
private DiscoveryMetricsProvider createMetricsProvider() {
    return new DiscoveryMetricsProvider() {

        /** */
        private final long startTime = U.currentTimeMillis();

        /** {@inheritDoc} */
        @Override
        public ClusterMetrics metrics() {
            GridJobMetrics jm = ctx.jobMetric().getJobMetrics();
            ClusterMetricsSnapshot nm = new ClusterMetricsSnapshot();
            nm.setLastUpdateTime(U.currentTimeMillis());
            // Job metrics.
            nm.setMaximumActiveJobs(jm.getMaximumActiveJobs());
            nm.setCurrentActiveJobs(jm.getCurrentActiveJobs());
            nm.setAverageActiveJobs(jm.getAverageActiveJobs());
            nm.setMaximumWaitingJobs(jm.getMaximumWaitingJobs());
            nm.setCurrentWaitingJobs(jm.getCurrentWaitingJobs());
            nm.setAverageWaitingJobs(jm.getAverageWaitingJobs());
            nm.setMaximumRejectedJobs(jm.getMaximumRejectedJobs());
            nm.setCurrentRejectedJobs(jm.getCurrentRejectedJobs());
            nm.setAverageRejectedJobs(jm.getAverageRejectedJobs());
            nm.setMaximumCancelledJobs(jm.getMaximumCancelledJobs());
            nm.setCurrentCancelledJobs(jm.getCurrentCancelledJobs());
            nm.setAverageCancelledJobs(jm.getAverageCancelledJobs());
            nm.setTotalRejectedJobs(jm.getTotalRejectedJobs());
            nm.setTotalCancelledJobs(jm.getTotalCancelledJobs());
            nm.setTotalExecutedJobs(jm.getTotalExecutedJobs());
            nm.setMaximumJobWaitTime(jm.getMaximumJobWaitTime());
            nm.setCurrentJobWaitTime(jm.getCurrentJobWaitTime());
            nm.setAverageJobWaitTime(jm.getAverageJobWaitTime());
            nm.setMaximumJobExecuteTime(jm.getMaximumJobExecuteTime());
            nm.setCurrentJobExecuteTime(jm.getCurrentJobExecuteTime());
            nm.setAverageJobExecuteTime(jm.getAverageJobExecuteTime());
            nm.setCurrentIdleTime(jm.getCurrentIdleTime());
            nm.setTotalIdleTime(jm.getTotalIdleTime());
            nm.setAverageCpuLoad(jm.getAverageCpuLoad());
            // Job metrics.
            nm.setTotalExecutedTasks(ctx.task().getTotalExecutedTasks());
            // VM metrics.
            nm.setAvailableProcessors(metrics.getAvailableProcessors());
            nm.setCurrentCpuLoad(metrics.getCurrentCpuLoad());
            nm.setCurrentGcCpuLoad(metrics.getCurrentGcCpuLoad());
            nm.setHeapMemoryInitialized(metrics.getHeapMemoryInitialized());
            nm.setHeapMemoryUsed(metrics.getHeapMemoryUsed());
            nm.setHeapMemoryCommitted(metrics.getHeapMemoryCommitted());
            nm.setHeapMemoryMaximum(metrics.getHeapMemoryMaximum());
            nm.setHeapMemoryTotal(metrics.getHeapMemoryMaximum());
            nm.setNonHeapMemoryInitialized(metrics.getNonHeapMemoryInitialized());
            nonHeapMemoryUsed(nm);
            nm.setNonHeapMemoryCommitted(metrics.getNonHeapMemoryCommitted());
            nm.setNonHeapMemoryMaximum(metrics.getNonHeapMemoryMaximum());
            nm.setNonHeapMemoryTotal(metrics.getNonHeapMemoryMaximum());
            nm.setUpTime(metrics.getUptime());
            nm.setStartTime(metrics.getStartTime());
            nm.setNodeStartTime(startTime);
            nm.setCurrentThreadCount(metrics.getThreadCount());
            nm.setMaximumThreadCount(metrics.getPeakThreadCount());
            nm.setTotalStartedThreadCount(metrics.getTotalStartedThreadCount());
            nm.setCurrentDaemonThreadCount(metrics.getDaemonThreadCount());
            nm.setTotalNodes(1);
            // Data metrics.
            nm.setLastDataVersion(ctx.cache().lastDataVersion());
            GridIoManager io = ctx.io();
            // IO metrics.
            nm.setSentMessagesCount(io.getSentMessagesCount());
            nm.setSentBytesCount(io.getSentBytesCount());
            nm.setReceivedMessagesCount(io.getReceivedMessagesCount());
            nm.setReceivedBytesCount(io.getReceivedBytesCount());
            nm.setOutboundMessagesQueueSize(io.getOutboundMessagesQueueSize());
            return nm;
        }

        /**
             * @param nm Initializing metrics snapshot.
             */
        private void nonHeapMemoryUsed(ClusterMetricsSnapshot nm) {
            long nonHeapUsed = metrics.getNonHeapMemoryUsed();
            Map<Integer, CacheMetrics> nodeCacheMetrics = cacheMetrics();
            if (nodeCacheMetrics != null) {
                for (Map.Entry<Integer, CacheMetrics> entry : nodeCacheMetrics.entrySet()) {
                    CacheMetrics e = entry.getValue();
                    if (e != null)
                        nonHeapUsed += e.getOffHeapAllocatedSize();
                }
            }
            nm.setNonHeapMemoryUsed(nonHeapUsed);
        }

        /** {@inheritDoc} */
        @Override
        public Map<Integer, CacheMetrics> cacheMetrics() {
            Collection<GridCacheAdapter<?, ?>> caches = ctx.cache().internalCaches();
            if (F.isEmpty(caches))
                return Collections.emptyMap();
            Map<Integer, CacheMetrics> metrics = null;
            for (GridCacheAdapter<?, ?> cache : caches) {
                if (cache.configuration().isStatisticsEnabled() && cache.context().started() && cache.context().affinity().affinityTopologyVersion().topologyVersion() > 0) {
                    if (metrics == null)
                        metrics = U.newHashMap(caches.size());
                    metrics.put(cache.context().cacheId(), cache.localMetrics());
                }
            }
            return metrics == null ? Collections.<Integer, CacheMetrics>emptyMap() : metrics;
        }
    };
}
Also used : CacheMetrics(org.apache.ignite.cache.CacheMetrics) ClusterMetricsSnapshot(org.apache.ignite.internal.ClusterMetricsSnapshot) IgniteSystemProperties.getInteger(org.apache.ignite.IgniteSystemProperties.getInteger) GridJobMetrics(org.apache.ignite.internal.processors.jobmetrics.GridJobMetrics) GridIoManager(org.apache.ignite.internal.managers.communication.GridIoManager) GridCacheAdapter(org.apache.ignite.internal.processors.cache.GridCacheAdapter) DiscoveryMetricsProvider(org.apache.ignite.spi.discovery.DiscoveryMetricsProvider) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) GridBoundedConcurrentLinkedHashMap(org.apache.ignite.internal.util.GridBoundedConcurrentLinkedHashMap)

Example 29 with GridCacheAdapter

use of org.apache.ignite.internal.processors.cache.GridCacheAdapter in project ignite by apache.

the class GridQueryProcessor method processSchemaOperationLocal.

/**
 * Process schema operation.
 *
 * @param op Operation.
 * @param type Type descriptor.
 * @param depId Cache deployment ID.
 * @param cancelTok Cancel token.
 * @throws SchemaOperationException If failed.
 */
@SuppressWarnings("StatementWithEmptyBody")
public void processSchemaOperationLocal(SchemaAbstractOperation op, QueryTypeDescriptorImpl type, IgniteUuid depId, SchemaIndexOperationCancellationToken cancelTok) throws SchemaOperationException {
    if (log.isDebugEnabled())
        log.debug("Started local index operation [opId=" + op.id() + ']');
    String cacheName = op.cacheName();
    GridCacheAdapter cache = ctx.cache().internalCache(cacheName);
    if (cache == null || !F.eq(depId, cache.context().dynamicDeploymentId()))
        throw new SchemaOperationException(SchemaOperationException.CODE_CACHE_NOT_FOUND, cacheName);
    try {
        if (op instanceof SchemaIndexCreateOperation) {
            final SchemaIndexCreateOperation op0 = (SchemaIndexCreateOperation) op;
            QueryIndexDescriptorImpl idxDesc = QueryUtils.createIndexDescriptor(type, op0.index());
            GridCacheContext cctx = cache.context();
            SchemaIndexCacheFilter filter = new TableCacheFilter(cctx, op0.tableName());
            SchemaIndexCacheVisitor visitor = new SchemaIndexCacheVisitorImpl(cctx, filter, cancelTok, op0.parallel());
            idx.dynamicIndexCreate(op0.schemaName(), op0.tableName(), idxDesc, op0.ifNotExists(), visitor);
        } else if (op instanceof SchemaIndexDropOperation) {
            SchemaIndexDropOperation op0 = (SchemaIndexDropOperation) op;
            idx.dynamicIndexDrop(op0.schemaName(), op0.indexName(), op0.ifExists());
        } else if (op instanceof SchemaAlterTableAddColumnOperation) {
            SchemaAlterTableAddColumnOperation op0 = (SchemaAlterTableAddColumnOperation) op;
            processDynamicAddColumn(type, op0.columns());
            idx.dynamicAddColumn(op0.schemaName(), op0.tableName(), op0.columns(), op0.ifTableExists(), op0.ifNotExists());
        } else if (op instanceof SchemaAlterTableDropColumnOperation) {
            SchemaAlterTableDropColumnOperation op0 = (SchemaAlterTableDropColumnOperation) op;
            processDynamicDropColumn(type, op0.columns());
            idx.dynamicDropColumn(op0.schemaName(), op0.tableName(), op0.columns(), op0.ifTableExists(), op0.ifExists());
        } else
            throw new SchemaOperationException("Unsupported operation: " + op);
    } catch (Exception e) {
        if (e instanceof SchemaOperationException)
            throw (SchemaOperationException) e;
        else
            throw new SchemaOperationException("Schema change operation failed: " + e.getMessage(), e);
    }
}
Also used : SchemaOperationException(org.apache.ignite.internal.processors.query.schema.SchemaOperationException) GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) SchemaIndexCacheVisitor(org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitor) SchemaIndexCreateOperation(org.apache.ignite.internal.processors.query.schema.operation.SchemaIndexCreateOperation) SchemaIndexCacheVisitorImpl(org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitorImpl) SchemaIndexDropOperation(org.apache.ignite.internal.processors.query.schema.operation.SchemaIndexDropOperation) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) SQLException(java.sql.SQLException) SchemaOperationException(org.apache.ignite.internal.processors.query.schema.SchemaOperationException) IgniteException(org.apache.ignite.IgniteException) NodeStoppingException(org.apache.ignite.internal.NodeStoppingException) CacheException(javax.cache.CacheException) GridClosureException(org.apache.ignite.internal.util.lang.GridClosureException) GridCacheAdapter(org.apache.ignite.internal.processors.cache.GridCacheAdapter) SchemaAlterTableAddColumnOperation(org.apache.ignite.internal.processors.query.schema.operation.SchemaAlterTableAddColumnOperation) SchemaIndexCacheFilter(org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheFilter) SchemaAlterTableDropColumnOperation(org.apache.ignite.internal.processors.query.schema.operation.SchemaAlterTableDropColumnOperation)

Example 30 with GridCacheAdapter

use of org.apache.ignite.internal.processors.cache.GridCacheAdapter in project ignite by apache.

the class IgfsBlockMessageSystemPoolStarvationSelfTest method testStarvation.

/**
 * Test starvation.
 *
 * @throws Exception If failed.
 */
@SuppressWarnings("unchecked")
public void testStarvation() throws Exception {
    // 1. Create two IGFS file to make all system threads busy.
    CountDownLatch fileWriteLatch = new CountDownLatch(1);
    final IgniteInternalFuture fileFut1 = createFileAsync(new IgfsPath("/file1"), fileWriteLatch);
    final IgniteInternalFuture fileFut2 = createFileAsync(new IgfsPath("/file2"), fileWriteLatch);
    // 2. Start transaction and keep it opened.
    final CountDownLatch txStartLatch = new CountDownLatch(1);
    final CountDownLatch txCommitLatch = new CountDownLatch(1);
    IgniteInternalFuture<Void> txFut = GridTestUtils.runAsync(new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            GridCacheAdapter dataCache = dataCache(attacker);
            try (GridNearTxLocal tx = dataCache.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
                dataCache.put(DATA_KEY, 0);
                txStartLatch.countDown();
                txCommitLatch.await();
                tx.commit();
            }
            return null;
        }
    });
    txStartLatch.await();
    // 3. Start async operation to drain semaphore permits.
    final IgniteInternalFuture putFut = dataCache(victim).putAsync(DATA_KEY, 1);
    assert !awaitFuture(putFut);
    // 4. Write data to files and ensure we stuck.
    fileWriteLatch.countDown();
    assert !awaitFuture(fileFut1);
    assert !awaitFuture(fileFut2);
    // 5. Finish transaction.
    txCommitLatch.countDown();
    assert awaitFuture(txFut);
    // 6. Async put must succeed.
    assert awaitFuture(putFut);
    // 7. Writes must succeed.
    assert awaitFuture(fileFut1);
    assert awaitFuture(fileFut2);
}
Also used : IgfsPath(org.apache.ignite.igfs.IgfsPath) GridCacheAdapter(org.apache.ignite.internal.processors.cache.GridCacheAdapter) GridNearTxLocal(org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal) CountDownLatch(java.util.concurrent.CountDownLatch) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) IgniteCheckedException(org.apache.ignite.IgniteCheckedException)

Aggregations

GridCacheAdapter (org.apache.ignite.internal.processors.cache.GridCacheAdapter)50 IgniteEx (org.apache.ignite.internal.IgniteEx)18 Map (java.util.Map)15 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)15 Ignite (org.apache.ignite.Ignite)12 IgniteException (org.apache.ignite.IgniteException)12 IgniteKernal (org.apache.ignite.internal.IgniteKernal)12 ArrayList (java.util.ArrayList)11 UUID (java.util.UUID)11 Test (org.junit.Test)11 IgniteCache (org.apache.ignite.IgniteCache)10 HashMap (java.util.HashMap)9 ClusterNode (org.apache.ignite.cluster.ClusterNode)9 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)9 GridCacheContext (org.apache.ignite.internal.processors.cache.GridCacheContext)9 AffinityTopologyVersion (org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion)8 HashSet (java.util.HashSet)7 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)7 ClusterTopologyCheckedException (org.apache.ignite.internal.cluster.ClusterTopologyCheckedException)7 DynamicCacheDescriptor (org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor)7