|
1 |
| -== [[StateRestoreCallback]] StateRestoreCallback |
| 1 | +== [[StateRestoreCallback]] StateRestoreCallback Contract |
2 | 2 |
|
3 |
| -`StateRestoreCallback` is...FIXME |
| 3 | +`StateRestoreCallback` is the <<contract, abstraction>> of <<implementations, objects>> that can <<restore, restore>>. |
| 4 | + |
| 5 | +[[contract]] |
| 6 | +.StateRestoreCallback Contract |
| 7 | +[cols="30m,70",options="header",width="100%"] |
| 8 | +|=== |
| 9 | +| Method |
| 10 | +| Description |
| 11 | + |
| 12 | +| restore |
| 13 | +a| [[restore]] |
| 14 | + |
| 15 | +[source, java] |
| 16 | +---- |
| 17 | +void restore( |
| 18 | + byte[] key, |
| 19 | + byte[] value) |
| 20 | +---- |
| 21 | + |
| 22 | +Used exclusively when <<kafka-streams-internals-StateRestoreCallbackAdapter.adoc#, StateRestoreCallbackAdapter>> is created (_adapted_ from a <<kafka-streams-StateRestoreCallback.adoc#, StateRestoreCallback>>) |
| 23 | + |
| 24 | +|=== |
| 25 | + |
| 26 | +=== [[implementations]] Functional Interface and StateRestoreCallback's Implementations |
| 27 | + |
| 28 | +`StateRestoreCallback` is a *functional interface* in Java. |
| 29 | + |
| 30 | +https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.8[Functional interface] is an interface that has just one abstract method (aside from the methods of `java.lang.Object`), and thus represents a single function contract. |
| 31 | + |
| 32 | +In addition to the usual process of creating an interface instance by declaring and instantiating a class, instances of functional interfaces can be created with method reference expressions and lambda expressions. |
| 33 | + |
| 34 | +Because of this simplification of the Java language, `StateRestoreCallback` implementations are _usually_ anonymous classes and are defined and used in the following <<kafka-streams-StateStore.adoc#, state stores>>: |
| 35 | + |
| 36 | +* <<kafka-streams-internals-InMemoryKeyValueStore.adoc#init, InMemoryKeyValueStore>> |
| 37 | + |
| 38 | +* <<kafka-streams-internals-InMemorySessionStore.adoc#init, InMemorySessionStore>> |
| 39 | + |
| 40 | +* <<kafka-streams-internals-InMemoryTimeOrderedKeyValueBuffer.adoc#init, InMemoryTimeOrderedKeyValueBuffer>> |
| 41 | + |
| 42 | +* <<kafka-streams-internals-InMemoryWindowStore.adoc#init, InMemoryWindowStore>> |
| 43 | + |
| 44 | +* <<kafka-streams-internals-MemoryLRUCache.adoc#init, MemoryLRUCache>> |
| 45 | + |
| 46 | +The following are the regular named implementations. |
| 47 | + |
| 48 | +.StateRestoreCallbacks (Direct Implementations and Extensions Only) |
| 49 | +[cols="30,70",options="header",width="100%"] |
| 50 | +|=== |
| 51 | +| StateRestoreCallback |
| 52 | +| Description |
| 53 | + |
| 54 | +| <<kafka-streams-AbstractNotifyingRestoreCallback.adoc#, AbstractNotifyingRestoreCallback>> |
| 55 | +| [[AbstractNotifyingRestoreCallback]] |
| 56 | + |
| 57 | +| <<kafka-streams-BatchingStateRestoreCallback.adoc#, BatchingStateRestoreCallback>> |
| 58 | +| [[BatchingStateRestoreCallback]] |
| 59 | + |
| 60 | +|=== |
0 commit comments