Package com.cloudhopper.datastore

Examples of com.cloudhopper.datastore.DataStoreIterator.jump()


    public void dump(Queue queue) throws Exception {
  // queue
  if (queue.getSize() > 0 && dataStore.hasAscendingIteratorSupport()) {
      printHeader(queue);
      DataStoreIterator iterator = dataStore.getAscendingIterator();
      boolean jumped = iterator.jump(priorityKeyUtil.encode(queue.getId(), 0L));
      if (!jumped) return;
      while (true) {
    try {
        DataStoreIterator.Record record = iterator.getRecord();
        byte[] keyBytes = record.getKey();
View Full Code Here


     * Load a page from the ds. Call this only when the lock is acquired.
     */
    private int loadPage() throws DataStoreFatalException {
  int loaded = 0;
        DataStoreIterator iterator = ds.getAscendingIterator();
  iterator.jump(priorityKeyUtil.encode(getId(), 0L));
  try {
      do {
    // get the next record
    DataStoreIterator.Record record = iterator.getRecord();
    byte[] k = record.getKey();
View Full Code Here

    }

    @Override
    protected PriorityMQMessage<E> doTake() throws QueueInvalidStateException, QueueFatalException, QueueTimeoutException, DataStoreFatalException  {
        DataStoreIterator iterator = ds.getAscendingIterator();
  boolean jumped = iterator.jump(priorityKeyUtil.encode(getId(), 0L));
  if (!jumped) logger.warn("DataStoreIterator failed to jump to queue's first record {} {}", getId(), 0L);
  // if (!jumped) something is wrong, we should zero the size and exit
  try {
      DataStoreIterator.Record record = iterator.getRecord();
      CompositeKey key = priorityKeyUtil.decode(record.getKey());
View Full Code Here

    public void dump(Queue queue) throws Exception {
  // queue
  if (queue.getSize() > 0 && dataStore.hasAscendingIteratorSupport()) {
      printHeader(queue);
      DataStoreIterator iterator = dataStore.getAscendingIterator();
      boolean jumped = iterator.jump(priorityKeyUtil.encode(queue.getId(), 0L));
      if (!jumped) return;
      while (true) {
    try {
        DataStoreIterator.Record record = iterator.getRecord();
        byte[] keyBytes = record.getKey();
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.