Package com.hazelcast.multimap

Examples of com.hazelcast.multimap.MultiMapWrapper


        }

        if (keyIterator != null && keyIterator.hasNext()) {
            Data dataKey = keyIterator.next();
            key = (K) ss.toObject(dataKey);
            MultiMapWrapper wrapper = multiMapContainer.getMultiMapWrapper(dataKey);
            valueIterator = wrapper.getCollection(true).iterator();
            return hasNext();
        }

        return false;
    }
View Full Code Here


        this.value = value;
    }

    public void run() throws Exception {
        response = false;
        MultiMapWrapper wrapper = getCollectionWrapper();
        if (wrapper == null) {
            return;
        }
        Collection<MultiMapRecord> coll = wrapper.getCollection(false);
        MultiMapRecord record = new MultiMapRecord(isBinary() ? value : toObject(value));
        Iterator<MultiMapRecord> iter = coll.iterator();
        while (iter.hasNext()) {
            MultiMapRecord r = iter.next();
            if (r.equals(record)) {
View Full Code Here

        super(name, dataKey);
        this.recordId = recordId;
    }

    public void run() throws Exception {
        MultiMapWrapper wrapper = getCollectionWrapper();
        response = false;
        if (wrapper == null) {
            return;
        }
        Collection<MultiMapRecord> coll = wrapper.getCollection(false);
        Iterator<MultiMapRecord> iter = coll.iterator();
        while (iter.hasNext()){
            if(iter.next().getRecordId() == recordId){
                iter.remove();
                response = true;
View Full Code Here

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

    public void run() throws Exception {
        MultiMapWrapper wrapper = getOrCreateContainer().getMultiMapWrapper(dataKey);
        Collection coll = null;
        if (wrapper != null) {
            wrapper.incrementHit();
            final ResponseHandler responseHandler = getResponseHandler();
            coll = wrapper.getCollection(responseHandler.isLocal());
        }
        response = new MultiMapResponse(coll);
    }
View Full Code Here

        this.recordIds = recordIds;
    }

    public void run() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        MultiMapWrapper wrapper = container.getOrCreateMultiMapWrapper(dataKey);
        response = true;
        for (Long recordId: recordIds){
            if(!wrapper.containsRecordId(recordId)){
                response = false;
                return;
            }
        }
        Collection<MultiMapRecord> coll = wrapper.getCollection(false);
        for (Long recordId: recordIds){
            Iterator<MultiMapRecord> iter = coll.iterator();
            while (iter.hasNext()){
                MultiMapRecord record = iter.next();
                if (record.getRecordId() == recordId){
View Full Code Here

        this.value = value;
    }

    public void run() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        MultiMapWrapper wrapper = container.getMultiMapWrapper(dataKey);
        response = true;
        if (wrapper == null || !wrapper.containsRecordId(recordId)) {
            response = false;
            return;
        }
        Collection<MultiMapRecord> coll = wrapper.getCollection(false);
        Iterator<MultiMapRecord> iter = coll.iterator();
        while (iter.hasNext()){
            if (iter.next().getRecordId() == recordId){
                iter.remove();
                break;
View Full Code Here

        this.version = version;
        this.opList = opList;
    }

    public void run() throws Exception {
        MultiMapWrapper wrapper = getCollectionWrapper();
        if (wrapper == null || wrapper.getVersion() != version){
            notify = false;
            return;
        }
        wrapper.incrementAndGetVersion();
        for (Operation op: opList){
            op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
            op.beforeRun();
            op.run();
            op.afterRun();
View Full Code Here

        this.value = value;
    }

    public void run() throws Exception {
        MultiMapContainer container = getOrCreateContainer();
        MultiMapWrapper wrapper = container.getOrCreateMultiMapWrapper(dataKey);
        response = true;
        if (wrapper.containsRecordId(recordId)){
            response = false;
            return;
        }
        Collection<MultiMapRecord> coll = wrapper.getCollection(false);
        MultiMapRecord record = new MultiMapRecord(recordId, isBinary() ? value : toObject(value));
        coll.add(record);
    }
View Full Code Here

    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 = getOrCreateCollectionWrapper();

        final boolean isLocal = getResponseHandler().isLocal();
        final MultiMapResponse multiMapResponse = new MultiMapResponse(wrapper.getCollection(isLocal));
        multiMapResponse.setNextRecordId(container.nextId());
        multiMapResponse.setTxVersion(wrapper.incrementAndGetVersion());
        response = multiMapResponse;
    }
View Full Code Here

    }

    public void run() throws Exception {
        begin = Clock.currentTimeMillis();
        MultiMapContainer container = getOrCreateContainer();
        MultiMapWrapper wrapper = container.getMultiMapWrapper(dataKey);
        response = true;
        if (wrapper == null || !wrapper.containsRecordId(recordId)) {
            response = false;
            return;
        }
        Collection<MultiMapRecord> coll = wrapper.getCollection(false);
        Iterator<MultiMapRecord> iter = coll.iterator();
        while (iter.hasNext()) {
            if (iter.next().getRecordId() == recordId) {
                iter.remove();
                break;
View Full Code Here

TOP

Related Classes of com.hazelcast.multimap.MultiMapWrapper

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.