@NotNull public static Environment newInstance(@NotNull final File dir, @NotNull final EnvironmentConfig ec) { return prepare(new EnvironmentImpl(newLogInstance(dir, ec), ec)); }
@NotNull public static Environment newInstance(@NotNull final String dir, @NotNull final EnvironmentConfig ec) { return prepare(new EnvironmentImpl(newLogInstance(new File(dir), ec), ec)); }
@NotNull public static Environment newInstance(@NotNull final String dir, @NotNull final String subDir, @NotNull final EnvironmentConfig ec) { return prepare(new EnvironmentImpl(newLogInstance(new File(dir, subDir), ec), ec)); }
@NotNull public static ContextualEnvironment newContextualInstance(@NotNull final String dir, @NotNull final String subDir, @NotNull final EnvironmentConfig ec) { return prepare(new ContextualEnvironmentImpl(newLogInstance(new File(dir, subDir), ec), ec)); }
@NotNull public static ContextualEnvironment newContextualInstance(@NotNull final String dir, @NotNull final EnvironmentConfig ec) { return prepare(new ContextualEnvironmentImpl(newLogInstance(new File(dir), ec), ec)); }
@NotNull public static ContextualEnvironment newContextualInstance(@NotNull final File dir, @NotNull final EnvironmentConfig ec) { return prepare(new ContextualEnvironmentImpl(newLogInstance(dir, ec), ec)); }
@NotNull public static Log newLogInstance(@NotNull final File dir, @NotNull final EnvironmentConfig ec) { return newLogInstance(new LogConfig().setLocation(dir.getPath()), ec); }
@NotNull public static Environment newInstance(@NotNull final LogConfig config, @NotNull final EnvironmentConfig ec) { return prepare(new EnvironmentImpl(newLogInstance(config, ec), ec)); }
@NotNull public static ContextualEnvironment newContextualInstance(@NotNull final LogConfig config, @NotNull final EnvironmentConfig ec) { return prepare(new ContextualEnvironmentImpl(newLogInstance(config, ec), ec)); }
@NotNull public static Log newLogInstance(@NotNull final LogConfig config, @NotNull final EnvironmentConfig ec) { final Long maxMemory = ec.getMemoryUsage(); if (maxMemory != null) { config.setMemoryUsage(maxMemory); } else { config.setMemoryUsagePercentage(ec.getMemoryUsagePercentage()); } config.setReaderWriterProvider(ec.getLogDataReaderWriterProvider()); if (config.getReaderWriterProvider().isReadonly()) { ec.setEnvIsReadonly(true); config.setLockIgnored(true); } return newLogInstance(config. setFileSize(ec.getLogFileSize()). setLockTimeout(ec.getLogLockTimeout()). setCachePageSize(ec.getLogCachePageSize()). setCacheOpenFilesCount(ec.getLogCacheOpenFilesCount()). setDurableWrite(ec.getLogDurableWrite()). setSharedCache(ec.isLogCacheShared()). setNonBlockingCache(ec.isLogCacheNonBlocking()). setCacheGenerationCount(ec.getLogCacheGenerationCount()). setCleanDirectoryExpected(ec.isLogCleanDirectoryExpected()). setClearInvalidLog(ec.isLogClearInvalid()). setSyncPeriod(ec.getLogSyncPeriod()). setFullFileReadonly(ec.isLogFullFileReadonly()). setCipherProvider(ec.getCipherId() == null ? null : KryptKt.newCipherProvider(ec.getCipherId())). setCipherKey(ec.getCipherKey()). setCipherBasicIV(ec.getCipherBasicIV())); }