Class EngineConfig

java.lang.Object
dev.frostlake.config.EngineConfig

public class EngineConfig extends Object
Configuration manager for Frostlake SQL Engine Loads configuration from frostlake.properties file
  • Field Details

  • Constructor Details

    • EngineConfig

      public EngineConfig()
    • EngineConfig

      public EngineConfig(String configFilePath)
    • EngineConfig

      public EngineConfig(Properties overrides)
      Configuration with explicit programmatic overrides: the built-in defaults and any discovered frostlake.properties (classpath / working directory / ~/.frostlake) load first, then overrides apply last and win. Used by the jdbc:frostlake:file: URL to pin persistence to the URL's directory regardless of ambient configuration, while ambient conveniences (e.g. python.venv, stage mappings) still apply.
  • Method Details

    • getHttpPort

      public int getHttpPort()
    • getHttpHost

      public String getHttpHost()
    • getMaxConnections

      public int getMaxConnections()
    • getDefaultDatabase

      public String getDefaultDatabase()
    • getDefaultSchema

      public String getDefaultSchema()
    • getAccountId

      public String getAccountId()
      The account LOCATOR, which CURRENT_ACCOUNT() answers with.
    • getAccountName

      public String getAccountName()
      The account NAME, which CURRENT_ACCOUNT_NAME() answers with — a different identifier from the locator: measured on a real account, CURRENT_ACCOUNT() is PG65914 while CURRENT_ACCOUNT_NAME() is WJ64893, and SHOW ACCOUNTS reports them in separate columns.
    • getOrganizationName

      public String getOrganizationName()
      The organization the account belongs to, which CURRENT_ORGANIZATION_NAME() answers with.
    • isEnforcePrimaryKey

      public boolean isEnforcePrimaryKey()
    • isEnforceUniqueKey

      public boolean isEnforceUniqueKey()
    • isEnforceTypes

      public boolean isEnforceTypes()
      When true (the default), DML coerces write values to the column type (VARCHAR(n) length enforcement, numeric-string parsing, rejecting clearly-incompatible values), matching Snowflake. Set false to opt out (lax typing). See docs/acid-snowflake-plan.md.
    • isTimeTravelEnabled

      public boolean isTimeTravelEnabled()
    • isWindowFrameVectorsEnabled

      public boolean isWindowFrameVectorsEnabled()
      When true (the default), window functions evaluate their argument once per partition row into a per-batch vector and every output row's frame reads that vector — instead of re-evaluating the argument for each frame row, which makes a running frame quadratic in expression walks. Only volatile-free argument shapes are vectorized (anything else keeps the row path); set false to force the per-frame-row path everywhere.
    • isDeferredApply

      public boolean isDeferredApply()
      When true (the default), DML buffers into a per-transaction write set and applies it on COMMIT (deferred apply), giving real atomicity + READ COMMITTED across INSERT/UPDATE/DELETE/MERGE. Set to false to use the legacy immediate-apply + undo-log path. See docs/acid-snowflake-plan.md.
    • isStageFileUrlEnabled

      public boolean isStageFileUrlEnabled()
      When true, CREATE STAGE accepts file:// (and bare local-path) URLs backed by the local filesystem — the local-development affordance. Off by default: a real account refuses those URLs, and the default surface matches it.
    • isRemoveCommandEnabled

      public boolean isRemoveCommandEnabled()
      When true, the destructive REMOVE/RM @stage command (which deletes the files backing a stage on the local filesystem) is allowed. Off by default as a safety guard against accidental data loss; enable via command.removeEnabled=true.
    • getRegion

      public String getRegion()
    • getDefaultUser

      public String getDefaultUser()
    • isInMemoryStorage

      public boolean isInMemoryStorage()
    • getLoggingLevel

      public String getLoggingLevel()
    • isPersistenceEnabled

      public boolean isPersistenceEnabled()
    • isTaskSchedulerAutoStart

      public boolean isTaskSchedulerAutoStart()
      Whether the engine arms the task scheduler as it finishes starting, so tasks left in the STARTED state — typically by a restore, since that writes the state without arming anything — begin firing on their schedule again.

      Default FALSE, because starting it is not free and not always wanted: it spawns timer threads, and task bodies start executing against restored data as soon as the engine is up, before anyone has looked at the instance. An embedded engine inside someone else's process should generally leave this alone and call startTaskScheduler() when it is ready; a long-running server that is expected to pick up where it left off across restarts is what the flag is for.

      Turning it off does not stop tasks from running — ALTER TASK … RESUME still starts the scheduler by itself. It only decides whether ALREADY-resumed tasks are armed at boot.

    • getPersistenceDirectory

      public String getPersistenceDirectory()
    • isWalEnabled

      public boolean isWalEnabled()
      When true, committed mutating statements are appended to a write-ahead log (fsync on commit) and replayed on startup, so committed work survives a crash. Off by default — durability matters least for the in-memory local/CI-testing use case. See docs/acid-snowflake-plan.md.
    • getWalFile

      public String getWalFile()
    • getWalCheckpointInterval

      public int getWalCheckpointInterval()
      When > 0 and the WAL is enabled, the engine writes a checkpoint (a full state snapshot plus log truncation) after this many committed transactions, bounding the log's growth and speeding recovery. 0 (the default) disables automatic checkpointing — DatabaseEngine.checkpoint() can still be called explicitly. See docs/acid-snowflake-plan.md.
    • isAutoSaveEnabled

      public boolean isAutoSaveEnabled()
    • getSaveIntervalSeconds

      public int getSaveIntervalSeconds()
    • getQueryHistorySize

      public int getQueryHistorySize()
    • getQueryResultCacheSize

      public int getQueryResultCacheSize()
    • getStageS3LocalRoot

      public String getStageS3LocalRoot()
      Local filesystem base for resolving s3://bucket/key references (an unmapped key resolves to <root>/bucket/key). Lets JARs that live in S3-backed stages in production be loaded from local disk for local/CI testing. Defaults to ~/.frostlake_stages/s3. See S3PathResolver.
    • getStageInternalLocalRoot

      public String getStageInternalLocalRoot()
      Local filesystem root backing the implicit internal stages — the user stage (@~) and per-table stages (@%table), which have no CREATE STAGE / URL. User stages resolve to <root>/users/<user>, table stages to <root>/tables/<db.schema.table>. Defaults to ~/.frostlake_stages/internal.
    • getStageS3LocalMappings

      public String getStageS3LocalMappings()
      Explicit s3://-prefix → local-directory overrides for S3 resolution: ';'-separated s3prefix=localdir pairs (longest matching prefix wins). Empty by default. See S3PathResolver.
    • getPythonVenv

      public String getPythonVenv()
      A GraalPy virtual environment whose installed packages (numpy, pandas, ...) become importable from Python UDF/procedure handlers — the local stand-in for Snowflake's PACKAGES=(...) clause. Points at the venv directory produced by the graalpy-maven-plugin (<externalDirectory>/venv); empty (the default) leaves the embedded interpreter on its standard library only.
    • getProperty

      public String getProperty(String key, String defaultValue)
    • getIntProperty

      public int getIntProperty(String key, int defaultValue)
    • getBooleanProperty

      public boolean getBooleanProperty(String key, boolean defaultValue)
    • setProperty

      public void setProperty(String key, String value)
    • getProperties

      public Properties getProperties()