Made assignThread default with an empty implementation.

Removed empty overrides of the method.
This commit is contained in:
Nikita 2025-10-03 11:19:11 -07:00
parent bfda2319c6
commit 121e934f7b
No known key found for this signature in database
11 changed files with 10 additions and 41 deletions

View File

@ -382,10 +382,6 @@ public class IQv2IntegrationTest {
this.context = stateStoreContext; this.context = stateStoreContext;
} }
@Override
public void assignThread() {
}
@Override @Override
public void flush() { public void flush() {

View File

@ -820,10 +820,6 @@ public class VersionedKeyValueStoreIntegrationTest {
); );
} }
@Override
public void assignThread() {
}
@Override @Override
public void flush() { public void flush() {
// do nothing // do nothing

View File

@ -71,7 +71,16 @@ public interface StateStore {
*/ */
void init(final StateStoreContext stateStoreContext, final StateStore root); void init(final StateStoreContext stateStoreContext, final StateStore root);
void assignThread();
/**
* Assigns the store to a stream thread.
* <p>
* This function is called from the final stream thread,
* thus can be used to initialize resources that might require to know the running thread, e.g. metrics.
* </p>
* To access the thread use {@link Thread#currentThread()}
*/
default void assignThread() { }
/** /**
* Flush any cached data * Flush any cached data

View File

@ -98,10 +98,6 @@ public class InMemoryKeyValueStore implements KeyValueStore<Bytes, byte[]> {
this.context = stateStoreContext; this.context = stateStoreContext;
} }
@Override
public void assignThread() {
}
@Override @Override
public boolean persistent() { public boolean persistent() {
return false; return false;

View File

@ -111,10 +111,6 @@ public class MemoryLRUCache implements KeyValueStore<Bytes, byte[]> {
this.context = stateStoreContext; this.context = stateStoreContext;
} }
@Override
public void assignThread() {
}
@Override @Override
public boolean persistent() { public boolean persistent() {
return false; return false;

View File

@ -194,10 +194,6 @@ public class RocksDBTimeOrderedKeyValueBuffer<K, V> implements TimeOrderedKeyVal
} }
} }
@Override
public void assignThread() {
}
@Override @Override
public void flush() { public void flush() {
store.flush(); store.flush();

View File

@ -58,10 +58,6 @@ public class NoOpWindowStore implements ReadOnlyWindowStore, StateStore {
@Override @Override
public void init(final StateStoreContext stateStoreContext, final StateStore root) {} public void init(final StateStoreContext stateStoreContext, final StateStore root) {}
@Override
public void assignThread() {
}
@Override @Override
public void flush() { public void flush() {

View File

@ -380,10 +380,6 @@ public class ReadOnlyWindowStoreStub<K, V> implements ReadOnlyWindowStore<K, V>,
@Override @Override
public void init(final StateStoreContext stateStoreContext, final StateStore root) {} public void init(final StateStoreContext stateStoreContext, final StateStore root) {}
@Override
public void assignThread() {
}
@Override @Override
public void flush() { public void flush() {
} }

View File

@ -64,10 +64,6 @@ public class MockKeyValueStore implements KeyValueStore<Object, Object> {
closed = false; closed = false;
} }
@Override
public void assignThread() {
}
@Override @Override
public void flush() { public void flush() {
instanceLastFlushCount.set(GLOBAL_FLUSH_COUNTER.getAndIncrement()); instanceLastFlushCount.set(GLOBAL_FLUSH_COUNTER.getAndIncrement());

View File

@ -88,10 +88,6 @@ public class NoOpReadOnlyStore<K, V> implements ReadOnlyKeyValueStore<K, V>, Sta
stateStoreContext.register(root, (k, v) -> { }); stateStoreContext.register(root, (k, v) -> { });
} }
@Override
public void assignThread() {
}
@Override @Override
public void flush() { public void flush() {
flushed = true; flushed = true;

View File

@ -186,10 +186,6 @@ public class ReadOnlySessionStoreStub<K, V> implements ReadOnlySessionStore<K, V
@Override @Override
public void init(StateStoreContext stateStoreContext, StateStore root) {} public void init(StateStoreContext stateStoreContext, StateStore root) {}
@Override
public void assignThread() {
}
@Override @Override
public void flush() { public void flush() {