Examples of EnumFileState


Examples of net.sf.joafip.kvstore.entity.EnumFileState

    if (crashSafeMode && heapElementManager.wasBadFileStableState()) {
      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.entity.EnumFileState

   *            exception
   * @return file state for exception
   */
  static public EnumFileState fileState(final Exception exception) {
    Throwable throwable = exception;
    EnumFileState fileState = null;
    boolean fileIoError = false;
    while (throwable != null) {
      if (throwable.getClass() == HeapException.class) {
        fileState = ((HeapException) throwable).getFileState();
      }
View Full Code Here

Examples of net.sf.joafip.kvstore.entity.EnumFileState

      dataManager.startService(true);
    } catch (HeapException exception) {
      if (dataManager == null) {
        logger.debug("file state unknow");
      } else {
        final EnumFileState fileState = HeapFileStateHelper
            .fileState(exception);
        switch (fileState) {
        case STATE_OK:
          logger.debug("file state ok");
          break;
View Full Code Here

Examples of net.sf.joafip.kvstore.entity.EnumFileState

      builder.setProxyMode(true);
      builder.setCrashSafeMode(CRASH_SAFE_MODE);
      builder.setGarbageManagement(GARBAGE);
      filePersistence = builder.build();
    } catch (final FilePersistenceException exception) {
      final EnumFileState fileState = FilePersistence
          .fileState(exception);
      switch (fileState) {
      case STATE_OK:
        /* exception is not relative to file state */
        throw exception;
View Full Code Here

Examples of net.sf.joafip.kvstore.entity.EnumFileState

  private void start() {
    try {
      setupAndCreate();
      simulateCrashDataLost();

      EnumFileState enumFileState;
      try {
        // new FilePersistence(1, null, TestConstant.getRuntimeDir(),
        // false,
        // false);
        final FilePersistenceBuilder builder = new FilePersistenceBuilder();
View Full Code Here

Examples of net.sf.joafip.kvstore.entity.EnumFileState

    file = new File(dataFlagFile);
    assertTrue(dataFlagFile + " must exists", file.exists());
    assertTrue(dataFlagFile + " must be a file", file.isFile());
    assertTrue("failed delete " + dataFlagFile, file.delete());

    EnumFileState enumFileState;
    try {
      // filePersistence = new FilePersistence(1, null,
      // TestConstant.getRuntimeDir(), false, false);
      final FilePersistenceBuilder builder = new FilePersistenceBuilder();
      builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
View Full Code Here

Examples of net.sf.joafip.kvstore.entity.EnumFileState

    new File(RUNTIME_DIR).mkdirs();
    IFilePersistence filePersistence;
    try {
      filePersistence = newFilePersistence(removeFiles);
    } catch (FilePersistenceException exception) {
      final EnumFileState fileState = FilePersistence
          .fileState(exception);
      switch (fileState) {
      case STATE_OK:
        /* exception is not relative to file state */
        throw exception;
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.