Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve the handling of asynchronous tasks and the management of indexes in the database. The most important changes include refactoring the
DatabaseAsyncAbstractCallbackTask
class, adding a new classDatabaseAsyncExecuteAlone
, updating theDatabaseAsyncExecutor
andDatabaseAsyncExecutorImpl
interfaces, and modifying theTypeIndex
class to use a helper method for accessing the first underlying index.Asynchronous Task Management:
engine/src/main/java/com/arcadedb/database/async/DatabaseAsyncAbstractCallbackTask.java
: Refactored the class to accept aCountDownLatch
via a constructor, improving flexibility.engine/src/main/java/com/arcadedb/database/async/DatabaseAsyncCompletion.java
: Updated the class to use the new constructor ofDatabaseAsyncAbstractCallbackTask
.engine/src/main/java/com/arcadedb/database/async/DatabaseAsyncExecuteAlone.java
: Added a new classDatabaseAsyncExecuteAlone
that extendsDatabaseAsyncAbstractCallbackTask
to execute a callback in isolation.engine/src/main/java/com/arcadedb/database/async/DatabaseAsyncExecutor.java
: Added a methodgetThreadCount
to return the number of asynchronous threads.engine/src/main/java/com/arcadedb/database/async/DatabaseAsyncExecutorImpl.java
: Implemented thegetThreadCount
method and updated thewaitCompletion
method to useDatabaseAsyncAbstractCallbackTask
. [1] [2] [3]Index Management:
engine/src/main/java/com/arcadedb/index/TypeIndex.java
: Refactored multiple methods to use a new helper methodgetFirstUnderlyingIndex
for accessing the first underlying index, improving code readability and maintainability. [1] [2] [3] [4] [5] [6] [7]Additional Changes:
engine/src/main/java/com/arcadedb/schema/BucketIndexBuilder.java
: Modified thecreate
method to handle asynchronous tasks more effectively by usingDatabaseAsyncExecuteAlone
andCountDownLatch
. [1] [2] [3] [4] [5]