Examples of HeapException


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

   *             service is started
   */
  private boolean assertServiceIsStopped() throws HeapException {
    if (serviceStarted) {
      LOGGER.fatal(RECORD_MANAGER_IS_STARTED);
      throw new HeapException(RECORD_MANAGER_IS_STARTED, starterTrace);
    }
    return true;
  }
View Full Code Here

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

        header.readFromFile();
      }
      openedTransaction = true;
    } catch (HeapException exception) {
      LOGGER.fatal(READ_FILE_HEADER_FAILED, exception);
      throw new HeapException(READ_FILE_HEADER_FAILED, exception);
    }
  }
View Full Code Here

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

  }

  private void assertTransactionClosed() throws HeapException {
    if (openedTransaction) {
      LOGGER.fatal(RECORD_MANAGER_TRANSACTION_ALREADY_OPENED);
      throw new HeapException(RECORD_MANAGER_TRANSACTION_ALREADY_OPENED);
    }
  }
View Full Code Here

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

    final Set<ToBackupRecord> toBackupList;
    try {
      toBackupList = startSave();
    } catch (FileIOException exception) {
      throw new HeapException(exception);
    }

    saveHeader(toBackupList);
    save(toBackupList);
    if (!fileOpenedInTransaction) {
View Full Code Here

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

  private boolean assertTransactionOpened() throws HeapException {
    assertServiceStarted();
    if (!openedTransaction) {
      LOGGER.fatal(RECORD_MANAGER_TRANSACTION_IS_CLOSED);
      throw new HeapException(RECORD_MANAGER_TRANSACTION_IS_CLOSED);
    }
    return true;
  }
View Full Code Here

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

        } catch (AssertionError error) {
          // ASSERTX
          final long recordPositionInFile = heapRecord
              .getPositionInFile();
          if (recordPositionInFile != entry.getKey()) {
            throw new HeapException(// NOPMD
                "integrity error record position is "
                    + recordPositionInFile
                    + " and map key is " + entry.getKey());
          }
          if (recordPositionInFile <= lastWrotePositionInFile) {
            throw new HeapException("last wrote position is "// NOPMD
                + lastWrotePositionInFile
                + " and record position in file is "
                + recordPositionInFile
                + " for \n"
                + heapRecord.toString());
          }
          final long previousRecordPositionInFile = heapRecord
              .getPreviousRecordPositionInFile();
          if (previousRecordPositionInFile == -1) {
            if (recordPositionInFile != header.getRecordSize()) {
              throw new HeapException(
                  "bad position of first record "// NOPMD
                      + recordPositionInFile
                      + " for "
                      + header.getRecordSize()
                      + " expected");
View Full Code Here

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

          fileForStorableBackup.write(toBackupRecord);
        }
        fileForStorableBackup.flush();
        setEndSaveFlagFile();
      } catch (FileIOException exception) {
        throw new HeapException(exception);
      }
    }
  }
View Full Code Here

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

          toBackupList.add(new ToBackupRecord(header
              .getPositionInFile(), data));
        }
      } catch (HeapException exception) {
        LOGGER.fatal(WRITE_FILE_HEADER_FAILED, exception);
        throw new HeapException(WRITE_FILE_HEADER_FAILED, exception);

      }
    }
  }
View Full Code Here

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

    final IFileStorable heapRecord = heapRecordToWriteMap
        .get(lastRecordPositionInFile);

    final long nEndOfFilePosition = lastRecordPositionInFile
        + heapRecord.getRecordSize();
    throw new HeapException("for record at " + recordPositionInFile
        + ", bad previous position in file "
        + previousRecordPositionInFile + ", last record position is "
        + lastRecordPositionInFile + ",next of previous position "
        + nextOfPrevious + ",next of last " + nEndOfFilePosition
        + Thread.currentThread().getName() + "\nrecord:\n"
View Full Code Here

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

      heapRecord.readFromFile();
    } catch (HeapException exception) {
      final String message = READ_HEAP_FILE_NODE_FAILED
          + "read record failed, position in file #" + positionInFile;
      LOGGER.fatal(message, exception);
      throw new HeapException(message, exception);
    }
    return heapRecord;
  }
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.