Examples of IQueue


Examples of com.hazelcast.core.IQueue

    private List<Runnable> loadQOperations() {
        List<Runnable> operations = new ArrayList<Runnable>();
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                q.offer(new byte[100]);
            }
        }, 10);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                try {
                    q.offer(new byte[100], 10, TimeUnit.MILLISECONDS);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }, 10);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                q.contains(new byte[100]);
            }
        }, 1);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                q.isEmpty();
            }
        }, 1);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                q.size();
            }
        }, 1);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                q.remove(new byte[100]);
            }
        }, 1);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                q.remainingCapacity();
            }
        }, 1);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                q.poll();
            }
        }, 10);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                q.add(new byte[100]);
            }
        }, 10);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                try {
                    q.take();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }, 10);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                List list = new ArrayList();
                for (int i = 0; i < 10; i++) {
                    list.add(new byte[100]);
                }
                q.addAll(list);
            }
        }, 1);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                List list = new ArrayList();
                q.drainTo(list);
            }
        }, 1);
        return operations;
    }
View Full Code Here

Examples of com.hazelcast.core.IQueue

                    if (config.findMapConfig(map.getName()).isStatisticsEnabled()) {
                        memberState.putLocalMapStats(map.getName(), (LocalMapStatsImpl) map.getLocalMapStats());
                        count++;
                    }
                } else if (distributedObject instanceof IQueue) {
                    IQueue queue = (IQueue) distributedObject;
                    if (config.findQueueConfig(queue.getName()).isStatisticsEnabled()) {
                        LocalQueueStatsImpl stats = (LocalQueueStatsImpl) queue.getLocalQueueStats();
                        memberState.putLocalQueueStats(queue.getName(), stats);
                        count++;
                    }
                } else if (distributedObject instanceof ITopic) {
                    ITopic topic = (ITopic) distributedObject;
                    if (config.findTopicConfig(topic.getName()).isStatisticsEnabled()) {
View Full Code Here

Examples of com.hazelcast.core.IQueue

                    if (config.findMapConfig(map.getName()).isStatisticsEnabled()) {
                        setLongInstanceNames.add("c:" + map.getName());
                        count++;
                    }
                } else if (distributedObject instanceof IQueue) {
                    IQueue queue = (IQueue) distributedObject;
                    if (config.findQueueConfig(queue.getName()).isStatisticsEnabled()) {
                        setLongInstanceNames.add("q:" + queue.getName());
                        count++;
                    }
                } else if (distributedObject instanceof ITopic) {
                    ITopic topic = (ITopic) distributedObject;
                    if (config.findTopicConfig(topic.getName()).isStatisticsEnabled()) {
View Full Code Here

Examples of com.hazelcast.core.IQueue

            producer.setNode(getNode());
            producer.setConfigurationAdmin(configurationAdmin);
            producer.init();
            return producer;
        } else {
            IQueue queue = instance.getQueue(Constants.QUEUE + Constants.SEPARATOR + name);
            QueueProducer producer = new QueueProducer();
            producer.setQueue(queue);
            producer.setNode(getNode());
            producer.setConfigurationAdmin(configurationAdmin);
            producer.init();
View Full Code Here

Examples of com.hazelcast.core.IQueue

            consumer.setDispatcher(dispatcher);
            consumer.setConfigurationAdmin(configurationAdmin);
            consumer.init();
            return consumer;
        } else {
            IQueue queue = instance.getQueue(Constants.QUEUE + Constants.SEPARATOR + name);
            QueueConsumer consumer = new QueueConsumer(combinedClassLoader);
            consumer.setQueue(queue);
            consumer.setNode(getNode());
            consumer.setDispatcher(dispatcher);
            consumer.setConfigurationAdmin(configurationAdmin);
View Full Code Here

Examples of com.hazelcast.core.IQueue

                producer.setTopic(topic);
                producer.setNode(getNode());
                producer.init();
                return producer;
        } else {
                IQueue queue = instance.getQueue(Constants.QUEUE + Constants.SEPARATOR + name);
                QueueProducer producer = new QueueProducer();
                producer.setQueue(queue);
                producer.setNode(getNode());
                producer.init();
                return producer;
View Full Code Here

Examples of com.hazelcast.core.IQueue

                consumer.setDispatcher(dispatcher);
                consumer.init();
                return consumer;
        } else {

                IQueue queue = instance.getQueue(Constants.QUEUE + Constants.SEPARATOR + name);
                QueueConsumer consumer = new QueueConsumer(combinedClassLoader);
                consumer.setQueue(queue);
                consumer.setNode(getNode());
                consumer.setDispatcher(dispatcher);
                consumer.init();
View Full Code Here

Examples of com.hazelcast.core.IQueue

                producer.setTopic(topic);
                producer.setNode(getNode());
                producer.init();
                return producer;
        } else {
                IQueue queue = instance.getQueue(Constants.QUEUE + Constants.SEPARATOR + name);
                QueueProducer producer = new QueueProducer();
                producer.setQueue(queue);
                producer.setNode(getNode());
                producer.init();
                return producer;
View Full Code Here

Examples of com.hazelcast.core.IQueue

                consumer.setNode(getNode());
                consumer.setDispatcher(dispatcher);
                consumer.init();
                return consumer;
        } else {
                IQueue queue = instance.getQueue(Constants.QUEUE + Constants.SEPARATOR + name);
                QueueConsumer consumer = new QueueConsumer(combinedClassLoader);
                consumer.setQueue(queue);
                consumer.setNode(getNode());
                consumer.setDispatcher(dispatcher);
                consumer.init();
View Full Code Here

Examples of com.hazelcast.core.IQueue

    public void testQueueSizeEmpty() throws IOException {
        final HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);
        final HTTPCommunicator communicator = new HTTPCommunicator(instance);
        final String name = "testQueueSizeEmpty";

        IQueue queue = instance.getQueue(name);
        Assert.assertEquals(queue.size(), communicator.size(name));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.