[{"data":1,"prerenderedAt":4436},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fbuilding\u002Fstate-stores":314,"\u002Fdocs\u002Fbuilding\u002Fstate-stores-surround":4431},[4,38,86,149,176,219,257,273],{"title":5,"path":6,"stem":7,"children":8,"icon":37},"Getting Started","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started\u002F1.index",[9,12,17,22,27,32],{"title":10,"path":6,"stem":7,"icon":11},"Getting started","i-lucide-flag",{"title":13,"path":14,"stem":15,"icon":16},"Modules overview","\u002Fdocs\u002Fgetting-started\u002Fmodules-overview","1.docs\u002F1.getting-started\u002F2.modules-overview","i-lucide-boxes",{"title":18,"path":19,"stem":20,"icon":21},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","1.docs\u002F1.getting-started\u002F3.installation","i-lucide-download",{"title":23,"path":24,"stem":25,"icon":26},"License configuration","\u002Fdocs\u002Fgetting-started\u002Flicense-configuration","1.docs\u002F1.getting-started\u002F4.license-configuration","i-lucide-key-round",{"title":28,"path":29,"stem":30,"icon":31},"Your first app","\u002Fdocs\u002Fgetting-started\u002Ffirst-app","1.docs\u002F1.getting-started\u002F5.first-app","i-lucide-square-play",{"title":33,"path":34,"stem":35,"icon":36},"Project setup","\u002Fdocs\u002Fgetting-started\u002Fproject-setup","1.docs\u002F1.getting-started\u002F6.project-setup","i-lucide-package",false,{"title":39,"path":40,"stem":41,"children":42,"icon":45},"Core Concepts","\u002Fdocs\u002Fconcepts","1.docs\u002F2.concepts\u002F1.index",[43,46,51,56,61,66,71,76,81],{"title":44,"path":40,"stem":41,"icon":45},"Core concepts","i-lucide-book-open",{"title":47,"path":48,"stem":49,"icon":50},"Architecture","\u002Fdocs\u002Fconcepts\u002Farchitecture","1.docs\u002F2.concepts\u002F2.architecture","i-lucide-layers",{"title":52,"path":53,"stem":54,"icon":55},"Exactly-once semantics","\u002Fdocs\u002Fconcepts\u002Fexactly-once","1.docs\u002F2.concepts\u002F3.exactly-once","i-lucide-shield-check",{"title":57,"path":58,"stem":59,"icon":60},"Lanes and parallelism","\u002Fdocs\u002Fconcepts\u002Flanes-and-parallelism","1.docs\u002F2.concepts\u002F4.lanes-and-parallelism","i-lucide-split",{"title":62,"path":63,"stem":64,"icon":65},"State and thread-safety","\u002Fdocs\u002Fconcepts\u002Fstate-and-thread-safety","1.docs\u002F2.concepts\u002F5.state-and-thread-safety","i-lucide-lock",{"title":67,"path":68,"stem":69,"icon":70},"Event time and watermarks","\u002Fdocs\u002Fconcepts\u002Fevent-time-and-watermarks","1.docs\u002F2.concepts\u002F6.event-time-and-watermarks","i-lucide-clock",{"title":72,"path":73,"stem":74,"icon":75},"The configuration model","\u002Fdocs\u002Fconcepts\u002Fconfiguration-model","1.docs\u002F2.concepts\u002F7.configuration-model","i-lucide-sliders-horizontal",{"title":77,"path":78,"stem":79,"icon":80},"The error-handling model","\u002Fdocs\u002Fconcepts\u002Ferror-handling-model","1.docs\u002F2.concepts\u002F8.error-handling-model","i-lucide-triangle-alert",{"title":82,"path":83,"stem":84,"icon":85},"How StoatFlow differs from Kafka Streams","\u002Fdocs\u002Fconcepts\u002Fhow-stoatflow-differs-from-ks","1.docs\u002F2.concepts\u002F9.how-stoatflow-differs-from-ks","i-lucide-arrow-left-right",{"title":87,"path":88,"stem":89,"children":90,"icon":93},"Building Topologies","\u002Fdocs\u002Fbuilding","1.docs\u002F3.building\u002F1.index",[91,94,99,104,109,114,119,124,129,134,139,144],{"title":92,"path":88,"stem":89,"icon":93},"Building topologies","i-lucide-blocks",{"title":95,"path":96,"stem":97,"icon":98},"Error handling and DLQ","\u002Fdocs\u002Fbuilding\u002Ferror-handling-dlq","1.docs\u002F3.building\u002F10.error-handling-dlq","i-lucide-circle-x",{"title":100,"path":101,"stem":102,"icon":103},"State stores","\u002Fdocs\u002Fbuilding\u002Fstate-stores","1.docs\u002F3.building\u002F11.state-stores","i-lucide-database",{"title":105,"path":106,"stem":107,"icon":108},"Testing topologies","\u002Fdocs\u002Fbuilding\u002Ftesting","1.docs\u002F3.building\u002F12.testing","i-lucide-flask-conical",{"title":110,"path":111,"stem":112,"icon":113},"Sources and sinks","\u002Fdocs\u002Fbuilding\u002Fstreams-builder","1.docs\u002F3.building\u002F2.streams-builder","i-lucide-import",{"title":115,"path":116,"stem":117,"icon":118},"KStream and KTable operations","\u002Fdocs\u002Fbuilding\u002Fkstream-ktable","1.docs\u002F3.building\u002F3.kstream-ktable","i-lucide-waypoints",{"title":120,"path":121,"stem":122,"icon":123},"Aggregations","\u002Fdocs\u002Fbuilding\u002Faggregations","1.docs\u002F3.building\u002F4.aggregations","i-lucide-sigma",{"title":125,"path":126,"stem":127,"icon":128},"Windowing","\u002Fdocs\u002Fbuilding\u002Fwindowing","1.docs\u002F3.building\u002F5.windowing","i-lucide-calendar-clock",{"title":130,"path":131,"stem":132,"icon":133},"Joins","\u002Fdocs\u002Fbuilding\u002Fjoins","1.docs\u002F3.building\u002F6.joins","i-lucide-git-merge",{"title":135,"path":136,"stem":137,"icon":138},"The Processor API","\u002Fdocs\u002Fbuilding\u002Fprocessor-api","1.docs\u002F3.building\u002F7.processor-api","i-lucide-cpu",{"title":140,"path":141,"stem":142,"icon":143},"Scheduled sources","\u002Fdocs\u002Fbuilding\u002Fscheduled-sources","1.docs\u002F3.building\u002F8.scheduled-sources","i-lucide-timer",{"title":145,"path":146,"stem":147,"icon":148},"Serdes and Avro","\u002Fdocs\u002Fbuilding\u002Fserdes","1.docs\u002F3.building\u002F9.serdes","i-lucide-binary",{"title":150,"path":151,"stem":152,"children":153,"icon":75},"Configuration","\u002Fdocs\u002Fconfiguration","1.docs\u002F4.configuration\u002F1.index",[154,156,161,166,171],{"title":155,"path":151,"stem":152,"icon":75},"How configuration works",{"title":157,"path":158,"stem":159,"icon":160},"Engine configuration (:core)","\u002Fdocs\u002Fconfiguration\u002Fcore-config","1.docs\u002F4.configuration\u002F2.core-config","i-lucide-settings-2",{"title":162,"path":163,"stem":164,"icon":165},"Runtime configuration (:runtime)","\u002Fdocs\u002Fconfiguration\u002Fruntime-config","1.docs\u002F4.configuration\u002F3.runtime-config","i-lucide-server-cog",{"title":167,"path":168,"stem":169,"icon":170},"Defaults, adaptivity, and presets","\u002Fdocs\u002Fconfiguration\u002Fdefaults-and-presets","1.docs\u002F4.configuration\u002F4.defaults-and-presets","i-lucide-gauge",{"title":172,"path":173,"stem":174,"icon":175},"Kafka client configuration","\u002Fdocs\u002Fconfiguration\u002Fkafka-client-config","1.docs\u002F4.configuration\u002F5.kafka-client-config","i-lucide-plug",{"title":177,"path":178,"stem":179,"children":180,"icon":183},"Running in Production","\u002Fdocs\u002Fruntime","1.docs\u002F5.runtime\u002F1.index",[181,184,189,194,199,204,209,214],{"title":182,"path":178,"stem":179,"icon":183},"The runtime","i-lucide-server",{"title":185,"path":186,"stem":187,"icon":188},"The REST API","\u002Fdocs\u002Fruntime\u002Frest-api","1.docs\u002F5.runtime\u002F2.rest-api","i-lucide-globe",{"title":190,"path":191,"stem":192,"icon":193},"Health checks","\u002Fdocs\u002Fruntime\u002Fhealth-checks","1.docs\u002F5.runtime\u002F3.health-checks","i-lucide-heart-pulse",{"title":195,"path":196,"stem":197,"icon":198},"Metrics","\u002Fdocs\u002Fruntime\u002Fmetrics","1.docs\u002F5.runtime\u002F4.metrics","i-lucide-activity",{"title":200,"path":201,"stem":202,"icon":203},"Pause and resume","\u002Fdocs\u002Fruntime\u002Fpause-unpause","1.docs\u002F5.runtime\u002F5.pause-unpause","i-lucide-pause",{"title":205,"path":206,"stem":207,"icon":208},"Plugins and lifecycle hooks","\u002Fdocs\u002Fruntime\u002Fplugins","1.docs\u002F5.runtime\u002F6.plugins","i-lucide-puzzle",{"title":210,"path":211,"stem":212,"icon":213},"Docker images","\u002Fdocs\u002Fruntime\u002Fdocker","1.docs\u002F5.runtime\u002F7.docker","i-lucide-container",{"title":215,"path":216,"stem":217,"icon":218},"GraalVM native image","\u002Fdocs\u002Fruntime\u002Fnative-image","1.docs\u002F5.runtime\u002F8.native-image","i-lucide-zap",{"title":220,"path":221,"stem":222,"children":223,"icon":226},"Deploying & Operating","\u002Fdocs\u002Foperating","1.docs\u002F6.operating\u002F1.index",[224,227,232,237,242,247,252],{"title":225,"path":221,"stem":222,"icon":226},"Deploying and operating","i-lucide-life-buoy",{"title":228,"path":229,"stem":230,"icon":231},"Running on Kubernetes","\u002Fdocs\u002Foperating\u002Fkubernetes","1.docs\u002F6.operating\u002F2.kubernetes","i-lucide-ship",{"title":233,"path":234,"stem":235,"icon":236},"High availability","\u002Fdocs\u002Foperating\u002Fhigh-availability","1.docs\u002F6.operating\u002F3.high-availability","i-lucide-copy",{"title":238,"path":239,"stem":240,"icon":241},"Liveness and readiness probes","\u002Fdocs\u002Foperating\u002Fprobes","1.docs\u002F6.operating\u002F4.probes","i-lucide-stethoscope",{"title":243,"path":244,"stem":245,"icon":246},"Observability","\u002Fdocs\u002Foperating\u002Fobservability","1.docs\u002F6.operating\u002F5.observability","i-lucide-telescope",{"title":248,"path":249,"stem":250,"icon":251},"Tuning under load","\u002Fdocs\u002Foperating\u002Ftuning","1.docs\u002F6.operating\u002F6.tuning","i-lucide-sliders",{"title":253,"path":254,"stem":255,"icon":256},"Production checklist","\u002Fdocs\u002Foperating\u002Fproduction-checklist","1.docs\u002F6.operating\u002F7.production-checklist","i-lucide-clipboard-check",{"title":258,"path":259,"stem":260,"children":261,"icon":85},"Migrating from Kafka Streams","\u002Fdocs\u002Fmigration","1.docs\u002F7.migration\u002F1.index",[262,263,268],{"title":258,"path":259,"stem":260,"icon":85},{"title":264,"path":265,"stem":266,"icon":267},"Migration without carrying state","\u002Fdocs\u002Fmigration\u002Fwithout-data-migration","1.docs\u002F7.migration\u002F2.without-data-migration","i-lucide-sparkles",{"title":269,"path":270,"stem":271,"icon":272},"Migration carrying state","\u002Fdocs\u002Fmigration\u002Fwith-data-migration","1.docs\u002F7.migration\u002F3.with-data-migration","i-lucide-database-backup",{"title":274,"path":275,"stem":276,"children":277,"icon":279},"Reference","\u002Fdocs\u002Freference","1.docs\u002F8.reference\u002F1.index",[278,280,285,290,295,300,305,309],{"title":274,"path":275,"stem":276,"icon":279},"i-lucide-list",{"title":281,"path":282,"stem":283,"icon":284},"Configuration reference","\u002Fdocs\u002Freference\u002Fconfiguration-reference","1.docs\u002F8.reference\u002F2.configuration-reference","i-lucide-table",{"title":286,"path":287,"stem":288,"icon":289},"REST API reference","\u002Fdocs\u002Freference\u002Frest-api-reference","1.docs\u002F8.reference\u002F3.rest-api-reference","i-lucide-network",{"title":291,"path":292,"stem":293,"icon":294},"Gradle plugin reference","\u002Fdocs\u002Freference\u002Fgradle-plugin-reference","1.docs\u002F8.reference\u002F4.gradle-plugin-reference","i-lucide-box",{"title":296,"path":297,"stem":298,"icon":299},"Maven reference","\u002Fdocs\u002Freference\u002Fmaven-reference","1.docs\u002F8.reference\u002F5.maven-reference","i-simple-icons-apachemaven",{"title":301,"path":302,"stem":303,"icon":304},"Kafka Streams compatibility matrix","\u002Fdocs\u002Freference\u002Fks-compatibility-matrix","1.docs\u002F8.reference\u002F6.ks-compatibility-matrix","i-lucide-table-2",{"title":306,"path":307,"stem":308,"icon":170},"Metrics reference","\u002Fdocs\u002Freference\u002Fmetrics-reference","1.docs\u002F8.reference\u002F7.metrics-reference",{"title":310,"path":311,"stem":312,"icon":313},"Glossary","\u002Fdocs\u002Freference\u002Fglossary","1.docs\u002F8.reference\u002F8.glossary","i-lucide-book-a",{"id":315,"title":100,"body":316,"description":4424,"extension":4425,"meta":4426,"navigation":4427,"pageType":4428,"path":101,"seo":4429,"stem":102,"__hash__":4430},"docs\u002F1.docs\u002F3.building\u002F11.state-stores.md",{"type":317,"value":318,"toc":4406},"minimark",[319,336,344,418,423,426,492,512,519,543,661,675,698,704,721,1301,1308,1687,1692,1698,1722,1728,1832,1850,1854,2410,2414,2442,3505,3520,3524,3534,3624,3656,3677,3681,3692,3992,4029,4057,4061,4087,4368,4372,4402],[320,321,322,323,327,328,331,332,335],"p",{},"State stores hold the data your stateful operators accumulate — running counts, window aggregates, join buffers, custom per-key state. This page covers the two factories you use to configure them (",[324,325,326],"code",{},"Stores"," and ",[324,329,330],{},"Materialized","), how to choose between RocksDB-backed and in-memory variants, how to attach a store to a custom ",[324,333,334],{},"Processor",", and how to read a store back from a running application.",[320,337,338,339,343],{},"For the conceptual model — global state, thread-safety under concurrent lanes, and changelog-backed durability — see ",[340,341,342],"a",{"href":63},"State and thread safety",".",[345,346,347],"tldr-panel",{},[348,349,350,372,393,405],"ul",{},[351,352,353,358,359,363,364,367,368,371],"li",{},[354,355,356],"strong",{},[324,357,326],{}," is the factory for store ",[360,361,362],"em",{},"suppliers",": ",[324,365,366],{},"persistentKeyValueStore(...)",", ",[324,369,370],{},"inMemoryWindowStore(...)",", etc. Persistent = RocksDB (survives restarts); in-memory = lost on restart.",[351,373,374,378,379,367,382,367,385,388,389,392],{},[354,375,376],{},[324,377,330],{}," configures the store behind a DSL operator (",[324,380,381],{},"count",[324,383,384],{},"reduce",[324,386,387],{},"aggregate",", joins): store name, store type (",[324,390,391],{},"withStoreType","), caching, changelog logging.",[351,394,395,398,399,401,402,404],{},[354,396,397],{},"Default is RocksDB."," Most stateful DSL operators pick the right store type for you — you only reach for ",[324,400,326],{}," \u002F ",[324,403,391],{}," to override.",[351,406,407,410,411,414,415,343],{},[354,408,409],{},"Read back"," a store from a running engine with ",[324,412,413],{},"store(StoreQueryParameters.fromNameAndType(...))",", or from tests with ",[324,416,417],{},"TopologyTestDriver.getKeyValueStore(...)",[419,420,422],"h2",{"id":421},"rocksdb-vs-in-memory","RocksDB vs. in-memory",[320,424,425],{},"Every store type comes in two variants, and the choice is the same each time:",[427,428,429,444],"table",{},[430,431,432],"thead",{},[433,434,435,438,441],"tr",{},[436,437],"th",{},[436,439,440],{},"Persistent (RocksDB)",[436,442,443],{},"In-memory",[445,446,447,459,470,481],"tbody",{},[433,448,449,453,456],{},[450,451,452],"td",{},"Survives restart",[450,454,455],{},"Yes — restored from local disk + changelog",[450,457,458],{},"No — rebuilt from changelog on every start",[433,460,461,464,467],{},[450,462,463],{},"Memory footprint",[450,465,466],{},"Bounded; data spills to disk",[450,468,469],{},"Whole store lives on the heap",[433,471,472,475,478],{},[450,473,474],{},"Exactly-once",[450,476,477],{},"Yes",[450,479,480],{},"Yes (changelog still committed on the barrier)",[433,482,483,486,489],{},[450,484,485],{},"Best for",[450,487,488],{},"Production, large state, fast restart",[450,490,491],{},"Tests, small bounded state, prototyping",[493,494,497],"callout",{"color":495,"icon":496},"info","i-lucide-info",[320,498,499,500,503,504,507,508,511],{},"RocksDB is the ",[354,501,502],{},"default and the recommended production type",". In-memory stores keep their data on the JVM heap, so they're bounded by available memory and have to read the entire changelog at startup — fine for tests and small state, but RocksDB recovers faster and scales past heap size in production. Note that \"in-memory store\" is ",[360,505,506],{},"not"," \"no durability\": both variants write a changelog and commit it atomically on the ",[340,509,510],{"href":53},"commit barrier",". The difference is local persistence and cold-start cost.",[419,513,515,516,518],{"id":514},"the-stores-factory","The ",[324,517,326],{}," factory",[320,520,521,523,524,527,528,531,532,534,535,538,539,542],{},[324,522,326],{}," is a static factory (",[324,525,526],{},"io.stoatflow.core.state.Stores",") that returns a ",[360,529,530],{},"supplier"," — a deferred description of a store. Suppliers are handed to ",[324,533,330],{}," (for DSL operators) or to ",[324,536,537],{},"StreamsBuilder.addStateStore(...)"," (for custom Processors). The factory methods, grounded in ",[324,540,541],{},"Stores.kt",":",[427,544,545,556],{},[430,546,547],{},[433,548,549,552,554],{},[436,550,551],{},"Store type",[436,553,440],{},[436,555,443],{},[445,557,558,573,586,601,616,631,646],{},[433,559,560,563,568],{},[450,561,562],{},"Key-value",[450,564,565],{},[324,566,567],{},"persistentKeyValueStore(name)",[450,569,570],{},[324,571,572],{},"inMemoryKeyValueStore(name)",[433,574,575,578,581],{},[450,576,577],{},"LRU cache",[450,579,580],{},"—",[450,582,583],{},[324,584,585],{},"lruMap(name, maxCacheSize)",[433,587,588,591,596],{},[450,589,590],{},"Window",[450,592,593],{},[324,594,595],{},"persistentWindowStore(name, retention, windowSize)",[450,597,598],{},[324,599,600],{},"inMemoryWindowStore(name, retention, windowSize)",[433,602,603,606,611],{},[450,604,605],{},"Session",[450,607,608],{},[324,609,610],{},"persistentSessionStore(name, retention, inactivityGap)",[450,612,613],{},[324,614,615],{},"inMemorySessionStore(name, retention, inactivityGap)",[433,617,618,621,626],{},[450,619,620],{},"Timestamped KV (KIP-258)",[450,622,623],{},[324,624,625],{},"persistentTimestampedKeyValueStore(name)",[450,627,628],{},[324,629,630],{},"inMemoryTimestampedKeyValueStore(name)",[433,632,633,636,641],{},[450,634,635],{},"Timestamped window (KIP-258)",[450,637,638],{},[324,639,640],{},"persistentTimestampedWindowStore(name, retention, windowSize)",[450,642,643],{},[324,644,645],{},"inMemoryTimestampedWindowStore(name, retention, windowSize)",[433,647,648,651,656],{},[450,649,650],{},"Versioned KV (KIP-889)",[450,652,653],{},[324,654,655],{},"persistentVersionedKeyValueStore(name, historyRetention)",[450,657,658],{},[324,659,660],{},"inMemoryVersionedKeyValueStore(name, historyRetention)",[320,662,663,664,667,668,671,672,343],{},"All duration arguments are ",[324,665,666],{},"java.time.Duration",". Window and session retention must be at least the window size (the factory enforces this and throws ",[324,669,670],{},"IllegalArgumentException"," otherwise). Store names must be non-empty and contain only ",[324,673,674],{},"[a-zA-Z0-9._-]",[493,676,677],{"color":495,"icon":70},[320,678,679,682,683,401,686,689,690,693,694,697],{},[354,680,681],{},"Versioned stores"," (",[324,684,685],{},"persistentVersionedKeyValueStore",[324,687,688],{},"inMemoryVersionedKeyValueStore",") keep multiple versions of each value over time for point-in-time lookups and temporal joins. The single ",[324,691,692],{},"historyRetention"," argument is dual-purpose: it's both how long old versions are kept ",[360,695,696],{},"and"," the grace period — out-of-order records older than that window are rejected. Unlike Kafka Streams, which only ships a RocksDB-backed versioned store, StoatFlow offers an in-memory variant too.",[419,699,701,703],{"id":700},"materialized-stores-behind-dsl-operators",[324,702,330],{}," — stores behind DSL operators",[320,705,706,707,367,709,367,711,713,714,716,717,720],{},"Stateful DSL operators (",[324,708,381],{},[324,710,384],{},[324,712,387],{},", windowed counts, joins) take a ",[324,715,330],{}," to describe their store. The most common forms (grounded in ",[324,718,719],{},"Materialized.kt","):",[722,723,725,966],"code-tabs",{"group":724},"lang",[726,727,733],"pre",{"className":728,"code":729,"filename":730,"language":731,"meta":732,"style":732},"language-kotlin shiki shiki-themes vitesse-light","import io.stoatflow.core.state.StateStore\nimport io.stoatflow.core.state.StoreType\nimport io.stoatflow.core.topology.Materialized\nimport org.apache.kafka.common.serialization.Serdes\n\n\u002F\u002F Named store, default (RocksDB) type, with serdes\nval counts =\n    Materialized.`as`\u003CString, Long, StateStore>(\"word-counts\")\n        .withKeySerde(Serdes.String())\n        .withValueSerde(Serdes.Long())\n\n\u002F\u002F Pick the store type explicitly (clears any explicit supplier)\nval inMem =\n    Materialized.`as`\u003CString, Long, StateStore>(\"counts\")\n        .withStoreType(StoreType.IN_MEMORY)\n\n\u002F\u002F Auto-generated store name, store type only\nval autoNamed = Materialized.`as`\u003CString, Long, StateStore>(StoreType.ROCKS_DB)\n","Kotlin","kotlin","",[324,734,735,748,756,764,772,779,786,800,836,853,867,872,878,888,914,924,929,935],{"__ignoreMap":732},[736,737,740,744],"span",{"class":738,"line":739},"line",1,[736,741,743],{"class":742},"sbBg2","import",[736,745,747],{"class":746},"sySUi"," io.stoatflow.core.state.StateStore\n",[736,749,751,753],{"class":738,"line":750},2,[736,752,743],{"class":742},[736,754,755],{"class":746}," io.stoatflow.core.state.StoreType\n",[736,757,759,761],{"class":738,"line":758},3,[736,760,743],{"class":742},[736,762,763],{"class":746}," io.stoatflow.core.topology.Materialized\n",[736,765,767,769],{"class":738,"line":766},4,[736,768,743],{"class":742},[736,770,771],{"class":746}," org.apache.kafka.common.serialization.Serdes\n",[736,773,775],{"class":738,"line":774},5,[736,776,778],{"emptyLinePlaceholder":777},true,"\n",[736,780,782],{"class":738,"line":781},6,[736,783,785],{"class":784},"s8zF2","\u002F\u002F Named store, default (RocksDB) type, with serdes\n",[736,787,789,792,796],{"class":738,"line":788},7,[736,790,791],{"class":742},"val",[736,793,795],{"class":794},"suHK_"," counts ",[736,797,799],{"class":798},"sYZai","=\n",[736,801,803,806,809,812,816,818,821,823,826,829,833],{"class":738,"line":802},8,[736,804,805],{"class":794},"    Materialized.",[736,807,808],{"class":746},"`as`",[736,810,811],{"class":794},"\u003C",[736,813,815],{"class":814},"sUxyF","String",[736,817,367],{"class":794},[736,819,820],{"class":814},"Long",[736,822,367],{"class":794},[736,824,825],{"class":814},"StateStore",[736,827,828],{"class":794},">(",[736,830,832],{"class":831},"spphp","\"word-counts\"",[736,834,835],{"class":794},")\n",[736,837,839,842,845,848,850],{"class":738,"line":838},9,[736,840,841],{"class":794},"        .",[736,843,844],{"class":746},"withKeySerde",[736,846,847],{"class":794},"(Serdes.",[736,849,815],{"class":746},[736,851,852],{"class":794},"())\n",[736,854,856,858,861,863,865],{"class":738,"line":855},10,[736,857,841],{"class":794},[736,859,860],{"class":746},"withValueSerde",[736,862,847],{"class":794},[736,864,820],{"class":746},[736,866,852],{"class":794},[736,868,870],{"class":738,"line":869},11,[736,871,778],{"emptyLinePlaceholder":777},[736,873,875],{"class":738,"line":874},12,[736,876,877],{"class":784},"\u002F\u002F Pick the store type explicitly (clears any explicit supplier)\n",[736,879,881,883,886],{"class":738,"line":880},13,[736,882,791],{"class":742},[736,884,885],{"class":794}," inMem ",[736,887,799],{"class":798},[736,889,891,893,895,897,899,901,903,905,907,909,912],{"class":738,"line":890},14,[736,892,805],{"class":794},[736,894,808],{"class":746},[736,896,811],{"class":794},[736,898,815],{"class":814},[736,900,367],{"class":794},[736,902,820],{"class":814},[736,904,367],{"class":794},[736,906,825],{"class":814},[736,908,828],{"class":794},[736,910,911],{"class":831},"\"counts\"",[736,913,835],{"class":794},[736,915,917,919,921],{"class":738,"line":916},15,[736,918,841],{"class":794},[736,920,391],{"class":746},[736,922,923],{"class":794},"(StoreType.IN_MEMORY)\n",[736,925,927],{"class":738,"line":926},16,[736,928,778],{"emptyLinePlaceholder":777},[736,930,932],{"class":738,"line":931},17,[736,933,934],{"class":784},"\u002F\u002F Auto-generated store name, store type only\n",[736,936,938,940,943,946,949,951,953,955,957,959,961,963],{"class":738,"line":937},18,[736,939,791],{"class":742},[736,941,942],{"class":794}," autoNamed ",[736,944,945],{"class":798},"=",[736,947,948],{"class":794}," Materialized.",[736,950,808],{"class":746},[736,952,811],{"class":794},[736,954,815],{"class":814},[736,956,367],{"class":794},[736,958,820],{"class":814},[736,960,367],{"class":794},[736,962,825],{"class":814},[736,964,965],{"class":794},">(StoreType.ROCKS_DB)\n",[726,967,972],{"className":968,"code":969,"filename":970,"language":971,"meta":732,"style":732},"language-java shiki shiki-themes vitesse-light","import io.stoatflow.core.state.StateStore;\nimport io.stoatflow.core.state.StoreType;\nimport io.stoatflow.core.topology.Materialized;\nimport org.apache.kafka.common.serialization.Serdes;\n\n\u002F\u002F Named store, default (RocksDB) type, with serdes\nvar counts =\n    Materialized.\u003CString, Long, StateStore>as(\"word-counts\")\n        .withKeySerde(Serdes.String())\n        .withValueSerde(Serdes.Long());\n\n\u002F\u002F Pick the store type explicitly (clears any explicit supplier)\nvar inMem =\n    Materialized.\u003CString, Long, StateStore>as(\"counts\")\n        .withStoreType(StoreType.IN_MEMORY);\n\n\u002F\u002F Auto-generated store name, store type only\nvar autoNamed = Materialized.\u003CString, Long, StateStore>as(StoreType.ROCKS_DB);\n","Java","java",[324,973,974,1003,1028,1053,1087,1091,1095,1108,1150,1166,1183,1187,1191,1200,1233,1251,1255,1259],{"__ignoreMap":732},[736,975,976,978,981,983,986,988,991,993,996,998,1000],{"class":738,"line":739},[736,977,743],{"class":742},[736,979,980],{"class":794}," io",[736,982,343],{"class":798},[736,984,985],{"class":794},"stoatflow",[736,987,343],{"class":798},[736,989,990],{"class":794},"core",[736,992,343],{"class":798},[736,994,995],{"class":794},"state",[736,997,343],{"class":798},[736,999,825],{"class":794},[736,1001,1002],{"class":798},";\n",[736,1004,1005,1007,1009,1011,1013,1015,1017,1019,1021,1023,1026],{"class":738,"line":750},[736,1006,743],{"class":742},[736,1008,980],{"class":794},[736,1010,343],{"class":798},[736,1012,985],{"class":794},[736,1014,343],{"class":798},[736,1016,990],{"class":794},[736,1018,343],{"class":798},[736,1020,995],{"class":794},[736,1022,343],{"class":798},[736,1024,1025],{"class":794},"StoreType",[736,1027,1002],{"class":798},[736,1029,1030,1032,1034,1036,1038,1040,1042,1044,1047,1049,1051],{"class":738,"line":758},[736,1031,743],{"class":742},[736,1033,980],{"class":794},[736,1035,343],{"class":798},[736,1037,985],{"class":794},[736,1039,343],{"class":798},[736,1041,990],{"class":794},[736,1043,343],{"class":798},[736,1045,1046],{"class":794},"topology",[736,1048,343],{"class":798},[736,1050,330],{"class":794},[736,1052,1002],{"class":798},[736,1054,1055,1057,1060,1062,1065,1067,1070,1072,1075,1077,1080,1082,1085],{"class":738,"line":766},[736,1056,743],{"class":742},[736,1058,1059],{"class":794}," org",[736,1061,343],{"class":798},[736,1063,1064],{"class":794},"apache",[736,1066,343],{"class":798},[736,1068,1069],{"class":794},"kafka",[736,1071,343],{"class":798},[736,1073,1074],{"class":794},"common",[736,1076,343],{"class":798},[736,1078,1079],{"class":794},"serialization",[736,1081,343],{"class":798},[736,1083,1084],{"class":794},"Serdes",[736,1086,1002],{"class":798},[736,1088,1089],{"class":738,"line":774},[736,1090,778],{"emptyLinePlaceholder":777},[736,1092,1093],{"class":738,"line":781},[736,1094,785],{"class":784},[736,1096,1097,1101,1105],{"class":738,"line":788},[736,1098,1100],{"class":1099},"si04Y","var",[736,1102,1104],{"class":1103},"svycV"," counts",[736,1106,1107],{"class":798}," =\n",[736,1109,1110,1113,1115,1117,1119,1122,1125,1127,1130,1133,1136,1139,1143,1146,1148],{"class":738,"line":802},[736,1111,1112],{"class":794},"    Materialized",[736,1114,343],{"class":798},[736,1116,811],{"class":1099},[736,1118,815],{"class":794},[736,1120,1121],{"class":798},",",[736,1123,1124],{"class":794}," Long",[736,1126,1121],{"class":798},[736,1128,1129],{"class":794}," StateStore",[736,1131,1132],{"class":1099},">",[736,1134,1135],{"class":746},"as",[736,1137,1138],{"class":798},"(",[736,1140,1142],{"class":1141},"sSP4y","\"",[736,1144,1145],{"class":831},"word-counts",[736,1147,1142],{"class":1141},[736,1149,835],{"class":798},[736,1151,1152,1154,1156,1158,1160,1162,1164],{"class":738,"line":838},[736,1153,841],{"class":798},[736,1155,844],{"class":746},[736,1157,1138],{"class":798},[736,1159,1084],{"class":1103},[736,1161,343],{"class":798},[736,1163,815],{"class":746},[736,1165,852],{"class":798},[736,1167,1168,1170,1172,1174,1176,1178,1180],{"class":738,"line":855},[736,1169,841],{"class":798},[736,1171,860],{"class":746},[736,1173,1138],{"class":798},[736,1175,1084],{"class":1103},[736,1177,343],{"class":798},[736,1179,820],{"class":746},[736,1181,1182],{"class":798},"());\n",[736,1184,1185],{"class":738,"line":869},[736,1186,778],{"emptyLinePlaceholder":777},[736,1188,1189],{"class":738,"line":874},[736,1190,877],{"class":784},[736,1192,1193,1195,1198],{"class":738,"line":880},[736,1194,1100],{"class":1099},[736,1196,1197],{"class":1103}," inMem",[736,1199,1107],{"class":798},[736,1201,1202,1204,1206,1208,1210,1212,1214,1216,1218,1220,1222,1224,1226,1229,1231],{"class":738,"line":890},[736,1203,1112],{"class":794},[736,1205,343],{"class":798},[736,1207,811],{"class":1099},[736,1209,815],{"class":794},[736,1211,1121],{"class":798},[736,1213,1124],{"class":794},[736,1215,1121],{"class":798},[736,1217,1129],{"class":794},[736,1219,1132],{"class":1099},[736,1221,1135],{"class":746},[736,1223,1138],{"class":798},[736,1225,1142],{"class":1141},[736,1227,1228],{"class":831},"counts",[736,1230,1142],{"class":1141},[736,1232,835],{"class":798},[736,1234,1235,1237,1239,1241,1243,1245,1248],{"class":738,"line":916},[736,1236,841],{"class":798},[736,1238,391],{"class":746},[736,1240,1138],{"class":798},[736,1242,1025],{"class":1103},[736,1244,343],{"class":798},[736,1246,1247],{"class":1103},"IN_MEMORY",[736,1249,1250],{"class":798},");\n",[736,1252,1253],{"class":738,"line":926},[736,1254,778],{"emptyLinePlaceholder":777},[736,1256,1257],{"class":738,"line":931},[736,1258,934],{"class":784},[736,1260,1261,1263,1266,1269,1272,1274,1276,1278,1280,1282,1284,1286,1288,1290,1292,1294,1296,1299],{"class":738,"line":937},[736,1262,1100],{"class":1099},[736,1264,1265],{"class":1103}," autoNamed",[736,1267,1268],{"class":798}," =",[736,1270,1271],{"class":794}," Materialized",[736,1273,343],{"class":798},[736,1275,811],{"class":1099},[736,1277,815],{"class":794},[736,1279,1121],{"class":798},[736,1281,1124],{"class":794},[736,1283,1121],{"class":798},[736,1285,1129],{"class":794},[736,1287,1132],{"class":1099},[736,1289,1135],{"class":746},[736,1291,1138],{"class":798},[736,1293,1025],{"class":1103},[736,1295,343],{"class":798},[736,1297,1298],{"class":1103},"ROCKS_DB",[736,1300,1250],{"class":798},[320,1302,1303,1304,1307],{},"You can also hand ",[324,1305,1306],{},"Materialized.as(...)"," a supplier directly when you need parameters the DSL doesn't expose (window retention overrides, an explicit window\u002Fsession\u002Fversioned supplier):",[722,1309,1310,1467],{"group":724},[726,1311,1313],{"className":728,"code":1312,"filename":730,"language":731,"meta":732,"style":732},"import io.stoatflow.core.state.Stores\nimport io.stoatflow.core.topology.Materialized\nimport java.time.Duration\n\n\u002F\u002F Explicit persistent window store supplier\nval windowed =\n    Materialized.`as`\u003CString, Long, StateStore>(\n        Stores.persistentWindowStore(\"hourly\", Duration.ofHours(2), Duration.ofHours(1)),\n    )\n\n\u002F\u002F Explicit in-memory key-value supplier\nval cache =\n    Materialized.`as`\u003CString, Long, StateStore>(Stores.inMemoryKeyValueStore(\"cache\"))\n",[324,1314,1315,1322,1328,1335,1339,1344,1353,1374,1412,1417,1421,1426,1435],{"__ignoreMap":732},[736,1316,1317,1319],{"class":738,"line":739},[736,1318,743],{"class":742},[736,1320,1321],{"class":746}," io.stoatflow.core.state.Stores\n",[736,1323,1324,1326],{"class":738,"line":750},[736,1325,743],{"class":742},[736,1327,763],{"class":746},[736,1329,1330,1332],{"class":738,"line":758},[736,1331,743],{"class":742},[736,1333,1334],{"class":746}," java.time.Duration\n",[736,1336,1337],{"class":738,"line":766},[736,1338,778],{"emptyLinePlaceholder":777},[736,1340,1341],{"class":738,"line":774},[736,1342,1343],{"class":784},"\u002F\u002F Explicit persistent window store supplier\n",[736,1345,1346,1348,1351],{"class":738,"line":781},[736,1347,791],{"class":742},[736,1349,1350],{"class":794}," windowed ",[736,1352,799],{"class":798},[736,1354,1355,1357,1359,1361,1363,1365,1367,1369,1371],{"class":738,"line":788},[736,1356,805],{"class":794},[736,1358,808],{"class":746},[736,1360,811],{"class":794},[736,1362,815],{"class":814},[736,1364,367],{"class":794},[736,1366,820],{"class":814},[736,1368,367],{"class":794},[736,1370,825],{"class":814},[736,1372,1373],{"class":794},">(\n",[736,1375,1376,1379,1382,1384,1387,1390,1393,1395,1399,1402,1404,1406,1409],{"class":738,"line":802},[736,1377,1378],{"class":794},"        Stores.",[736,1380,1381],{"class":746},"persistentWindowStore",[736,1383,1138],{"class":794},[736,1385,1386],{"class":831},"\"hourly\"",[736,1388,1389],{"class":794},", Duration.",[736,1391,1392],{"class":746},"ofHours",[736,1394,1138],{"class":794},[736,1396,1398],{"class":1397},"s-TwI","2",[736,1400,1401],{"class":794},"), Duration.",[736,1403,1392],{"class":746},[736,1405,1138],{"class":794},[736,1407,1408],{"class":1397},"1",[736,1410,1411],{"class":794},")),\n",[736,1413,1414],{"class":738,"line":838},[736,1415,1416],{"class":794},"    )\n",[736,1418,1419],{"class":738,"line":855},[736,1420,778],{"emptyLinePlaceholder":777},[736,1422,1423],{"class":738,"line":869},[736,1424,1425],{"class":784},"\u002F\u002F Explicit in-memory key-value supplier\n",[736,1427,1428,1430,1433],{"class":738,"line":874},[736,1429,791],{"class":742},[736,1431,1432],{"class":794}," cache ",[736,1434,799],{"class":798},[736,1436,1437,1439,1441,1443,1445,1447,1449,1451,1453,1456,1459,1461,1464],{"class":738,"line":880},[736,1438,805],{"class":794},[736,1440,808],{"class":746},[736,1442,811],{"class":794},[736,1444,815],{"class":814},[736,1446,367],{"class":794},[736,1448,820],{"class":814},[736,1450,367],{"class":794},[736,1452,825],{"class":814},[736,1454,1455],{"class":794},">(Stores.",[736,1457,1458],{"class":746},"inMemoryKeyValueStore",[736,1460,1138],{"class":794},[736,1462,1463],{"class":831},"\"cache\"",[736,1465,1466],{"class":794},"))\n",[726,1468,1470],{"className":968,"code":1469,"filename":970,"language":971,"meta":732,"style":732},"import io.stoatflow.core.state.Stores;\nimport io.stoatflow.core.topology.Materialized;\nimport java.time.Duration;\n\n\u002F\u002F Explicit persistent window store supplier\nvar windowed =\n    Materialized.\u003CString, Long, StateStore>as(\n        Stores.persistentWindowStore(\"hourly\", Duration.ofHours(2), Duration.ofHours(1)));\n\n\u002F\u002F Explicit in-memory key-value supplier\nvar cache =\n    Materialized.\u003CString, Long, StateStore>as(Stores.inMemoryKeyValueStore(\"cache\"));\n",[324,1471,1472,1496,1520,1539,1543,1547,1556,1581,1628,1632,1636,1645],{"__ignoreMap":732},[736,1473,1474,1476,1478,1480,1482,1484,1486,1488,1490,1492,1494],{"class":738,"line":739},[736,1475,743],{"class":742},[736,1477,980],{"class":794},[736,1479,343],{"class":798},[736,1481,985],{"class":794},[736,1483,343],{"class":798},[736,1485,990],{"class":794},[736,1487,343],{"class":798},[736,1489,995],{"class":794},[736,1491,343],{"class":798},[736,1493,326],{"class":794},[736,1495,1002],{"class":798},[736,1497,1498,1500,1502,1504,1506,1508,1510,1512,1514,1516,1518],{"class":738,"line":750},[736,1499,743],{"class":742},[736,1501,980],{"class":794},[736,1503,343],{"class":798},[736,1505,985],{"class":794},[736,1507,343],{"class":798},[736,1509,990],{"class":794},[736,1511,343],{"class":798},[736,1513,1046],{"class":794},[736,1515,343],{"class":798},[736,1517,330],{"class":794},[736,1519,1002],{"class":798},[736,1521,1522,1524,1527,1529,1532,1534,1537],{"class":738,"line":758},[736,1523,743],{"class":742},[736,1525,1526],{"class":794}," java",[736,1528,343],{"class":798},[736,1530,1531],{"class":794},"time",[736,1533,343],{"class":798},[736,1535,1536],{"class":794},"Duration",[736,1538,1002],{"class":798},[736,1540,1541],{"class":738,"line":766},[736,1542,778],{"emptyLinePlaceholder":777},[736,1544,1545],{"class":738,"line":774},[736,1546,1343],{"class":784},[736,1548,1549,1551,1554],{"class":738,"line":781},[736,1550,1100],{"class":1099},[736,1552,1553],{"class":1103}," windowed",[736,1555,1107],{"class":798},[736,1557,1558,1560,1562,1564,1566,1568,1570,1572,1574,1576,1578],{"class":738,"line":788},[736,1559,1112],{"class":794},[736,1561,343],{"class":798},[736,1563,811],{"class":1099},[736,1565,815],{"class":794},[736,1567,1121],{"class":798},[736,1569,1124],{"class":794},[736,1571,1121],{"class":798},[736,1573,1129],{"class":794},[736,1575,1132],{"class":1099},[736,1577,1135],{"class":746},[736,1579,1580],{"class":798},"(\n",[736,1582,1583,1586,1588,1590,1592,1594,1597,1599,1601,1604,1606,1608,1610,1612,1615,1617,1619,1621,1623,1625],{"class":738,"line":802},[736,1584,1585],{"class":1103},"        Stores",[736,1587,343],{"class":798},[736,1589,1381],{"class":746},[736,1591,1138],{"class":798},[736,1593,1142],{"class":1141},[736,1595,1596],{"class":831},"hourly",[736,1598,1142],{"class":1141},[736,1600,1121],{"class":798},[736,1602,1603],{"class":1103}," Duration",[736,1605,343],{"class":798},[736,1607,1392],{"class":746},[736,1609,1138],{"class":798},[736,1611,1398],{"class":1397},[736,1613,1614],{"class":798},"),",[736,1616,1603],{"class":1103},[736,1618,343],{"class":798},[736,1620,1392],{"class":746},[736,1622,1138],{"class":798},[736,1624,1408],{"class":1397},[736,1626,1627],{"class":798},")));\n",[736,1629,1630],{"class":738,"line":838},[736,1631,778],{"emptyLinePlaceholder":777},[736,1633,1634],{"class":738,"line":855},[736,1635,1425],{"class":784},[736,1637,1638,1640,1643],{"class":738,"line":869},[736,1639,1100],{"class":1099},[736,1641,1642],{"class":1103}," cache",[736,1644,1107],{"class":798},[736,1646,1647,1649,1651,1653,1655,1657,1659,1661,1663,1665,1667,1669,1671,1673,1675,1677,1679,1682,1684],{"class":738,"line":874},[736,1648,1112],{"class":794},[736,1650,343],{"class":798},[736,1652,811],{"class":1099},[736,1654,815],{"class":794},[736,1656,1121],{"class":798},[736,1658,1124],{"class":794},[736,1660,1121],{"class":798},[736,1662,1129],{"class":794},[736,1664,1132],{"class":1099},[736,1666,1135],{"class":746},[736,1668,1138],{"class":798},[736,1670,326],{"class":1103},[736,1672,343],{"class":798},[736,1674,1458],{"class":746},[736,1676,1138],{"class":798},[736,1678,1142],{"class":1141},[736,1680,1681],{"class":831},"cache",[736,1683,1142],{"class":1141},[736,1685,1686],{"class":798},"));\n",[1688,1689,1691],"h3",{"id":1690},"store-type-precedence","Store type precedence",[320,1693,1694,1695,1697],{},"When more than one store source is set on a ",[324,1696,330],{},", resolution follows a fixed order (ADR-029):",[1699,1700,1701,1713,1719],"ol",{},[351,1702,1703,1706,1707,401,1710,1712],{},[324,1704,1705],{},"withStoreType(...)"," (the ",[324,1708,1709],{},"DslStoreSuppliers",[324,1711,1025],{},") — wins absolutely, and clears any explicit supplier.",[351,1714,1715,1716,343],{},"An explicit supplier passed to ",[324,1717,1718],{},"Materialized.as(supplier)",[351,1720,1721],{},"Default — RocksDB (matching Kafka Streams).",[1688,1723,1725,1727],{"id":1724},"materialized-options",[324,1726,330],{}," options",[427,1729,1730,1740],{},[430,1731,1732],{},[433,1733,1734,1737],{},[436,1735,1736],{},"Method",[436,1738,1739],{},"Effect",[445,1741,1742,1755,1765,1775,1791,1801,1818],{},[433,1743,1744,1752],{},[450,1745,1746,401,1749],{},[324,1747,1748],{},"withKeySerde(serde)",[324,1750,1751],{},"withValueSerde(serde)",[450,1753,1754],{},"Serdes for the store (and its changelog). Falls back to the configured defaults if unset.",[433,1756,1757,1762],{},[450,1758,1759],{},[324,1760,1761],{},"withStoreType(StoreType.IN_MEMORY | ROCKS_DB)",[450,1763,1764],{},"Selects store type; takes precedence over any explicit supplier.",[433,1766,1767,1772],{},[450,1768,1769],{},[324,1770,1771],{},"withRetention(duration)",[450,1773,1774],{},"Overrides retention for windowed stores. Must be at least window size + grace.",[433,1776,1777,1785],{},[450,1778,1779,401,1782],{},[324,1780,1781],{},"withCachingEnabled()",[324,1783,1784],{},"withCachingEnabled(config)",[450,1786,1787,1788,343],{},"Compacts multiple writes to the same key within a barrier interval; only the final value per key is emitted downstream via ",[324,1789,1790],{},"toStream()",[433,1792,1793,1798],{},[450,1794,1795],{},[324,1796,1797],{},"withCachingDisabled()",[450,1799,1800],{},"Emits every intermediate update downstream.",[433,1802,1803,1811],{},[450,1804,1805,401,1808],{},[324,1806,1807],{},"withLoggingEnabled()",[324,1809,1810],{},"withLoggingEnabled(topicConfig)",[450,1812,1813,1814,1817],{},"Forces the changelog topic on, optionally with custom topic config (e.g. ",[324,1815,1816],{},"retention.ms",").",[433,1819,1820,1825],{},[450,1821,1822],{},[324,1823,1824],{},"withLoggingDisabled()",[450,1826,1827,1828,1831],{},"Disables the changelog for this store — state is then only locally persisted (RocksDB) and ",[354,1829,1830],{},"cannot be recovered from Kafka"," after a crash. Use only for state you can recompute.",[493,1833,1834],{"color":495,"icon":496},[320,1835,1836,1842,1843,1845,1846,1849],{},[354,1837,1838,1839,343],{},"Caching only affects what flows ",[360,1840,1841],{},"downstream"," Whether or not caching is enabled, changelog writes are always compacted to the final value per key per barrier interval. ",[324,1844,1797],{}," is what you want when a downstream consumer needs to observe every intermediate update (as the ",[340,1847,1848],{"href":29},"word-count walkthrough"," shows — counts climbing 1, 2, 3 rather than only the final tally). When unset, caching follows the global default.",[1688,1851,1853],{"id":1852},"worked-example-a-counting-ktable","Worked example: a counting KTable",[722,1855,1856,2057],{"group":724},[726,1857,1859],{"className":728,"code":1858,"filename":730,"language":731,"meta":732,"style":732},"import io.stoatflow.core.state.StateStore\nimport io.stoatflow.core.topology.Grouped\nimport io.stoatflow.core.topology.Materialized\nimport io.stoatflow.core.topology.Named\nimport io.stoatflow.core.topology.StreamsBuilder\nimport org.apache.kafka.common.serialization.Serdes\n\nfun buildTopology(builder: StreamsBuilder) {\n    builder\n        .stream\u003CString, String>(\"words\")\n        .groupBy({ _, word -> word }, Grouped.`as`(\"group-by-word\"))\n        .count(\n            Named.`as`(\"count\"),\n            Materialized.`as`\u003CString, Long, StateStore>(\"word-counts\")\n                .withKeySerde(Serdes.String())\n                .withValueSerde(Serdes.Long()),\n        )\n}\n",[324,1860,1861,1867,1874,1880,1887,1894,1900,1904,1921,1926,1948,1973,1981,1996,2021,2034,2047,2052],{"__ignoreMap":732},[736,1862,1863,1865],{"class":738,"line":739},[736,1864,743],{"class":742},[736,1866,747],{"class":746},[736,1868,1869,1871],{"class":738,"line":750},[736,1870,743],{"class":742},[736,1872,1873],{"class":746}," io.stoatflow.core.topology.Grouped\n",[736,1875,1876,1878],{"class":738,"line":758},[736,1877,743],{"class":742},[736,1879,763],{"class":746},[736,1881,1882,1884],{"class":738,"line":766},[736,1883,743],{"class":742},[736,1885,1886],{"class":746}," io.stoatflow.core.topology.Named\n",[736,1888,1889,1891],{"class":738,"line":774},[736,1890,743],{"class":742},[736,1892,1893],{"class":746}," io.stoatflow.core.topology.StreamsBuilder\n",[736,1895,1896,1898],{"class":738,"line":781},[736,1897,743],{"class":742},[736,1899,771],{"class":746},[736,1901,1902],{"class":738,"line":788},[736,1903,778],{"emptyLinePlaceholder":777},[736,1905,1906,1909,1912,1915,1918],{"class":738,"line":802},[736,1907,1908],{"class":742},"fun",[736,1910,1911],{"class":746}," buildTopology",[736,1913,1914],{"class":794},"(builder: ",[736,1916,1917],{"class":814},"StreamsBuilder",[736,1919,1920],{"class":794},") {\n",[736,1922,1923],{"class":738,"line":838},[736,1924,1925],{"class":794},"    builder\n",[736,1927,1928,1930,1933,1935,1937,1939,1941,1943,1946],{"class":738,"line":855},[736,1929,841],{"class":794},[736,1931,1932],{"class":746},"stream",[736,1934,811],{"class":794},[736,1936,815],{"class":814},[736,1938,367],{"class":794},[736,1940,815],{"class":814},[736,1942,828],{"class":794},[736,1944,1945],{"class":831},"\"words\"",[736,1947,835],{"class":794},[736,1949,1950,1952,1955,1958,1961,1964,1966,1968,1971],{"class":738,"line":869},[736,1951,841],{"class":794},[736,1953,1954],{"class":746},"groupBy",[736,1956,1957],{"class":794},"({ _, word ",[736,1959,1960],{"class":798},"->",[736,1962,1963],{"class":794}," word }, Grouped.",[736,1965,808],{"class":746},[736,1967,1138],{"class":794},[736,1969,1970],{"class":831},"\"group-by-word\"",[736,1972,1466],{"class":794},[736,1974,1975,1977,1979],{"class":738,"line":874},[736,1976,841],{"class":794},[736,1978,381],{"class":746},[736,1980,1580],{"class":794},[736,1982,1983,1986,1988,1990,1993],{"class":738,"line":880},[736,1984,1985],{"class":794},"            Named.",[736,1987,808],{"class":746},[736,1989,1138],{"class":794},[736,1991,1992],{"class":831},"\"count\"",[736,1994,1995],{"class":794},"),\n",[736,1997,1998,2001,2003,2005,2007,2009,2011,2013,2015,2017,2019],{"class":738,"line":890},[736,1999,2000],{"class":794},"            Materialized.",[736,2002,808],{"class":746},[736,2004,811],{"class":794},[736,2006,815],{"class":814},[736,2008,367],{"class":794},[736,2010,820],{"class":814},[736,2012,367],{"class":794},[736,2014,825],{"class":814},[736,2016,828],{"class":794},[736,2018,832],{"class":831},[736,2020,835],{"class":794},[736,2022,2023,2026,2028,2030,2032],{"class":738,"line":916},[736,2024,2025],{"class":794},"                .",[736,2027,844],{"class":746},[736,2029,847],{"class":794},[736,2031,815],{"class":746},[736,2033,852],{"class":794},[736,2035,2036,2038,2040,2042,2044],{"class":738,"line":926},[736,2037,2025],{"class":794},[736,2039,860],{"class":746},[736,2041,847],{"class":794},[736,2043,820],{"class":746},[736,2045,2046],{"class":794},"()),\n",[736,2048,2049],{"class":738,"line":931},[736,2050,2051],{"class":794},"        )\n",[736,2053,2054],{"class":738,"line":937},[736,2055,2056],{"class":794},"}\n",[726,2058,2060],{"className":968,"code":2059,"filename":970,"language":971,"meta":732,"style":732},"import io.stoatflow.core.state.StateStore;\nimport io.stoatflow.core.topology.Grouped;\nimport io.stoatflow.core.topology.Materialized;\nimport io.stoatflow.core.topology.Named;\nimport io.stoatflow.core.topology.StreamsBuilder;\nimport org.apache.kafka.common.serialization.Serdes;\n\nstatic void buildTopology(StreamsBuilder builder) {\n    builder\n        .\u003CString, String>stream(\"words\")\n        .groupBy((key, word) -> word, Grouped.as(\"group-by-word\"))\n        .count(\n            Named.as(\"count\"),\n            Materialized.\u003CString, Long, StateStore>as(\"word-counts\")\n                .withKeySerde(Serdes.String())\n                .withValueSerde(Serdes.Long()));\n}\n",[324,2061,2062,2086,2111,2135,2160,2184,2212,2216,2237,2241,2269,2313,2321,2340,2373,2389,2406],{"__ignoreMap":732},[736,2063,2064,2066,2068,2070,2072,2074,2076,2078,2080,2082,2084],{"class":738,"line":739},[736,2065,743],{"class":742},[736,2067,980],{"class":794},[736,2069,343],{"class":798},[736,2071,985],{"class":794},[736,2073,343],{"class":798},[736,2075,990],{"class":794},[736,2077,343],{"class":798},[736,2079,995],{"class":794},[736,2081,343],{"class":798},[736,2083,825],{"class":794},[736,2085,1002],{"class":798},[736,2087,2088,2090,2092,2094,2096,2098,2100,2102,2104,2106,2109],{"class":738,"line":750},[736,2089,743],{"class":742},[736,2091,980],{"class":794},[736,2093,343],{"class":798},[736,2095,985],{"class":794},[736,2097,343],{"class":798},[736,2099,990],{"class":794},[736,2101,343],{"class":798},[736,2103,1046],{"class":794},[736,2105,343],{"class":798},[736,2107,2108],{"class":794},"Grouped",[736,2110,1002],{"class":798},[736,2112,2113,2115,2117,2119,2121,2123,2125,2127,2129,2131,2133],{"class":738,"line":758},[736,2114,743],{"class":742},[736,2116,980],{"class":794},[736,2118,343],{"class":798},[736,2120,985],{"class":794},[736,2122,343],{"class":798},[736,2124,990],{"class":794},[736,2126,343],{"class":798},[736,2128,1046],{"class":794},[736,2130,343],{"class":798},[736,2132,330],{"class":794},[736,2134,1002],{"class":798},[736,2136,2137,2139,2141,2143,2145,2147,2149,2151,2153,2155,2158],{"class":738,"line":766},[736,2138,743],{"class":742},[736,2140,980],{"class":794},[736,2142,343],{"class":798},[736,2144,985],{"class":794},[736,2146,343],{"class":798},[736,2148,990],{"class":794},[736,2150,343],{"class":798},[736,2152,1046],{"class":794},[736,2154,343],{"class":798},[736,2156,2157],{"class":794},"Named",[736,2159,1002],{"class":798},[736,2161,2162,2164,2166,2168,2170,2172,2174,2176,2178,2180,2182],{"class":738,"line":774},[736,2163,743],{"class":742},[736,2165,980],{"class":794},[736,2167,343],{"class":798},[736,2169,985],{"class":794},[736,2171,343],{"class":798},[736,2173,990],{"class":794},[736,2175,343],{"class":798},[736,2177,1046],{"class":794},[736,2179,343],{"class":798},[736,2181,1917],{"class":794},[736,2183,1002],{"class":798},[736,2185,2186,2188,2190,2192,2194,2196,2198,2200,2202,2204,2206,2208,2210],{"class":738,"line":781},[736,2187,743],{"class":742},[736,2189,1059],{"class":794},[736,2191,343],{"class":798},[736,2193,1064],{"class":794},[736,2195,343],{"class":798},[736,2197,1069],{"class":794},[736,2199,343],{"class":798},[736,2201,1074],{"class":794},[736,2203,343],{"class":798},[736,2205,1079],{"class":794},[736,2207,343],{"class":798},[736,2209,1084],{"class":794},[736,2211,1002],{"class":798},[736,2213,2214],{"class":738,"line":788},[736,2215,778],{"emptyLinePlaceholder":777},[736,2217,2218,2221,2224,2226,2228,2231,2234],{"class":738,"line":802},[736,2219,2220],{"class":1099},"static",[736,2222,2223],{"class":1099}," void",[736,2225,1911],{"class":746},[736,2227,1138],{"class":798},[736,2229,2230],{"class":794},"StreamsBuilder builder",[736,2232,2233],{"class":798},")",[736,2235,2236],{"class":798}," {\n",[736,2238,2239],{"class":738,"line":838},[736,2240,1925],{"class":794},[736,2242,2243,2245,2247,2249,2251,2254,2256,2258,2260,2262,2265,2267],{"class":738,"line":855},[736,2244,841],{"class":798},[736,2246,811],{"class":1099},[736,2248,815],{"class":794},[736,2250,1121],{"class":798},[736,2252,2253],{"class":794}," String",[736,2255,1132],{"class":1099},[736,2257,1932],{"class":746},[736,2259,1138],{"class":798},[736,2261,1142],{"class":1141},[736,2263,2264],{"class":831},"words",[736,2266,1142],{"class":1141},[736,2268,835],{"class":798},[736,2270,2271,2273,2275,2278,2281,2283,2286,2288,2291,2293,2295,2298,2300,2302,2304,2306,2309,2311],{"class":738,"line":869},[736,2272,841],{"class":798},[736,2274,1954],{"class":746},[736,2276,2277],{"class":798},"((",[736,2279,2280],{"class":794},"key",[736,2282,1121],{"class":798},[736,2284,2285],{"class":794}," word",[736,2287,2233],{"class":798},[736,2289,2290],{"class":798}," ->",[736,2292,2285],{"class":794},[736,2294,1121],{"class":798},[736,2296,2297],{"class":1103}," Grouped",[736,2299,343],{"class":798},[736,2301,1135],{"class":746},[736,2303,1138],{"class":798},[736,2305,1142],{"class":1141},[736,2307,2308],{"class":831},"group-by-word",[736,2310,1142],{"class":1141},[736,2312,1466],{"class":798},[736,2314,2315,2317,2319],{"class":738,"line":874},[736,2316,841],{"class":798},[736,2318,381],{"class":746},[736,2320,1580],{"class":798},[736,2322,2323,2326,2328,2330,2332,2334,2336,2338],{"class":738,"line":880},[736,2324,2325],{"class":1103},"            Named",[736,2327,343],{"class":798},[736,2329,1135],{"class":746},[736,2331,1138],{"class":798},[736,2333,1142],{"class":1141},[736,2335,381],{"class":831},[736,2337,1142],{"class":1141},[736,2339,1995],{"class":798},[736,2341,2342,2345,2347,2349,2351,2353,2355,2357,2359,2361,2363,2365,2367,2369,2371],{"class":738,"line":890},[736,2343,2344],{"class":794},"            Materialized",[736,2346,343],{"class":798},[736,2348,811],{"class":1099},[736,2350,815],{"class":794},[736,2352,1121],{"class":798},[736,2354,1124],{"class":794},[736,2356,1121],{"class":798},[736,2358,1129],{"class":794},[736,2360,1132],{"class":1099},[736,2362,1135],{"class":746},[736,2364,1138],{"class":798},[736,2366,1142],{"class":1141},[736,2368,1145],{"class":831},[736,2370,1142],{"class":1141},[736,2372,835],{"class":798},[736,2374,2375,2377,2379,2381,2383,2385,2387],{"class":738,"line":916},[736,2376,2025],{"class":798},[736,2378,844],{"class":746},[736,2380,1138],{"class":798},[736,2382,1084],{"class":1103},[736,2384,343],{"class":798},[736,2386,815],{"class":746},[736,2388,852],{"class":798},[736,2390,2391,2393,2395,2397,2399,2401,2403],{"class":738,"line":926},[736,2392,2025],{"class":798},[736,2394,860],{"class":746},[736,2396,1138],{"class":798},[736,2398,1084],{"class":1103},[736,2400,343],{"class":798},[736,2402,820],{"class":746},[736,2404,2405],{"class":798},"()));\n",[736,2407,2408],{"class":738,"line":931},[736,2409,2056],{"class":798},[419,2411,2413],{"id":2412},"attaching-a-store-to-a-custom-processor","Attaching a store to a custom Processor",[320,2415,2416,2417,2419,2420,2423,2424,2427,2428,2431,2432,401,2435,401,2438,2441],{},"For the Processor API you create a store builder yourself and register it on the ",[324,2418,1917],{}," with ",[324,2421,2422],{},"addStateStore(...)",", then look it up by name inside the processor via ",[324,2425,2426],{},"context.getStateStore(name)",". The builder comes from ",[324,2429,2430],{},"Stores.keyValueStoreBuilder(supplier, keySerde, valueSerde)"," (and the ",[324,2433,2434],{},"windowStoreBuilder",[324,2436,2437],{},"sessionStoreBuilder",[324,2439,2440],{},"versionedKeyValueStoreBuilder"," equivalents).",[722,2443,2444,2858],{"group":724},[726,2445,2447],{"className":728,"code":2446,"filename":730,"language":731,"meta":732,"style":732},"import io.stoatflow.core.processor.Processor\nimport io.stoatflow.core.processor.ProcessorContext\nimport io.stoatflow.core.processor.Record\nimport io.stoatflow.core.state.KeyValueStore\nimport io.stoatflow.core.state.Stores\nimport io.stoatflow.core.topology.StreamsBuilder\nimport org.apache.kafka.common.serialization.Serdes\n\nfun buildTopology(builder: StreamsBuilder) {\n    builder.addStateStore(\n        Stores.keyValueStoreBuilder(\n            Stores.persistentKeyValueStore(\"seen-counts\"),\n            Serdes.String(),\n            Serdes.Long(),\n        ),\n    )\n\n    builder\n        .stream\u003CString, String>(\"events\")\n        .process({ CountingProcessor(\"seen-counts\") })\n}\n\nclass CountingProcessor(\n    private val storeName: String,\n) : Processor\u003CString, String, String, Long> {\n    private lateinit var store: KeyValueStore\u003CString, Long>\n\n    override fun init(context: ProcessorContext\u003CString, Long>) {\n        store = context.getStateStore(storeName)\n    }\n\n    override fun process(record: Record\u003CString, String>) {\n        val next = (store.get(record.key) ?: 0L) + 1\n        store.put(record.key, next)\n    }\n}\n",[324,2448,2449,2456,2463,2470,2477,2483,2489,2495,2499,2511,2521,2530,2545,2555,2563,2568,2572,2576,2580,2602,2623,2628,2633,2644,2661,2688,2716,2721,2750,2767,2773,2778,2804,2836,2848,2853],{"__ignoreMap":732},[736,2450,2451,2453],{"class":738,"line":739},[736,2452,743],{"class":742},[736,2454,2455],{"class":746}," io.stoatflow.core.processor.Processor\n",[736,2457,2458,2460],{"class":738,"line":750},[736,2459,743],{"class":742},[736,2461,2462],{"class":746}," io.stoatflow.core.processor.ProcessorContext\n",[736,2464,2465,2467],{"class":738,"line":758},[736,2466,743],{"class":742},[736,2468,2469],{"class":746}," io.stoatflow.core.processor.Record\n",[736,2471,2472,2474],{"class":738,"line":766},[736,2473,743],{"class":742},[736,2475,2476],{"class":746}," io.stoatflow.core.state.KeyValueStore\n",[736,2478,2479,2481],{"class":738,"line":774},[736,2480,743],{"class":742},[736,2482,1321],{"class":746},[736,2484,2485,2487],{"class":738,"line":781},[736,2486,743],{"class":742},[736,2488,1893],{"class":746},[736,2490,2491,2493],{"class":738,"line":788},[736,2492,743],{"class":742},[736,2494,771],{"class":746},[736,2496,2497],{"class":738,"line":802},[736,2498,778],{"emptyLinePlaceholder":777},[736,2500,2501,2503,2505,2507,2509],{"class":738,"line":838},[736,2502,1908],{"class":742},[736,2504,1911],{"class":746},[736,2506,1914],{"class":794},[736,2508,1917],{"class":814},[736,2510,1920],{"class":794},[736,2512,2513,2516,2519],{"class":738,"line":855},[736,2514,2515],{"class":794},"    builder.",[736,2517,2518],{"class":746},"addStateStore",[736,2520,1580],{"class":794},[736,2522,2523,2525,2528],{"class":738,"line":869},[736,2524,1378],{"class":794},[736,2526,2527],{"class":746},"keyValueStoreBuilder",[736,2529,1580],{"class":794},[736,2531,2532,2535,2538,2540,2543],{"class":738,"line":874},[736,2533,2534],{"class":794},"            Stores.",[736,2536,2537],{"class":746},"persistentKeyValueStore",[736,2539,1138],{"class":794},[736,2541,2542],{"class":831},"\"seen-counts\"",[736,2544,1995],{"class":794},[736,2546,2547,2550,2552],{"class":738,"line":880},[736,2548,2549],{"class":794},"            Serdes.",[736,2551,815],{"class":746},[736,2553,2554],{"class":794},"(),\n",[736,2556,2557,2559,2561],{"class":738,"line":890},[736,2558,2549],{"class":794},[736,2560,820],{"class":746},[736,2562,2554],{"class":794},[736,2564,2565],{"class":738,"line":916},[736,2566,2567],{"class":794},"        ),\n",[736,2569,2570],{"class":738,"line":926},[736,2571,1416],{"class":794},[736,2573,2574],{"class":738,"line":931},[736,2575,778],{"emptyLinePlaceholder":777},[736,2577,2578],{"class":738,"line":937},[736,2579,1925],{"class":794},[736,2581,2583,2585,2587,2589,2591,2593,2595,2597,2600],{"class":738,"line":2582},19,[736,2584,841],{"class":794},[736,2586,1932],{"class":746},[736,2588,811],{"class":794},[736,2590,815],{"class":814},[736,2592,367],{"class":794},[736,2594,815],{"class":814},[736,2596,828],{"class":794},[736,2598,2599],{"class":831},"\"events\"",[736,2601,835],{"class":794},[736,2603,2605,2607,2610,2613,2616,2618,2620],{"class":738,"line":2604},20,[736,2606,841],{"class":794},[736,2608,2609],{"class":746},"process",[736,2611,2612],{"class":794},"({ ",[736,2614,2615],{"class":746},"CountingProcessor",[736,2617,1138],{"class":794},[736,2619,2542],{"class":831},[736,2621,2622],{"class":794},") })\n",[736,2624,2626],{"class":738,"line":2625},21,[736,2627,2056],{"class":794},[736,2629,2631],{"class":738,"line":2630},22,[736,2632,778],{"emptyLinePlaceholder":777},[736,2634,2636,2639,2642],{"class":738,"line":2635},23,[736,2637,2638],{"class":742},"class",[736,2640,2641],{"class":814}," CountingProcessor",[736,2643,1580],{"class":794},[736,2645,2647,2650,2653,2656,2658],{"class":738,"line":2646},24,[736,2648,2649],{"class":1099},"    private",[736,2651,2652],{"class":742}," val",[736,2654,2655],{"class":794}," storeName: ",[736,2657,815],{"class":814},[736,2659,2660],{"class":794},",\n",[736,2662,2664,2667,2669,2671,2673,2675,2677,2679,2681,2683,2685],{"class":738,"line":2663},25,[736,2665,2666],{"class":794},") : ",[736,2668,334],{"class":814},[736,2670,811],{"class":794},[736,2672,815],{"class":814},[736,2674,367],{"class":794},[736,2676,815],{"class":814},[736,2678,367],{"class":794},[736,2680,815],{"class":814},[736,2682,367],{"class":794},[736,2684,820],{"class":814},[736,2686,2687],{"class":794},"> {\n",[736,2689,2691,2693,2696,2699,2702,2705,2707,2709,2711,2713],{"class":738,"line":2690},26,[736,2692,2649],{"class":1099},[736,2694,2695],{"class":1099}," lateinit",[736,2697,2698],{"class":742}," var",[736,2700,2701],{"class":794}," store: ",[736,2703,2704],{"class":814},"KeyValueStore",[736,2706,811],{"class":794},[736,2708,815],{"class":814},[736,2710,367],{"class":794},[736,2712,820],{"class":814},[736,2714,2715],{"class":794},">\n",[736,2717,2719],{"class":738,"line":2718},27,[736,2720,778],{"emptyLinePlaceholder":777},[736,2722,2724,2727,2730,2733,2736,2739,2741,2743,2745,2747],{"class":738,"line":2723},28,[736,2725,2726],{"class":1099},"    override",[736,2728,2729],{"class":742}," fun",[736,2731,2732],{"class":746}," init",[736,2734,2735],{"class":794},"(context: ",[736,2737,2738],{"class":814},"ProcessorContext",[736,2740,811],{"class":794},[736,2742,815],{"class":814},[736,2744,367],{"class":794},[736,2746,820],{"class":814},[736,2748,2749],{"class":794},">) {\n",[736,2751,2753,2756,2758,2761,2764],{"class":738,"line":2752},29,[736,2754,2755],{"class":794},"        store ",[736,2757,945],{"class":798},[736,2759,2760],{"class":794}," context.",[736,2762,2763],{"class":746},"getStateStore",[736,2765,2766],{"class":794},"(storeName)\n",[736,2768,2770],{"class":738,"line":2769},30,[736,2771,2772],{"class":794},"    }\n",[736,2774,2776],{"class":738,"line":2775},31,[736,2777,778],{"emptyLinePlaceholder":777},[736,2779,2781,2783,2785,2788,2791,2794,2796,2798,2800,2802],{"class":738,"line":2780},32,[736,2782,2726],{"class":1099},[736,2784,2729],{"class":742},[736,2786,2787],{"class":746}," process",[736,2789,2790],{"class":794},"(record: ",[736,2792,2793],{"class":814},"Record",[736,2795,811],{"class":794},[736,2797,815],{"class":814},[736,2799,367],{"class":794},[736,2801,815],{"class":814},[736,2803,2749],{"class":794},[736,2805,2807,2810,2813,2815,2818,2821,2824,2827,2830,2833],{"class":738,"line":2806},33,[736,2808,2809],{"class":742},"        val",[736,2811,2812],{"class":794}," next ",[736,2814,945],{"class":798},[736,2816,2817],{"class":794}," (store.",[736,2819,2820],{"class":746},"get",[736,2822,2823],{"class":794},"(record.key) ?: ",[736,2825,2826],{"class":1397},"0L",[736,2828,2829],{"class":794},") ",[736,2831,2832],{"class":1099},"+",[736,2834,2835],{"class":1397}," 1\n",[736,2837,2839,2842,2845],{"class":738,"line":2838},34,[736,2840,2841],{"class":794},"        store.",[736,2843,2844],{"class":746},"put",[736,2846,2847],{"class":794},"(record.key, next)\n",[736,2849,2851],{"class":738,"line":2850},35,[736,2852,2772],{"class":794},[736,2854,2856],{"class":738,"line":2855},36,[736,2857,2056],{"class":794},[726,2859,2861],{"className":968,"code":2860,"filename":970,"language":971,"meta":732,"style":732},"import io.stoatflow.core.processor.Processor;\nimport io.stoatflow.core.processor.ProcessorContext;\nimport io.stoatflow.core.processor.Record;\nimport io.stoatflow.core.state.KeyValueStore;\nimport io.stoatflow.core.state.Stores;\nimport io.stoatflow.core.topology.StreamsBuilder;\nimport org.apache.kafka.common.serialization.Serdes;\n\nstatic void buildTopology(StreamsBuilder builder) {\n    builder.addStateStore(\n        Stores.keyValueStoreBuilder(\n            Stores.persistentKeyValueStore(\"seen-counts\"),\n            Serdes.String(),\n            Serdes.Long()));\n\n    builder\n        .\u003CString, String>stream(\"events\")\n        .process(() -> new CountingProcessor(\"seen-counts\"));\n}\n\nclass CountingProcessor implements Processor\u003CString, String, String, Long> {\n    private final String storeName;\n    private KeyValueStore\u003CString, Long> store;\n\n    CountingProcessor(String storeName) {\n        this.storeName = storeName;\n    }\n\n    @Override\n    public void init(ProcessorContext\u003CString, Long> context) {\n        store = context.getStateStore(storeName);\n    }\n\n    @Override\n    public void process(Record\u003CString, String> record) {\n        long next = (store.get(record.key()) == null ? 0L : store.get(record.key())) + 1;\n        store.put(record.key(), next);\n    }\n}\n",[324,2862,2863,2888,2912,2936,2960,2984,3008,3036,3040,3056,3067,3077,3097,3108,3118,3122,3126,3153,3179,3183,3187,3219,3233,3255,3259,3276,3292,3296,3300,3308,3338,3356,3360,3364,3370,3399,3470,3495,3500],{"__ignoreMap":732},[736,2864,2865,2867,2869,2871,2873,2875,2877,2879,2882,2884,2886],{"class":738,"line":739},[736,2866,743],{"class":742},[736,2868,980],{"class":794},[736,2870,343],{"class":798},[736,2872,985],{"class":794},[736,2874,343],{"class":798},[736,2876,990],{"class":794},[736,2878,343],{"class":798},[736,2880,2881],{"class":794},"processor",[736,2883,343],{"class":798},[736,2885,334],{"class":794},[736,2887,1002],{"class":798},[736,2889,2890,2892,2894,2896,2898,2900,2902,2904,2906,2908,2910],{"class":738,"line":750},[736,2891,743],{"class":742},[736,2893,980],{"class":794},[736,2895,343],{"class":798},[736,2897,985],{"class":794},[736,2899,343],{"class":798},[736,2901,990],{"class":794},[736,2903,343],{"class":798},[736,2905,2881],{"class":794},[736,2907,343],{"class":798},[736,2909,2738],{"class":794},[736,2911,1002],{"class":798},[736,2913,2914,2916,2918,2920,2922,2924,2926,2928,2930,2932,2934],{"class":738,"line":758},[736,2915,743],{"class":742},[736,2917,980],{"class":794},[736,2919,343],{"class":798},[736,2921,985],{"class":794},[736,2923,343],{"class":798},[736,2925,990],{"class":794},[736,2927,343],{"class":798},[736,2929,2881],{"class":794},[736,2931,343],{"class":798},[736,2933,2793],{"class":794},[736,2935,1002],{"class":798},[736,2937,2938,2940,2942,2944,2946,2948,2950,2952,2954,2956,2958],{"class":738,"line":766},[736,2939,743],{"class":742},[736,2941,980],{"class":794},[736,2943,343],{"class":798},[736,2945,985],{"class":794},[736,2947,343],{"class":798},[736,2949,990],{"class":794},[736,2951,343],{"class":798},[736,2953,995],{"class":794},[736,2955,343],{"class":798},[736,2957,2704],{"class":794},[736,2959,1002],{"class":798},[736,2961,2962,2964,2966,2968,2970,2972,2974,2976,2978,2980,2982],{"class":738,"line":774},[736,2963,743],{"class":742},[736,2965,980],{"class":794},[736,2967,343],{"class":798},[736,2969,985],{"class":794},[736,2971,343],{"class":798},[736,2973,990],{"class":794},[736,2975,343],{"class":798},[736,2977,995],{"class":794},[736,2979,343],{"class":798},[736,2981,326],{"class":794},[736,2983,1002],{"class":798},[736,2985,2986,2988,2990,2992,2994,2996,2998,3000,3002,3004,3006],{"class":738,"line":781},[736,2987,743],{"class":742},[736,2989,980],{"class":794},[736,2991,343],{"class":798},[736,2993,985],{"class":794},[736,2995,343],{"class":798},[736,2997,990],{"class":794},[736,2999,343],{"class":798},[736,3001,1046],{"class":794},[736,3003,343],{"class":798},[736,3005,1917],{"class":794},[736,3007,1002],{"class":798},[736,3009,3010,3012,3014,3016,3018,3020,3022,3024,3026,3028,3030,3032,3034],{"class":738,"line":788},[736,3011,743],{"class":742},[736,3013,1059],{"class":794},[736,3015,343],{"class":798},[736,3017,1064],{"class":794},[736,3019,343],{"class":798},[736,3021,1069],{"class":794},[736,3023,343],{"class":798},[736,3025,1074],{"class":794},[736,3027,343],{"class":798},[736,3029,1079],{"class":794},[736,3031,343],{"class":798},[736,3033,1084],{"class":794},[736,3035,1002],{"class":798},[736,3037,3038],{"class":738,"line":802},[736,3039,778],{"emptyLinePlaceholder":777},[736,3041,3042,3044,3046,3048,3050,3052,3054],{"class":738,"line":838},[736,3043,2220],{"class":1099},[736,3045,2223],{"class":1099},[736,3047,1911],{"class":746},[736,3049,1138],{"class":798},[736,3051,2230],{"class":794},[736,3053,2233],{"class":798},[736,3055,2236],{"class":798},[736,3057,3058,3061,3063,3065],{"class":738,"line":855},[736,3059,3060],{"class":1103},"    builder",[736,3062,343],{"class":798},[736,3064,2518],{"class":746},[736,3066,1580],{"class":798},[736,3068,3069,3071,3073,3075],{"class":738,"line":869},[736,3070,1585],{"class":1103},[736,3072,343],{"class":798},[736,3074,2527],{"class":746},[736,3076,1580],{"class":798},[736,3078,3079,3082,3084,3086,3088,3090,3093,3095],{"class":738,"line":874},[736,3080,3081],{"class":1103},"            Stores",[736,3083,343],{"class":798},[736,3085,2537],{"class":746},[736,3087,1138],{"class":798},[736,3089,1142],{"class":1141},[736,3091,3092],{"class":831},"seen-counts",[736,3094,1142],{"class":1141},[736,3096,1995],{"class":798},[736,3098,3099,3102,3104,3106],{"class":738,"line":880},[736,3100,3101],{"class":1103},"            Serdes",[736,3103,343],{"class":798},[736,3105,815],{"class":746},[736,3107,2554],{"class":798},[736,3109,3110,3112,3114,3116],{"class":738,"line":890},[736,3111,3101],{"class":1103},[736,3113,343],{"class":798},[736,3115,820],{"class":746},[736,3117,2405],{"class":798},[736,3119,3120],{"class":738,"line":916},[736,3121,778],{"emptyLinePlaceholder":777},[736,3123,3124],{"class":738,"line":926},[736,3125,1925],{"class":794},[736,3127,3128,3130,3132,3134,3136,3138,3140,3142,3144,3146,3149,3151],{"class":738,"line":931},[736,3129,841],{"class":798},[736,3131,811],{"class":1099},[736,3133,815],{"class":794},[736,3135,1121],{"class":798},[736,3137,2253],{"class":794},[736,3139,1132],{"class":1099},[736,3141,1932],{"class":746},[736,3143,1138],{"class":798},[736,3145,1142],{"class":1141},[736,3147,3148],{"class":831},"events",[736,3150,1142],{"class":1141},[736,3152,835],{"class":798},[736,3154,3155,3157,3159,3162,3164,3167,3169,3171,3173,3175,3177],{"class":738,"line":937},[736,3156,841],{"class":798},[736,3158,2609],{"class":746},[736,3160,3161],{"class":798},"(()",[736,3163,2290],{"class":798},[736,3165,3166],{"class":742}," new",[736,3168,2641],{"class":746},[736,3170,1138],{"class":798},[736,3172,1142],{"class":1141},[736,3174,3092],{"class":831},[736,3176,1142],{"class":1141},[736,3178,1686],{"class":798},[736,3180,3181],{"class":738,"line":2582},[736,3182,2056],{"class":798},[736,3184,3185],{"class":738,"line":2604},[736,3186,778],{"emptyLinePlaceholder":777},[736,3188,3189,3191,3193,3196,3199,3201,3203,3205,3207,3209,3211,3213,3215,3217],{"class":738,"line":2625},[736,3190,2638],{"class":1099},[736,3192,2641],{"class":814},[736,3194,3195],{"class":1099}," implements",[736,3197,3198],{"class":746}," Processor",[736,3200,811],{"class":798},[736,3202,815],{"class":1099},[736,3204,1121],{"class":798},[736,3206,2253],{"class":1099},[736,3208,1121],{"class":798},[736,3210,2253],{"class":1099},[736,3212,1121],{"class":798},[736,3214,1124],{"class":1099},[736,3216,1132],{"class":798},[736,3218,2236],{"class":798},[736,3220,3221,3223,3226,3228,3231],{"class":738,"line":2630},[736,3222,2649],{"class":1099},[736,3224,3225],{"class":1099}," final",[736,3227,2253],{"class":794},[736,3229,3230],{"class":1103}," storeName",[736,3232,1002],{"class":798},[736,3234,3235,3237,3240,3242,3244,3246,3248,3250,3253],{"class":738,"line":2635},[736,3236,2649],{"class":1099},[736,3238,3239],{"class":794}," KeyValueStore",[736,3241,811],{"class":798},[736,3243,815],{"class":1099},[736,3245,1121],{"class":798},[736,3247,1124],{"class":1099},[736,3249,1132],{"class":798},[736,3251,3252],{"class":1103}," store",[736,3254,1002],{"class":798},[736,3256,3257],{"class":738,"line":2646},[736,3258,778],{"emptyLinePlaceholder":777},[736,3260,3261,3264,3266,3269,3272,3274],{"class":738,"line":2663},[736,3262,3263],{"class":746},"    CountingProcessor",[736,3265,1138],{"class":798},[736,3267,3268],{"class":794},"String ",[736,3270,3271],{"class":1103},"storeName",[736,3273,2233],{"class":798},[736,3275,2236],{"class":798},[736,3277,3278,3282,3284,3286,3288,3290],{"class":738,"line":2690},[736,3279,3281],{"class":3280},"sEi1f","        this",[736,3283,343],{"class":798},[736,3285,3271],{"class":1103},[736,3287,1268],{"class":798},[736,3289,3230],{"class":794},[736,3291,1002],{"class":798},[736,3293,3294],{"class":738,"line":2718},[736,3295,2772],{"class":798},[736,3297,3298],{"class":738,"line":2723},[736,3299,778],{"emptyLinePlaceholder":777},[736,3301,3302,3305],{"class":738,"line":2752},[736,3303,3304],{"class":798},"    @",[736,3306,3307],{"class":1099},"Override\n",[736,3309,3310,3313,3315,3317,3319,3321,3323,3325,3327,3329,3331,3334,3336],{"class":738,"line":2769},[736,3311,3312],{"class":1099},"    public",[736,3314,2223],{"class":1099},[736,3316,2732],{"class":746},[736,3318,1138],{"class":798},[736,3320,2738],{"class":794},[736,3322,811],{"class":798},[736,3324,815],{"class":1099},[736,3326,1121],{"class":798},[736,3328,1124],{"class":1099},[736,3330,1132],{"class":798},[736,3332,3333],{"class":1103}," context",[736,3335,2233],{"class":798},[736,3337,2236],{"class":798},[736,3339,3340,3342,3344,3346,3348,3350,3352,3354],{"class":738,"line":2775},[736,3341,2755],{"class":794},[736,3343,945],{"class":798},[736,3345,3333],{"class":1103},[736,3347,343],{"class":798},[736,3349,2763],{"class":746},[736,3351,1138],{"class":798},[736,3353,3271],{"class":794},[736,3355,1250],{"class":798},[736,3357,3358],{"class":738,"line":2780},[736,3359,2772],{"class":798},[736,3361,3362],{"class":738,"line":2806},[736,3363,778],{"emptyLinePlaceholder":777},[736,3365,3366,3368],{"class":738,"line":2838},[736,3367,3304],{"class":798},[736,3369,3307],{"class":1099},[736,3371,3372,3374,3376,3378,3380,3382,3384,3386,3388,3390,3392,3395,3397],{"class":738,"line":2850},[736,3373,3312],{"class":1099},[736,3375,2223],{"class":1099},[736,3377,2787],{"class":746},[736,3379,1138],{"class":798},[736,3381,2793],{"class":794},[736,3383,811],{"class":798},[736,3385,815],{"class":1099},[736,3387,1121],{"class":798},[736,3389,2253],{"class":1099},[736,3391,1132],{"class":798},[736,3393,3394],{"class":1103}," record",[736,3396,2233],{"class":798},[736,3398,2236],{"class":798},[736,3400,3401,3404,3407,3409,3411,3414,3416,3418,3420,3423,3425,3427,3430,3433,3436,3439,3442,3445,3447,3449,3451,3453,3455,3457,3459,3462,3465,3468],{"class":738,"line":2855},[736,3402,3403],{"class":1099},"        long",[736,3405,3406],{"class":1103}," next",[736,3408,1268],{"class":798},[736,3410,682],{"class":798},[736,3412,3413],{"class":1103},"store",[736,3415,343],{"class":798},[736,3417,2820],{"class":746},[736,3419,1138],{"class":798},[736,3421,3422],{"class":1103},"record",[736,3424,343],{"class":798},[736,3426,2280],{"class":746},[736,3428,3429],{"class":798},"())",[736,3431,3432],{"class":1099}," ==",[736,3434,3435],{"class":742}," null",[736,3437,3438],{"class":742}," ?",[736,3440,3441],{"class":1397}," 0L",[736,3443,3444],{"class":742}," :",[736,3446,3252],{"class":1103},[736,3448,343],{"class":798},[736,3450,2820],{"class":746},[736,3452,1138],{"class":798},[736,3454,3422],{"class":1103},[736,3456,343],{"class":798},[736,3458,2280],{"class":746},[736,3460,3461],{"class":798},"()))",[736,3463,3464],{"class":1099}," +",[736,3466,3467],{"class":1397}," 1",[736,3469,1002],{"class":798},[736,3471,3473,3476,3478,3480,3482,3484,3486,3488,3491,3493],{"class":738,"line":3472},37,[736,3474,3475],{"class":1103},"        store",[736,3477,343],{"class":798},[736,3479,2844],{"class":746},[736,3481,1138],{"class":798},[736,3483,3422],{"class":1103},[736,3485,343],{"class":798},[736,3487,2280],{"class":746},[736,3489,3490],{"class":798},"(),",[736,3492,3406],{"class":794},[736,3494,1250],{"class":798},[736,3496,3498],{"class":738,"line":3497},38,[736,3499,2772],{"class":798},[736,3501,3503],{"class":738,"line":3502},39,[736,3504,2056],{"class":798},[493,3506,3507],{"color":495,"icon":55},[320,3508,3509,3510,327,3513,3516,3517,3519],{},"Within a processor, state access is safe without any locking of your own: records with the same key always run on the same processing context in arrival order, so per-key read-modify-write is serial. The store also exposes atomic ",[324,3511,3512],{},"compute(key, fn)",[324,3514,3515],{},"merge(key, value, fn)"," for read-modify-write in a single call. See ",[340,3518,342],{"href":63}," for the full model, including the cross-key key-lock utility.",[419,3521,3523],{"id":3522},"reading-a-store-back","Reading a store back",[320,3525,3526,3527,3530,3531,542],{},"A store registered in your topology is queryable by name. The read-only views are typed via ",[324,3528,3529],{},"QueryableStoreTypes"," and selected with ",[324,3532,3533],{},"StoreQueryParameters.fromNameAndType(...)",[427,3535,3536,3550],{},[430,3537,3538],{},[433,3539,3540,3543,3547],{},[436,3541,3542],{},"Store kind",[436,3544,3545,518],{},[324,3546,3529],{},[436,3548,3549],{},"Read-only view",[445,3551,3552,3566,3580,3594,3609],{},[433,3553,3554,3556,3561],{},[450,3555,562],{},[450,3557,3558],{},[324,3559,3560],{},"keyValueStore()",[450,3562,3563],{},[324,3564,3565],{},"ReadOnlyKeyValueStore\u003CK, V>",[433,3567,3568,3570,3575],{},[450,3569,590],{},[450,3571,3572],{},[324,3573,3574],{},"windowStore()",[450,3576,3577],{},[324,3578,3579],{},"ReadOnlyWindowStore\u003CK, V>",[433,3581,3582,3584,3589],{},[450,3583,605],{},[450,3585,3586],{},[324,3587,3588],{},"sessionStore()",[450,3590,3591],{},[324,3592,3593],{},"ReadOnlySessionStore\u003CK, AGG>",[433,3595,3596,3599,3604],{},[450,3597,3598],{},"Timestamped KV",[450,3600,3601],{},[324,3602,3603],{},"timestampedKeyValueStore()",[450,3605,3606],{},[324,3607,3608],{},"ReadOnlyKeyValueStore\u003CK, ValueAndTimestamp\u003CV>>",[433,3610,3611,3614,3619],{},[450,3612,3613],{},"Timestamped window",[450,3615,3616],{},[324,3617,3618],{},"timestampedWindowStore()",[450,3620,3621],{},[324,3622,3623],{},"ReadOnlyWindowStore\u003CK, ValueAndTimestamp\u003CV>>",[320,3625,3626,3629,3630,367,3633,367,3636,367,3639,367,3642,367,3645,367,3648,3651,3652,3655],{},[324,3627,3628],{},"ReadOnlyKeyValueStore"," gives you ",[324,3631,3632],{},"get(key)",[324,3634,3635],{},"containsKey(key)",[324,3637,3638],{},"all()",[324,3640,3641],{},"reverseAll()",[324,3643,3644],{},"range(from, to)",[324,3646,3647],{},"reverseRange(from, to)",[324,3649,3650],{},"prefixScan(prefix, prefixKeySerializer)",", and ",[324,3653,3654],{},"approximateNumEntries()",". Iterators must be closed after use.",[493,3657,3658],{"color":495,"icon":496},[320,3659,3660,3661,3664,3665,3668,3669,3672,3673,3676],{},"StoatFlow's single-instance model means ",[354,3662,3663],{},"all state is globally accessible"," — there is no partition routing and no cross-instance RPC. Consequently ",[324,3666,3667],{},"StoreQueryParameters"," has no ",[324,3670,3671],{},"withPartition(...)","; a query against any key resolves locally. Use ",[324,3674,3675],{},"enableStaleStores()"," to allow reads while the application is still restoring.",[1688,3678,3680],{"id":3679},"interactive-queries-against-the-running-engine","Interactive queries against the running engine",[320,3682,3683,3684,3687,3688,3691],{},"The query entry point is ",[324,3685,3686],{},"store(...)"," on the core ",[324,3689,3690],{},"StoatFlow"," engine, which returns the requested read-only view:",[722,3693,3694,3819],{"group":724},[726,3695,3697],{"className":728,"code":3696,"filename":730,"language":731,"meta":732,"style":732},"import io.stoatflow.core.state.QueryableStoreTypes\nimport io.stoatflow.core.state.ReadOnlyKeyValueStore\nimport io.stoatflow.core.state.StoreQueryParameters\n\nval store: ReadOnlyKeyValueStore\u003CString, Long> =\n    stoatflow.store(\n        StoreQueryParameters.fromNameAndType(\n            \"word-counts\",\n            QueryableStoreTypes.keyValueStore(),\n        ),\n    )\n\nval count: Long? = store.get(\"hello\")\n",[324,3698,3699,3706,3713,3720,3724,3745,3754,3764,3771,3781,3785,3789,3793],{"__ignoreMap":732},[736,3700,3701,3703],{"class":738,"line":739},[736,3702,743],{"class":742},[736,3704,3705],{"class":746}," io.stoatflow.core.state.QueryableStoreTypes\n",[736,3707,3708,3710],{"class":738,"line":750},[736,3709,743],{"class":742},[736,3711,3712],{"class":746}," io.stoatflow.core.state.ReadOnlyKeyValueStore\n",[736,3714,3715,3717],{"class":738,"line":758},[736,3716,743],{"class":742},[736,3718,3719],{"class":746}," io.stoatflow.core.state.StoreQueryParameters\n",[736,3721,3722],{"class":738,"line":766},[736,3723,778],{"emptyLinePlaceholder":777},[736,3725,3726,3728,3730,3732,3734,3736,3738,3740,3743],{"class":738,"line":774},[736,3727,791],{"class":742},[736,3729,2701],{"class":794},[736,3731,3628],{"class":814},[736,3733,811],{"class":794},[736,3735,815],{"class":814},[736,3737,367],{"class":794},[736,3739,820],{"class":814},[736,3741,3742],{"class":794},"> ",[736,3744,799],{"class":798},[736,3746,3747,3750,3752],{"class":738,"line":781},[736,3748,3749],{"class":794},"    stoatflow.",[736,3751,3413],{"class":746},[736,3753,1580],{"class":794},[736,3755,3756,3759,3762],{"class":738,"line":788},[736,3757,3758],{"class":794},"        StoreQueryParameters.",[736,3760,3761],{"class":746},"fromNameAndType",[736,3763,1580],{"class":794},[736,3765,3766,3769],{"class":738,"line":802},[736,3767,3768],{"class":831},"            \"word-counts\"",[736,3770,2660],{"class":794},[736,3772,3773,3776,3779],{"class":738,"line":838},[736,3774,3775],{"class":794},"            QueryableStoreTypes.",[736,3777,3778],{"class":746},"keyValueStore",[736,3780,2554],{"class":794},[736,3782,3783],{"class":738,"line":855},[736,3784,2567],{"class":794},[736,3786,3787],{"class":738,"line":869},[736,3788,1416],{"class":794},[736,3790,3791],{"class":738,"line":874},[736,3792,778],{"emptyLinePlaceholder":777},[736,3794,3795,3797,3800,3802,3805,3807,3810,3812,3814,3817],{"class":738,"line":880},[736,3796,791],{"class":742},[736,3798,3799],{"class":794}," count: ",[736,3801,820],{"class":814},[736,3803,3804],{"class":794},"? ",[736,3806,945],{"class":798},[736,3808,3809],{"class":794}," store.",[736,3811,2820],{"class":746},[736,3813,1138],{"class":794},[736,3815,3816],{"class":831},"\"hello\"",[736,3818,835],{"class":794},[726,3820,3822],{"className":968,"code":3821,"filename":970,"language":971,"meta":732,"style":732},"import io.stoatflow.core.state.QueryableStoreTypes;\nimport io.stoatflow.core.state.ReadOnlyKeyValueStore;\nimport io.stoatflow.core.state.StoreQueryParameters;\n\nReadOnlyKeyValueStore\u003CString, Long> store =\n    stoatflow.store(\n        StoreQueryParameters.fromNameAndType(\n            \"word-counts\",\n            QueryableStoreTypes.keyValueStore()));\n\nLong count = store.get(\"hello\");\n",[324,3823,3824,3848,3872,3896,3900,3918,3929,3940,3951,3962,3966],{"__ignoreMap":732},[736,3825,3826,3828,3830,3832,3834,3836,3838,3840,3842,3844,3846],{"class":738,"line":739},[736,3827,743],{"class":742},[736,3829,980],{"class":794},[736,3831,343],{"class":798},[736,3833,985],{"class":794},[736,3835,343],{"class":798},[736,3837,990],{"class":794},[736,3839,343],{"class":798},[736,3841,995],{"class":794},[736,3843,343],{"class":798},[736,3845,3529],{"class":794},[736,3847,1002],{"class":798},[736,3849,3850,3852,3854,3856,3858,3860,3862,3864,3866,3868,3870],{"class":738,"line":750},[736,3851,743],{"class":742},[736,3853,980],{"class":794},[736,3855,343],{"class":798},[736,3857,985],{"class":794},[736,3859,343],{"class":798},[736,3861,990],{"class":794},[736,3863,343],{"class":798},[736,3865,995],{"class":794},[736,3867,343],{"class":798},[736,3869,3628],{"class":794},[736,3871,1002],{"class":798},[736,3873,3874,3876,3878,3880,3882,3884,3886,3888,3890,3892,3894],{"class":738,"line":758},[736,3875,743],{"class":742},[736,3877,980],{"class":794},[736,3879,343],{"class":798},[736,3881,985],{"class":794},[736,3883,343],{"class":798},[736,3885,990],{"class":794},[736,3887,343],{"class":798},[736,3889,995],{"class":794},[736,3891,343],{"class":798},[736,3893,3667],{"class":794},[736,3895,1002],{"class":798},[736,3897,3898],{"class":738,"line":766},[736,3899,778],{"emptyLinePlaceholder":777},[736,3901,3902,3904,3906,3908,3910,3912,3914,3916],{"class":738,"line":774},[736,3903,3628],{"class":794},[736,3905,811],{"class":798},[736,3907,815],{"class":1099},[736,3909,1121],{"class":798},[736,3911,1124],{"class":1099},[736,3913,1132],{"class":798},[736,3915,3252],{"class":1103},[736,3917,1107],{"class":798},[736,3919,3920,3923,3925,3927],{"class":738,"line":781},[736,3921,3922],{"class":1103},"    stoatflow",[736,3924,343],{"class":798},[736,3926,3413],{"class":746},[736,3928,1580],{"class":798},[736,3930,3931,3934,3936,3938],{"class":738,"line":788},[736,3932,3933],{"class":1103},"        StoreQueryParameters",[736,3935,343],{"class":798},[736,3937,3761],{"class":746},[736,3939,1580],{"class":798},[736,3941,3942,3945,3947,3949],{"class":738,"line":802},[736,3943,3944],{"class":1141},"            \"",[736,3946,1145],{"class":831},[736,3948,1142],{"class":1141},[736,3950,2660],{"class":798},[736,3952,3953,3956,3958,3960],{"class":738,"line":838},[736,3954,3955],{"class":1103},"            QueryableStoreTypes",[736,3957,343],{"class":798},[736,3959,3778],{"class":746},[736,3961,2405],{"class":798},[736,3963,3964],{"class":738,"line":855},[736,3965,778],{"emptyLinePlaceholder":777},[736,3967,3968,3970,3973,3975,3977,3979,3981,3983,3985,3988,3990],{"class":738,"line":869},[736,3969,820],{"class":794},[736,3971,3972],{"class":1103}," count",[736,3974,1268],{"class":798},[736,3976,3252],{"class":1103},[736,3978,343],{"class":798},[736,3980,2820],{"class":746},[736,3982,1138],{"class":798},[736,3984,1142],{"class":1141},[736,3986,3987],{"class":831},"hello",[736,3989,1142],{"class":1141},[736,3991,1250],{"class":798},[320,3993,3994,3996,3997,4000,4001,4004,4005,401,4008,4011,4012,4014,4015,4017,4018,4020,4021,4024,4025,4028],{},[324,3995,3686],{}," throws ",[324,3998,3999],{},"IllegalStateException"," unless the application is ",[324,4002,4003],{},"RUNNING"," (or ",[324,4006,4007],{},"RESTORING",[324,4009,4010],{},"VALIDATING_STATE"," when ",[324,4013,3675],{}," was set), ",[324,4016,670],{}," if the named store does not exist, and ",[324,4019,670],{}," if the store's type does not match the requested ",[324,4022,4023],{},"QueryableStoreType",". ",[324,4026,4027],{},"storeNames()"," lists every registered store name for discovery.",[320,4030,4031,327,4033,4035,4036,4038,4039,4042,4043,4046,4047,4050,4051,4053,4054,4056],{},[324,4032,3686],{},[324,4034,4027],{}," are defined on the core ",[324,4037,3690],{}," engine, so programmatic interactive queries need a handle to that engine. A ",[324,4040,4041],{},":core"," application holds it directly. The ",[324,4044,4045],{},":runtime"," wrapper (",[324,4048,4049],{},"StoatFlowRuntime.fromConfig",") currently keeps its engine instance private and exposes no public query accessor, so typed in-process interactive queries are not available from a ",[324,4052,4045],{}," deployment today — use the ",[324,4055,4041],{}," API directly if you need them.",[1688,4058,4060],{"id":4059},"reading-a-store-in-a-test","Reading a store in a test",[320,4062,4063,4064,4067,4068,4071,4072,4075,4076,401,4079,4082,4083,4086],{},"In ",[324,4065,4066],{},"TopologyTestDriver"," (the in-memory ",[340,4069,4070],{"href":106},"test driver","), read stores back directly with ",[324,4073,4074],{},"getKeyValueStore(name)"," (and ",[324,4077,4078],{},"getWindowStore",[324,4080,4081],{},"getSessionStore","). Call ",[324,4084,4085],{},"commitBarrier()"," first if the store has caching enabled, so cached emissions are flushed:",[722,4088,4089,4203],{"group":724},[726,4090,4092],{"className":728,"code":4091,"filename":730,"language":731,"meta":732,"style":732},"import io.stoatflow.testutils.TopologyTestDriver\n\nval driver = TopologyTestDriver.fromBuilder(builder)\n\u002F\u002F ... pipe input ...\ndriver.commitBarrier() \u002F\u002F flush cached writes before reading\n\nval store = driver.getKeyValueStore\u003CString, Long>(\"word-counts\")\nassertThat(store.get(\"the\")).isEqualTo(3L)\n",[324,4093,4094,4101,4105,4123,4128,4142,4146,4175],{"__ignoreMap":732},[736,4095,4096,4098],{"class":738,"line":739},[736,4097,743],{"class":742},[736,4099,4100],{"class":746}," io.stoatflow.testutils.TopologyTestDriver\n",[736,4102,4103],{"class":738,"line":750},[736,4104,778],{"emptyLinePlaceholder":777},[736,4106,4107,4109,4112,4114,4117,4120],{"class":738,"line":758},[736,4108,791],{"class":742},[736,4110,4111],{"class":794}," driver ",[736,4113,945],{"class":798},[736,4115,4116],{"class":794}," TopologyTestDriver.",[736,4118,4119],{"class":746},"fromBuilder",[736,4121,4122],{"class":794},"(builder)\n",[736,4124,4125],{"class":738,"line":766},[736,4126,4127],{"class":784},"\u002F\u002F ... pipe input ...\n",[736,4129,4130,4133,4136,4139],{"class":738,"line":774},[736,4131,4132],{"class":794},"driver.",[736,4134,4135],{"class":746},"commitBarrier",[736,4137,4138],{"class":794},"() ",[736,4140,4141],{"class":784},"\u002F\u002F flush cached writes before reading\n",[736,4143,4144],{"class":738,"line":781},[736,4145,778],{"emptyLinePlaceholder":777},[736,4147,4148,4150,4153,4155,4158,4161,4163,4165,4167,4169,4171,4173],{"class":738,"line":788},[736,4149,791],{"class":742},[736,4151,4152],{"class":794}," store ",[736,4154,945],{"class":798},[736,4156,4157],{"class":794}," driver.",[736,4159,4160],{"class":746},"getKeyValueStore",[736,4162,811],{"class":794},[736,4164,815],{"class":814},[736,4166,367],{"class":794},[736,4168,820],{"class":814},[736,4170,828],{"class":794},[736,4172,832],{"class":831},[736,4174,835],{"class":794},[736,4176,4177,4180,4183,4185,4187,4190,4193,4196,4198,4201],{"class":738,"line":802},[736,4178,4179],{"class":746},"assertThat",[736,4181,4182],{"class":794},"(store.",[736,4184,2820],{"class":746},[736,4186,1138],{"class":794},[736,4188,4189],{"class":831},"\"the\"",[736,4191,4192],{"class":794},")).",[736,4194,4195],{"class":746},"isEqualTo",[736,4197,1138],{"class":794},[736,4199,4200],{"class":1397},"3L",[736,4202,835],{"class":794},[726,4204,4206],{"className":968,"code":4205,"filename":970,"language":971,"meta":732,"style":732},"import io.stoatflow.testutils.TopologyTestDriver;\nimport io.stoatflow.core.state.KeyValueStore;\n\nvar driver = TopologyTestDriver.fromBuilder(builder);\n\u002F\u002F ... pipe input ...\ndriver.commitBarrier(); \u002F\u002F flush cached writes before reading\n\nKeyValueStore\u003CString, Long> store = driver.getKeyValueStore(\"word-counts\");\nassertThat(store.get(\"the\")).isEqualTo(3L);\n",[324,4207,4208,4229,4253,4257,4280,4284,4299,4303,4337],{"__ignoreMap":732},[736,4209,4210,4212,4214,4216,4218,4220,4223,4225,4227],{"class":738,"line":739},[736,4211,743],{"class":742},[736,4213,980],{"class":794},[736,4215,343],{"class":798},[736,4217,985],{"class":794},[736,4219,343],{"class":798},[736,4221,4222],{"class":794},"testutils",[736,4224,343],{"class":798},[736,4226,4066],{"class":794},[736,4228,1002],{"class":798},[736,4230,4231,4233,4235,4237,4239,4241,4243,4245,4247,4249,4251],{"class":738,"line":750},[736,4232,743],{"class":742},[736,4234,980],{"class":794},[736,4236,343],{"class":798},[736,4238,985],{"class":794},[736,4240,343],{"class":798},[736,4242,990],{"class":794},[736,4244,343],{"class":798},[736,4246,995],{"class":794},[736,4248,343],{"class":798},[736,4250,2704],{"class":794},[736,4252,1002],{"class":798},[736,4254,4255],{"class":738,"line":758},[736,4256,778],{"emptyLinePlaceholder":777},[736,4258,4259,4261,4264,4266,4269,4271,4273,4275,4278],{"class":738,"line":766},[736,4260,1100],{"class":1099},[736,4262,4263],{"class":1103}," driver",[736,4265,1268],{"class":798},[736,4267,4268],{"class":1103}," TopologyTestDriver",[736,4270,343],{"class":798},[736,4272,4119],{"class":746},[736,4274,1138],{"class":798},[736,4276,4277],{"class":794},"builder",[736,4279,1250],{"class":798},[736,4281,4282],{"class":738,"line":774},[736,4283,4127],{"class":784},[736,4285,4286,4289,4291,4293,4296],{"class":738,"line":781},[736,4287,4288],{"class":1103},"driver",[736,4290,343],{"class":798},[736,4292,4135],{"class":746},[736,4294,4295],{"class":798},"();",[736,4297,4298],{"class":784}," \u002F\u002F flush cached writes before reading\n",[736,4300,4301],{"class":738,"line":788},[736,4302,778],{"emptyLinePlaceholder":777},[736,4304,4305,4307,4309,4311,4313,4315,4317,4319,4321,4323,4325,4327,4329,4331,4333,4335],{"class":738,"line":802},[736,4306,2704],{"class":794},[736,4308,811],{"class":798},[736,4310,815],{"class":1099},[736,4312,1121],{"class":798},[736,4314,1124],{"class":1099},[736,4316,1132],{"class":798},[736,4318,3252],{"class":1103},[736,4320,1268],{"class":798},[736,4322,4263],{"class":1103},[736,4324,343],{"class":798},[736,4326,4160],{"class":746},[736,4328,1138],{"class":798},[736,4330,1142],{"class":1141},[736,4332,1145],{"class":831},[736,4334,1142],{"class":1141},[736,4336,1250],{"class":798},[736,4338,4339,4341,4343,4345,4347,4349,4351,4353,4356,4358,4360,4362,4364,4366],{"class":738,"line":838},[736,4340,4179],{"class":746},[736,4342,1138],{"class":798},[736,4344,3413],{"class":1103},[736,4346,343],{"class":798},[736,4348,2820],{"class":746},[736,4350,1138],{"class":798},[736,4352,1142],{"class":1141},[736,4354,4355],{"class":831},"the",[736,4357,1142],{"class":1141},[736,4359,4192],{"class":798},[736,4361,4195],{"class":746},[736,4363,1138],{"class":798},[736,4365,4200],{"class":1397},[736,4367,1250],{"class":798},[419,4369,4371],{"id":4370},"related","Related",[348,4373,4374,4379,4386,4391,4397],{},[351,4375,4376,4378],{},[340,4377,342],{"href":63}," — global state, concurrent-access correctness, durability",[351,4380,4381,327,4383,4385],{},[340,4382,120],{"href":121},[340,4384,125],{"href":126}," — operators that materialize stores",[351,4387,4388,4390],{},[340,4389,1084],{"href":146}," — the serialization the store uses for keys, values, and changelog",[351,4392,4393,4396],{},[340,4394,4395],{"href":106},"Testing"," — reading stores back from the test driver",[351,4398,4399,4401],{},[340,4400,301],{"href":302}," — store-type parity against Kafka Streams",[4403,4404,4405],"style",{},"html pre.shiki code .sbBg2, html code.shiki .sbBg2{--shiki-default:#1E754F}html pre.shiki code .sySUi, html code.shiki .sySUi{--shiki-default:#59873A}html pre.shiki code .s8zF2, html code.shiki .s8zF2{--shiki-default:#A0ADA0}html pre.shiki code .suHK_, html code.shiki .suHK_{--shiki-default:#393A34}html pre.shiki code .sYZai, html code.shiki .sYZai{--shiki-default:#999999}html pre.shiki code .sUxyF, html code.shiki .sUxyF{--shiki-default:#2E8F82}html pre.shiki code .spphp, html code.shiki .spphp{--shiki-default:#B56959}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .si04Y, html code.shiki .si04Y{--shiki-default:#AB5959}html pre.shiki code .svycV, html code.shiki .svycV{--shiki-default:#B07D48}html pre.shiki code .sSP4y, html code.shiki .sSP4y{--shiki-default:#B5695977}html pre.shiki code .s-TwI, html code.shiki .s-TwI{--shiki-default:#2F798A}html pre.shiki code .sEi1f, html code.shiki .sEi1f{--shiki-default:#A65E2B}",{"title":732,"searchDepth":750,"depth":750,"links":4407},[4408,4409,4411,4418,4419,4423],{"id":421,"depth":750,"text":422},{"id":514,"depth":750,"text":4410},"The Stores factory",{"id":700,"depth":750,"text":4412,"children":4413},"Materialized — stores behind DSL operators",[4414,4415,4417],{"id":1690,"depth":758,"text":1691},{"id":1724,"depth":758,"text":4416},"Materialized options",{"id":1852,"depth":758,"text":1853},{"id":2412,"depth":750,"text":2413},{"id":3522,"depth":750,"text":3523,"children":4420},[4421,4422],{"id":3679,"depth":758,"text":3680},{"id":4059,"depth":758,"text":4060},{"id":4370,"depth":750,"text":4371},"Use the Stores factory and Materialized to configure persistent and in-memory key-value, window, session, and versioned stores — and read them back via interactive queries.","md",{},{"icon":103},"how-to",{"title":100,"description":4424},"y4kSlNYmQUnTxYKRXA3aMJyBRZuBhWtljrR4chRRIsU",[4432,4434],{"title":95,"path":96,"stem":97,"description":4433,"icon":98,"children":-1},"Configure deserialization, processing, and production exception handlers — log-and-continue, log-and-fail, or dead-letter-queue — in code or YAML, and inspect the DLQ headers StoatFlow writes.",{"title":105,"path":106,"stem":107,"description":4435,"icon":108,"children":-1},"Unit-test a StoatFlow topology in-memory with TopologyTestDriver — pipe records, advance time and watermarks, read state stores, and drive YAML config through StoatFlowTestDriver. No broker required.",1783713357680]