Search in sources :

Example 16 with CollectionContainer

use of com.hazelcast.collection.impl.collection.CollectionContainer in project hazelcast by hazelcast.

the class CollectionRemoveBackupOperation method run.

@Override
public void run() throws Exception {
    CollectionContainer collectionContainer = getOrCreateContainer();
    collectionContainer.removeBackup(itemId);
}
Also used : CollectionContainer(com.hazelcast.collection.impl.collection.CollectionContainer)

Example 17 with CollectionContainer

use of com.hazelcast.collection.impl.collection.CollectionContainer in project hazelcast by hazelcast.

the class CollectionRemoveOperation method run.

@Override
public void run() throws Exception {
    response = false;
    CollectionContainer collectionContainer = getOrCreateContainer();
    CollectionItem item = collectionContainer.remove(value);
    if (item != null) {
        response = true;
        itemId = item.getItemId();
    }
}
Also used : CollectionContainer(com.hazelcast.collection.impl.collection.CollectionContainer) CollectionItem(com.hazelcast.collection.impl.collection.CollectionItem)

Example 18 with CollectionContainer

use of com.hazelcast.collection.impl.collection.CollectionContainer in project hazelcast by hazelcast.

the class CollectionReplicationOperation method writeInternal.

@Override
protected void writeInternal(ObjectDataOutput out) throws IOException {
    out.writeInt(migrationData.size());
    for (Map.Entry<String, CollectionContainer> entry : migrationData.entrySet()) {
        out.writeUTF(entry.getKey());
        CollectionContainer container = entry.getValue();
        container.writeData(out);
    }
}
Also used : CollectionContainer(com.hazelcast.collection.impl.collection.CollectionContainer) Map(java.util.Map)

Example 19 with CollectionContainer

use of com.hazelcast.collection.impl.collection.CollectionContainer in project hazelcast by hazelcast.

the class CollectionAddAllOperation method run.

@Override
public void run() throws Exception {
    if (!hasEnoughCapacity(valueList.size())) {
        response = false;
        return;
    }
    CollectionContainer collectionContainer = getOrCreateContainer();
    valueMap = collectionContainer.addAll(valueList);
    response = !valueMap.isEmpty();
}
Also used : CollectionContainer(com.hazelcast.collection.impl.collection.CollectionContainer)

Example 20 with CollectionContainer

use of com.hazelcast.collection.impl.collection.CollectionContainer in project hazelcast by hazelcast.

the class CollectionAddBackupOperation method run.

@Override
public void run() throws Exception {
    CollectionContainer collectionContainer = getOrCreateContainer();
    collectionContainer.addBackup(itemId, value);
}
Also used : CollectionContainer(com.hazelcast.collection.impl.collection.CollectionContainer)

Aggregations

CollectionContainer (com.hazelcast.collection.impl.collection.CollectionContainer)24 Map (java.util.Map)2 CollectionItem (com.hazelcast.collection.impl.collection.CollectionItem)1 CollectionService (com.hazelcast.collection.impl.collection.CollectionService)1 ListContainer (com.hazelcast.collection.impl.list.ListContainer)1 SetContainer (com.hazelcast.collection.impl.set.SetContainer)1 Data (com.hazelcast.nio.serialization.Data)1 SerializableList (com.hazelcast.spi.impl.SerializableList)1