Package com.hazelcast.multimap.impl

Examples of com.hazelcast.multimap.impl.MultiMapContainer


        this.value = value;
        this.threadId = threadId;
    }

    public void run() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        ((MultiMapService) getService()).getLocalMultiMapStatsImpl(name).incrementOtherOperations();
        if (key != null && value != null) {
            response = container.containsEntry(isBinary(), key, value);
        } else if (key != null) {
            response = container.containsKey(key);
        } else {
            response = container.containsValue(isBinary(), value);
        }
    }
View Full Code Here


    @Override
    public boolean shouldWait() {
        if (key == null) {
            return false;
        }
        MultiMapContainer container = getOrCreateContainer();
        if (container.isTransactionallyLocked(key)) {
            return !container.canAcquireLock(key, getCallerUuid(), threadId);
        }
        return false;
    }
View Full Code Here

        }
    }

    public void run() throws Exception {
        begin = Clock.currentTimeMillis();
        MultiMapContainer container = getOrCreateContainer();
        MultiMapWrapper wrapper = container.getOrCreateMultiMapWrapper(dataKey);
        response = true;
        for (Long recordId : recordIds) {
            if (!wrapper.containsRecordId(recordId)) {
                response = false;
                return;
View Full Code Here

    public ClearOperation(String name) {
        super(name);
    }

    public void beforeRun() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        shouldBackup = container.size() > 0;
    }
View Full Code Here

        MultiMapContainer container = getOrCreateContainer();
        shouldBackup = container.size() > 0;
    }

    public void run() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        response = container.clear();
    }
View Full Code Here

        this.caller = caller;
        this.threadId = threadId;
    }

    public void run() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        if (!container.txnLock(dataKey, caller, threadId, ttl + LOCK_EXTENSION_TIME_IN_MILLIS)) {
            throw new TransactionException(
                    "Lock is not owned by the transaction! -> " + container.getLockOwnerInfo(dataKey)
            );
        }
    }
View Full Code Here

    public CountOperation(String name, Data dataKey) {
        super(name, dataKey);
    }

    public void run() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        ((MultiMapService) getService()).getLocalMultiMapStatsImpl(name).incrementOtherOperations();
        MultiMapWrapper wrapper = container.getMultiMapWrapperOrNull(dataKey);
        response = wrapper == null ? 0 : wrapper.getCollection(false).size();
    }
View Full Code Here

        return new LockWaitNotifyKey(new DefaultObjectNamespace(MultiMapService.SERVICE_NAME, name), dataKey);
    }

    @Override
    public boolean shouldWait() {
        MultiMapContainer container = getOrCreateContainer();
        if (container.isTransactionallyLocked(dataKey)) {
            return !container.canAcquireLock(dataKey, getCallerUuid(), threadId);
        }
        return false;
    }
View Full Code Here

        this.threadId = threadId;
        setWaitTimeout(timeout);
    }

    public void run() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        if (!container.txnLock(dataKey, getCallerUuid(), threadId, ttl)) {
            throw new TransactionException("Transaction couldn't obtain lock!");
        }
        MultiMapWrapper wrapper = getCollectionWrapper();
        final boolean isLocal = getResponseHandler().isLocal();
        Collection<MultiMapRecord> collection = wrapper == null ? null : wrapper.getCollection(isLocal);
        final MultiMapResponse multiMapResponse = new MultiMapResponse(collection, getValueCollectionType(container));
        multiMapResponse.setNextRecordId(container.nextId());
        response = multiMapResponse;
    }
View Full Code Here

    public GetAllOperation(String name, Data dataKey) {
        super(name, dataKey);
    }

    public void run() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        MultiMapWrapper wrapper = container.getMultiMapWrapperOrNull(dataKey);
        Collection coll = null;
        if (wrapper != null) {
            wrapper.incrementHit();
            final ResponseHandler responseHandler = getResponseHandler();
            coll = wrapper.getCollection(responseHandler.isLocal());
View Full Code Here

TOP

Related Classes of com.hazelcast.multimap.impl.MultiMapContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.