Package net.greghaines.jesque.meta

Examples of net.greghaines.jesque.meta.QueueInfo


            exactly(2).of(jedis).type(queueKey); will(returnValue(KeyType.ZSET.toString()));
            oneOf(jedis).zcard(queueKey); will(returnValue(size));
            oneOf(jedis).zrange(queueKey, jobOffset, jobOffset + jobCount - 1); will(returnValue(payloads));
            oneOf(pool).returnResource(jedis);
        }});
        final QueueInfo queueInfo = this.qInfoDAO.getQueueInfo(name, jobOffset, jobCount);
        Assert.assertNotNull(queueInfo);
        Assert.assertEquals(name, queueInfo.getName());
        Assert.assertEquals((Long) size, queueInfo.getSize());
        final List<Job> jobs = queueInfo.getJobs();
        Assert.assertNotNull(jobs);
        Assert.assertEquals(payloads.size(), jobs.size());
    }
View Full Code Here


            exactly(2).of(jedis).type(queueKey); will(returnValue(KeyType.LIST.toString()));
            oneOf(jedis).llen(queueKey); will(returnValue(size));
            oneOf(jedis).lrange(queueKey, jobOffset, jobOffset + jobCount - 1); will(returnValue(payloads));
            oneOf(pool).returnResource(jedis);
        }});
        final QueueInfo queueInfo = this.qInfoDAO.getQueueInfo(name, jobOffset, jobCount);
        Assert.assertNotNull(queueInfo);
        Assert.assertEquals(name, queueInfo.getName());
        Assert.assertEquals((Long) size, queueInfo.getSize());
        final List<Job> jobs = queueInfo.getJobs();
        Assert.assertNotNull(jobs);
        Assert.assertEquals(payloads.size(), jobs.size());
    }
View Full Code Here

             */
            @Override
            public List<QueueInfo> doWork(final Jedis jedis) throws Exception {
                final List<QueueInfo> queueInfos = new ArrayList<QueueInfo>(queueNames.size());
                for (final String queueName : queueNames) {
                    final QueueInfo queueInfo = new QueueInfo();
                    queueInfo.setName(queueName);
                    queueInfo.setSize(size(jedis, queueName));
                    queueInfos.add(queueInfo);
                }
                Collections.sort(queueInfos);
                return queueInfos;
            }
View Full Code Here

            /**
             * {@inheritDoc}
             */
            @Override
            public QueueInfo doWork(final Jedis jedis) throws Exception {
                final QueueInfo queueInfo = new QueueInfo();
                queueInfo.setName(name);
                queueInfo.setSize(size(jedis, name));
                final Collection<String> payloads = paylods(jedis, name, jobOffset, jobCount);
                final List<Job> jobs = new ArrayList<Job>(payloads.size());
                for (final String payload : payloads) {
                    jobs.add(ObjectMapperFactory.get().readValue(payload, Job.class));
                }
                queueInfo.setJobs(jobs);
                return queueInfo;
            }
        });
    }
View Full Code Here

TOP

Related Classes of net.greghaines.jesque.meta.QueueInfo

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.