Examples of HeapException


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

        byteValue >>= 1;
      }
    }
    final int readCrc32 = readInteger();
    if (crc32 != readCrc32) {
      throw new HeapException(RECORD_INTEGRITY_ERROR
          + " record position=" + positionInFile + " read="
          + readCrc32 + " computed=" + crc32 + " nb rd/wr="
          + numberOfByteReadWrote, EnumFileState.STATE_CORRUPTED);
    }
  }
View Full Code Here

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

      final boolean clearResizeFile, final int maxFileOperationRetry,
      final int fileOperationRetryMsDelay, final File openFileTraceFile)
      throws HeapException {
    super();
    if (dataFile == null) {
      throw new HeapException("file must be defined");
    }
    this.fileAccessMode = fileAccessMode;
    this.dataFile = dataFile;
    this.crashSafeMode = crashSafeMode;
    this.useCacheMode = useCacheMode;
View Full Code Here

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

   */
  public void cacheSetup(final int pageSize, final int maxPage)
      throws HeapException {
    if (useCacheMode) {
      if (pageSize < 1024) {
        throw new HeapException(
            "page size must be greater or equal 1024 bytes");
      }
      if (maxPage <= 0) {
        throw new HeapException(
            "max number of page must be greater than 0");
      }
      this.pageSize = pageSize;
      this.maxPage = maxPage;
    } else {
      throw new HeapException(
          "can not setup cache if use cache mode not enabled");
    }
  }
View Full Code Here

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

      final File globalStateFlagFile) throws HeapException {
    if (crashSafeMode) {
      if (backupDataFile == null || stateOkFlagFile == null
          || stateBackupOkFlagFile == null
          || globalStateFlagFile == null) {
        throw new HeapException("files must be defined");
      }
      this.backupDataFile = backupDataFile;
      this.stateOkFlagFile = stateOkFlagFile;
      this.stateBackupOkFlagFile = stateBackupOkFlagFile;
      this.globalStateFlagFile = globalStateFlagFile;
    } else {
      throw new HeapException(
          "can not setup crash safe if crash safe mode not enabled");
    }
  }
View Full Code Here

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

      final int maxNumberOfBuffer) throws HeapException {
    if (EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS.equals(fileAccessMode)) {
      this.maxBufferSize = maxBufferSize;
      this.maxNumberOfBuffer = maxNumberOfBuffer;
    } else {
      throw new HeapException(
          "can not setup file buffer if mapped file access not enabled");
    }
  }
View Full Code Here

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

  }

  public File getBackupDataFile() throws HeapException {
    if (crashSafeMode) {
      if (backupDataFile == null) {
        throw new HeapException(
            "crash safe mode set but backup file not defined");
      }
    } else {
      throw new HeapException(
          "do not use backup file is crash safe mode not set");
    }
    return backupDataFile;
  }
View Full Code Here

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

  }

  public File getGlobalStateFlagFile() throws HeapException {
    if (crashSafeMode) {
      if (backupDataFile == null) {
        throw new HeapException(
            "crash safe mode set but global state file not defined");
      }
    } else {
      throw new HeapException(
          "do not use global state file is crash safe mode not set");
    }
    return globalStateFlagFile;
  }
View Full Code Here

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

  }

  public int getMaxPage() throws HeapException {
    if (useCacheMode) {
      if (maxPage == -1) {
        throw new HeapException("maxPage not set");
      }
    } else {
      throw new HeapException("no cache used");
    }
    return maxPage;
  }
View Full Code Here

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

  }

  public int getPageSize() throws HeapException {
    if (useCacheMode) {
      if (pageSize == -1) {
        throw new HeapException("pageSize not set");
      }
    } else {
      throw new HeapException("no cache used");
    }
    return pageSize;
  }
View Full Code Here

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

  }

  public File getStateBackupOkFlagFile() throws HeapException {
    if (crashSafeMode) {
      if (backupDataFile == null) {
        throw new HeapException(
            "crash safe mode set but backup state file not defined");
      }
    } else {
      throw new HeapException(
          "do not use backup state file is crash safe mode not set");
    }
    return stateBackupOkFlagFile;
  }
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.