Class KafkaStoreReaderThread<K,V>
java.lang.Object
java.lang.Thread
io.confluent.kafka.schemaregistry.utils.ShutdownableThread
io.confluent.kafka.schemaregistry.storage.KafkaStoreReaderThread<K,V>
- All Implemented Interfaces:
Runnable
Thread that reads schema registry state from the Kafka compacted topic and modifies
the local store to be consistent.
On startup, this thread will always read from the beginning of the topic. We assume the topic will always be small, hence the startup time to read the topic won't take too long. Because the topic is always read from the beginning, the consumer never commits offsets.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class io.confluent.kafka.schemaregistry.utils.ShutdownableThread
logPrefixFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionKafkaStoreReaderThread(String bootstrapBrokers, String topic, String groupId, StoreUpdateHandler<K, V> storeUpdateHandler, Serializer<K, V> serializer, Store<K, V> localStore, org.apache.kafka.clients.producer.Producer<byte[], byte[]> producer, K noopKey, AtomicBoolean initialized, SchemaRegistryConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoWork()This method is repeatedly invoked until the thread shuts down or this method throws an exceptionvoidshutdown()voidwaitUntilOffset(long offset, long timeout, TimeUnit timeUnit) Methods inherited from class io.confluent.kafka.schemaregistry.utils.ShutdownableThread
awaitShutdown, initiateShutdown, isRunning, isShutdownComplete, isShutdownInitiated, isThreadFailed, pause, runMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
KafkaStoreReaderThread
public KafkaStoreReaderThread(String bootstrapBrokers, String topic, String groupId, StoreUpdateHandler<K, V> storeUpdateHandler, Serializer<K, V> serializer, Store<K, V> localStore, org.apache.kafka.clients.producer.Producer<byte[], byte[]> producer, K noopKey, AtomicBoolean initialized, SchemaRegistryConfig config)
-
-
Method Details
-
checkpoints
-
doWork
public void doWork()Description copied from class:ShutdownableThreadThis method is repeatedly invoked until the thread shuts down or this method throws an exception- Specified by:
doWorkin classShutdownableThread
-
shutdown
public void shutdown()- Overrides:
shutdownin classShutdownableThread
-
waitUntilOffset
- Throws:
StoreException
-
getConsumerProperty
-