Skip to main content
Syntasa Notebook Utilities

Eventstores Utilities

synutils is the unified entry point in every notebook — a Python attribute and a Scala REPL alias. Each section below lists user-callable methods with examples in both languages.

eventstores — event store path / database resolver​

An event store is the primary data storage unit on the platform — it pairs a cloud storage path with a metastore database, with separate values per environment (development / production / snapshot).

MethodPurpose
get(value, lookupType="name", env="development")Full event store object with resolved path / database for the requested env
getPath(name, lookupType="name", env="development")Storage path only
getDatabase(name, lookupType="name", env="development")Hive database name only
configure(defaultName=…, defaultEnv=…)Set a default event store + environment so the path / database / name properties resolve without arguments
path,database,nameProperties that return the path / database / name of the default event store (requires configure(...))
clearCache()Drop the response cache

lookupType selects how value is interpreted:

  • "name" — value is the event store's logical name; env decides which environment's path/database to return.
  • "database" — value is a database name; the environment is auto-detected by matching against developmentDatabase / productionDatabase in the response (the env argument is ignored).

Examples​

Python​

# 1. Lookup by name + environment 
es = synutils.eventstores.get("click_stream", env="production")
print(es["path"], es["database"], es["_resolved_env"])
# gs://.../click_stream click_stream_prod production
# 2. Lookup by database — env auto-detected from the database value
es = synutils.eventstores.get("click_stream_dev", lookupType="database")
print(es["_resolved_env"]) # development
# 3. Just need the path or database
synutils.eventstores.getPath("click_stream", env="development")
synutils.eventstores.getDatabase("click_stream", env="production")
# 4. Configure defaults — then use path / database / name as bare properties
synutils.eventstores.configure(defaultName="click_stream", defaultEnv="development")
print(synutils.eventstores.path)
print(synutils.eventstores.database)
print(synutils.eventstores.name)
# 5. Switch the default environment without changing the name
synutils.eventstores.configure(defaultEnv="production")
print(synutils.eventstores.path)
# 6. Drop cached responses (force a re-fetch on next call)
synutils.eventstores.clearCache()

Scala​

// 1. Lookup by name + environment 
val es = synutils.eventstores.get("click_stream", env = "production")
println(s"${es("path")} ${es("database")} ${es("_resolved_env")}")

// 2. Lookup by database — env auto-detected
val byDb = synutils.eventstores.get("click_stream_dev", lookupType = "database")
println(byDb("_resolved_env")) // development

// 3. Just need the path or database
synutils.eventstores.getPath("click_stream", env = "development")
synutils.eventstores.getDatabase("click_stream", env = "production")

// 4. Configure defaults
synutils.eventstores.configure(defaultName = "click_stream", defaultEnv = "development")
println(synutils.eventstores.path)
println(synutils.eventstores.database)
println(synutils.eventstores.name)

// 5. Switch default environment
synutils.eventstores.configure(defaultEnv = "production")
println(synutils.eventstores.path)

// 6. Drop cached responses
synutils.eventstores.clearCache()