-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use caffeine in CachedStore and adapt ManagedInternalForm for state p… #3607
base: develop
Are you sure you want to change the base?
Conversation
backend/src/main/java/com/bakdata/conquery/io/storage/xodus/stores/CachedStore.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/models/query/ManagedQuery.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/apiv1/QueryProcessor.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/io/storage/xodus/stores/CachedStore.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/io/storage/xodus/stores/XodusStore.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/models/execution/ManagedExecution.java
Outdated
Show resolved
Hide resolved
@@ -258,6 +254,9 @@ public synchronized void finish(ExecutionState executionState) { | |||
|
|||
getExecutionManager().updateState(getId(), executionState); | |||
|
|||
// Persist state of this execution | |||
metaStorage.updateExecution(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wird finish nicht immer vom execution Manager aufgerufen, so dass der das schon machen sollte?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ja schon, aber der Zustand, wann eine Execution fertig ist unterscheidet sich zwischen SQL und Distributed, so dass man es hier an einer zentralen stelle abhaken kann. Auch sind wir hier in einen synchronized Block. Den müsste man dann weiter rauszeihen.
backend/src/main/java/com/bakdata/conquery/models/query/ExecutionManager.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/models/query/ManagedQuery.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/models/query/preview/EntityPreviewForm.java
Show resolved
Hide resolved
@awildturtok Kannst du bitte nochmal drüber schauen, das Laden der Stores ist jetzt konfigurierbar, wo bei der Bucket und CBlock dennoch bei jedem Start direkt geladen werden durch den BucketManager Und ich habe den LoadStorageTask abgeändert, so dass er im ManagerNode, ShardNode und Standalone genutzt werden kann. |
# Conflicts: # backend/src/main/java/com/bakdata/conquery/commands/ManagerNode.java # backend/src/main/java/com/bakdata/conquery/models/forms/managed/ExternalExecution.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kopf raucht. Bin noch nicht durch.
backend/src/main/java/com/bakdata/conquery/commands/ManagerNode.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/commands/ManagerNode.java
Outdated
Show resolved
Hide resolved
* @implNote If you implement this method, please do it always from scratch and not using calls to super, it can be quite annoying. | ||
*/ | ||
public abstract ImmutableList<ManagedStore> getStores(); | ||
public interface ConqueryStorage extends Closeable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wo hilft es, dass das jetzt ein interface ist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dadurch konnte ich einfach den XodusStore einfach ein einen CachedStore wrappen
backend/src/main/java/com/bakdata/conquery/io/storage/NamespacedStorageImpl.java
Outdated
Show resolved
Hide resolved
@@ -385,8 +393,8 @@ public IterationStatistic forEach(StoreEntryConsumer<KEY, VALUE> consumer) { | |||
maybeFailed = allJobs.get(30, TimeUnit.SECONDS); | |||
} | |||
catch (InterruptedException e) { | |||
Thread.interrupted(); | |||
log.debug("Thread was interrupted."); | |||
boolean interrupted = Thread.interrupted(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sollten wir bei einem Interrupted nicht aufräumen und alles stoppen?
Momentan machen wir ja einfach weiter. Ich denke es wäre am einfachsten die InterruptedException in eine RuntimeException wrappen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich teste mit isInterrupted und rethrowe wenn das wirklich so ist
backend/src/main/java/com/bakdata/conquery/io/storage/xodus/stores/XodusStore.java
Show resolved
Hide resolved
@@ -53,7 +55,8 @@ public ByteIterable get(ByteIterable key) { | |||
* | |||
* @param consumer function called for-each key-value pair. | |||
*/ | |||
public void forEach(BiConsumer<ByteIterable, ByteIterable> consumer) { | |||
@Override | |||
public SerializingStore.IterationStatistic forEach(StoreEntryConsumer<ByteIterable, ByteIterable> consumer) { | |||
AtomicReference<ByteIterable> lastKey = new AtomicReference<>(); | |||
AtomicBoolean done = new AtomicBoolean(false); | |||
while (!done.get()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solltest du dann hier nicht auch den iterator verwenden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Die sind sehr auf den SerializingStore gemünzt. Dass die hier der Return sind ist leaky
backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/models/config/XodusStoreFactory.java
Show resolved
Hide resolved
...end/src/main/java/com/bakdata/conquery/models/messages/namespaces/specific/ExecuteQuery.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
das binary caching stört mich immer noch aber da wir es mit hoher Wahrscheinlichkeit nicht benutzen werden, ist es mir der diskussion nicht wert
backend/src/test/java/com/bakdata/conquery/integration/tests/FilterResolutionTest.java
Outdated
Show resolved
Hide resolved
backend/src/test/java/com/bakdata/conquery/integration/tests/FilterAutocompleteTest.java
Show resolved
Hide resolved
backend/src/test/java/com/bakdata/conquery/integration/tests/MetadataCollectionTest.java
Show resolved
Hide resolved
backend/src/test/java/com/bakdata/conquery/integration/tests/MetadataCollectionTest.java
Outdated
Show resolved
Hide resolved
@@ -71,7 +76,10 @@ public void execute(String name, TestConquery testConquery) throws Exception { | |||
|
|||
final Query query = IntegrationUtils.parseQuery(conquery, test.getRawQuery()); | |||
|
|||
final long nImports = namespace.getStorage().getAllImports().count(); | |||
final long nImports; | |||
try(Stream<Import> allImports = namespace.getStorage().getAllImports()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recherchier mal bitte ob du die streams überhaupt schließen musst, terminating operations sollten den auch schon schließen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich habe dazu diesen Kommentar gefunden: https://stackoverflow.com/a/28814024
Es ist wohl unüblich Streams aus releasebaren Resourcen auszugeben. Hier sollten wir vielleicht nochmal die StoreApi ändern.
…ersistence