.isClearResizeFile();
final int maxFileOperationRetry = storeProperties
.getMaxFileOperationRetry();
final int fileOperationRetryMsDelay = storeProperties
.getFileOperationRetryMsDelay();
final HeapFileSetup setup = new HeapFileSetup(fileAccessMode,
dataFile, crashSafeMode, useCacheMode, deleteRenaming,
clearResizeFile, maxFileOperationRetry,
fileOperationRetryMsDelay, openFileTraceFile);
if (crashSafeMode) {
final String backupDataFileName = storeProperties
.getBackupDataFileName();
final String toUseBackupDataFileName = backupDataFileName == null ? STORE_BAK
: backupDataFileName;
final File backupDataFile = new File(pathName,
toUseBackupDataFileName);
final String stateOkFlagFileName = storeProperties
.getStateOkFlagFileName();
final String toUseStateOkFlagFileName = stateOkFlagFileName == null ? DATA_FLAG
: stateOkFlagFileName;
final File stateOkFlagFile = new File(pathName,
toUseStateOkFlagFileName);
final String stateBackupOkFlagFileName = storeProperties
.getStateBackupOkFlagFileName();
final String toUseStateBackupOkFlagFileName = stateBackupOkFlagFileName == null ? BACKUP_FLAG
: stateBackupOkFlagFileName;
final File stateBackupOkFlagFile = new File(pathName,
toUseStateBackupOkFlagFileName);
final String globalStateFlagFileName = storeProperties
.getGlobalStateFlagFileName();
final String toUseGlobalStateFlagFileName = globalStateFlagFileName == null ? GLOBAL_FLAG
: globalStateFlagFileName;
final File globalStateFlagFile = new File(pathName,
toUseGlobalStateFlagFileName);
setup.crashSafeSetup(
/**/backupDataFile,
/**/stateOkFlagFile,
/**/stateBackupOkFlagFile,
/**/globalStateFlagFile);
}
if (useCacheMode) {
final int pageSize = storeProperties.getPageSize();
final int maxPage = storeProperties.getMaxPage();
setup.cacheSetup(pageSize, maxPage);
}
if (EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS
.equals(fileAccessMode)) {
final int maxNumberOfBuffer = storeProperties
.getMaxNumberOfBuffer();
final int maxBufferSize = storeProperties
.getMaxBufferSize();
setup.fileBufferSetup(maxBufferSize, maxNumberOfBuffer);
}
this.dataManager = new HeapFileDataManager(setup, false);
} catch (HeapException exception) {
logger.fatal(CREATION_FAILED, exception);
throw new StoreException(CREATION_FAILED, exception);