Examples of HeapException


Examples of net.sf.joafip.kvstore.service.HeapException

    heapRecord = heapRecordToWriteMap.get(positionInFile);
    if (heapRecord == NULL_FILE_STORABLE) {
      final String message = READ_HEAP_FILE_NODE_FAILED
          + "read record at poistion " + positionInFile + " failed";
      LOGGER.fatal(message);
      throw new HeapException(message);
    }
    if (heapRecord == null) {
      heapRecord = readHeapRecordMap.get(positionInFile);
    }
    if (heapRecord == null) {
      heapRecord = heapRecordFactory.createHeapRecord(this,
          positionInFile);
      try {
        heapRecord.readFromFile();
      } catch (HeapException exception) {
        final String message = READ_HEAP_FILE_NODE_FAILED
            + "read record at poistion " + positionInFile
            + " failed";
        LOGGER.fatal(message, exception);
        throw new HeapException(message, exception);
      }

      readHeapRecordMap.put(positionInFile, heapRecord);
    }
    return heapRecord;
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

    if (positionInFile < header.getRecordSize()) {
      final String message = READ_HEAP_FILE_NODE_FAILED
          + "position in heap file " + positionInFile
          + " in header of size=" + header.getRecordSize();
      LOGGER.fatal(message);
      throw new HeapException(message);
    }
    return true;
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

    return true;
  }

  private void mustNotHavePreviousException(final IFileStorable previous,
      final IFileStorable current) throws HeapException {
    throw new HeapException(
        "must not have a previous heap record: current=\n"
            + current.toString() + "\nprevious=\n"
            + previous.toString());
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

    final Object[] args = new Object[] { identifier };
    final String backupFileName = String.format(format, args);
    try {
      fileForStorable.copy(backupFileName);
    } catch (FileIOException exception) {
      throw new HeapException(exception);
    }
    /*
     * create file name for change
     */
    // format = file.getAbsolutePath() + ".change.%020d";
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

      final Iterator<File> iterator = set.iterator();
      for (int count = files.length; iterator.hasNext()
          && count >= maxBackup; count--) {
        final File toDelete = iterator.next();
        if (!toDelete.delete()) {
          throw new HeapException("failed delete " + toDelete);
        }
      }
    }
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

          byteArrayInputStream);
      final Object result = objectInputStream.readObject();
      objectInputStream.close();
      return (Comparable<?>) result;
    } catch (Exception exception) {
      throw new HeapException("unmarshalling key", exception);
    }
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

      final byte[] keyData = byteArrayOutputStream.toByteArray();
      final DataRecordKey dataRecordKey = new DataRecordKey(this, keyData);
      dataRecordKey.setKey(key);
      return new DataRecordIdentifier(dataRecordKey);
    } catch (Exception exception) {
      throw new HeapException("creating key", exception);
    }
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

      LOGGER.warn(RESTART_FROM_STABLE_BACKUP);
      /* validate the stable state */
      final boolean dataLost = heapElementManager.isDataLost();
      final EnumFileState fileState = dataLost ? EnumFileState.STATE_RESTORED_DATA_LOST
          : EnumFileState.STATE_RESTORED_NO_DATA_LOST;
      throw new HeapException(RESTART_FROM_STABLE_BACKUP
          + fileState.toString(), fileState);
    }
    return heapElementManager;
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

      return equals;
    }

    @Override
    public long getPreviousRecordPositionInFile() throws HeapException {
      throw new HeapException("unsupported");
    }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

      throw new HeapException("unsupported");
    }

    @Override
    public int getRecordSize() throws HeapException {
      throw new HeapException("unsupported");
    }
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.