Search in sources :

Example 6 with QueueContainer

use of com.hazelcast.collection.impl.queue.QueueContainer in project hazelcast by hazelcast.

the class PollOperation method run.

@Override
public void run() {
    QueueContainer queueContainer = getContainer();
    item = queueContainer.poll();
    if (item != null) {
        response = item.getData();
    }
}
Also used : QueueContainer(com.hazelcast.collection.impl.queue.QueueContainer)

Example 7 with QueueContainer

use of com.hazelcast.collection.impl.queue.QueueContainer in project hazelcast by hazelcast.

the class QueueReplicationOperation method run.

@Override
public void run() {
    QueueService service = getService();
    NodeEngine nodeEngine = getNodeEngine();
    Config config = nodeEngine.getConfig();
    for (Map.Entry<String, QueueContainer> entry : migrationData.entrySet()) {
        String name = entry.getKey();
        QueueContainer container = entry.getValue();
        QueueConfig conf = config.findQueueConfig(name);
        container.setConfig(conf, nodeEngine, service);
        service.addContainer(name, container);
    }
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) QueueConfig(com.hazelcast.config.QueueConfig) Config(com.hazelcast.config.Config) QueueConfig(com.hazelcast.config.QueueConfig) QueueContainer(com.hazelcast.collection.impl.queue.QueueContainer) QueueService(com.hazelcast.collection.impl.queue.QueueService) HashMap(java.util.HashMap) Map(java.util.Map)

Example 8 with QueueContainer

use of com.hazelcast.collection.impl.queue.QueueContainer in project hazelcast by hazelcast.

the class QueueReplicationOperation method writeInternal.

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

Example 9 with QueueContainer

use of com.hazelcast.collection.impl.queue.QueueContainer in project hazelcast by hazelcast.

the class RemainingCapacityOperation method run.

@Override
public void run() {
    QueueContainer queueContainer = getContainer();
    response = queueContainer.getConfig().getMaxSize() - queueContainer.size();
}
Also used : QueueContainer(com.hazelcast.collection.impl.queue.QueueContainer)

Example 10 with QueueContainer

use of com.hazelcast.collection.impl.queue.QueueContainer in project hazelcast by hazelcast.

the class DrainBackupOperation method run.

@Override
public void run() throws Exception {
    QueueContainer queueContainer = getContainer();
    queueContainer.drainFromBackup(itemIdSet);
}
Also used : QueueContainer(com.hazelcast.collection.impl.queue.QueueContainer)

Aggregations

QueueContainer (com.hazelcast.collection.impl.queue.QueueContainer)34 SerializableList (com.hazelcast.spi.impl.SerializableList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 QueueItem (com.hazelcast.collection.impl.queue.QueueItem)1 QueueService (com.hazelcast.collection.impl.queue.QueueService)1 Config (com.hazelcast.config.Config)1 QueueConfig (com.hazelcast.config.QueueConfig)1 Data (com.hazelcast.nio.serialization.Data)1 NodeEngine (com.hazelcast.spi.NodeEngine)1 ProxyService (com.hazelcast.spi.ProxyService)1 ArrayList (java.util.ArrayList)1