Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .idea/cqengine.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions code/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
###
# Eclipse
###
.classpath
.cproject
.project
.settings
/bin/

###
# IntelliJ
###
*.iml
.idea
.attach*
###
# Maven
###
target/
target.*/

###
# Maven shade plugin
###
*dependency-reduced-pom.xml

###
# Build artifacts
###
*.class
*.o
*.so
*.jar


###
# vi(m) temp files
###
*.swp
*.swo
*.swn

###
# Visual Studio
###
.vscode/

###
# Misc files
###
org.kde.konsole.desktop

###
# Open API generated files
####
*.openapi-generator
Empty file added code/README
Empty file.
31 changes: 21 additions & 10 deletions code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.cqengine</groupId>
<artifactId>cqengine</artifactId>
<version>3.5.0</version>
<version>3.5.0-OPENET-SNAPSHOT</version>
<packaging>jar</packaging>
<name>CQEngine</name>
<description>Collection Query Engine: NoSQL indexing and query engine for Java collections with ultra-low latency</description>
Expand All @@ -23,7 +23,7 @@
<url>https://github.com/npgall/${project.artifactId}.git</url>
<connection>scm:git:https://github.com/npgall/${project.artifactId}.git</connection>
<developerConnection>scm:git:git@github.com:npgall/${project.artifactId}.git</developerConnection>
<tag>3.5.0</tag>
<tag>3.5.0-OPENET</tag>
</scm>
<developers>
<developer>
Expand Down Expand Up @@ -116,16 +116,13 @@
<!--
Build a jar containing all dependencies, by copying classes from all dependency jars directly into
the main jar.

The resulting jar can be used as a library in other applications (without requiring any transitive
dependencies of its own).

If used as a library in another application, in case the other application also shares any of the
same dependencies, to avoid duplicate class issues resulting from copying dependency classes into
this jar, we relocate classes which are dependencies of this library into a new package within this
jar: com.googlecode.cqengine.lib.*. We then update the bytecode in all classes in this jar to
refer to dependency classes in their new package.

Also we configure some transformers to merge open source licences present in any of the jars.
-->
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -246,6 +243,24 @@
<version>3.25.0-GA</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.8</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.26</version>
</dependency>

<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
Expand Down Expand Up @@ -337,10 +352,8 @@
<!--
Plugin to PGP-sign all artifacts automatically when running mvn deploy,
as required for deployment to the Sonatype/Maven Central repo.

This requires GnuPG (aka GPG) to be installed and configured on the machine on which this is run,
and for the public key to be uploaded to key servers (e.g. pool.sks-keyservers.net).

See: https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven
-->
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -360,9 +373,7 @@
<plugin>
<!--
Plugin to check that all source files have the appropriate open source license header.

This will fail the build if any source files don't have the open source license header.

To actually apply the header to new source files, run: mvn license:format
-->
<groupId>com.mycila.maven-license-plugin</groupId>
Expand Down Expand Up @@ -426,4 +437,4 @@
</build>
</profile>
</profiles>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import com.googlecode.cqengine.engine.QueryEngineInternal;
import com.googlecode.cqengine.engine.CollectionQueryEngine;
import com.googlecode.cqengine.index.Index;
import com.googlecode.cqengine.index.indexOrdering.ConcurrentInvertedRadixTreesHolder;
import com.googlecode.cqengine.index.indexOrdering.IConcurrentInvertedRadixTreesHolder;
import com.googlecode.cqengine.index.support.CloseableIterator;
import com.googlecode.cqengine.index.support.CloseableRequestResources;
import com.googlecode.cqengine.metadata.MetadataEngine;
Expand All @@ -35,6 +37,7 @@

import java.util.*;

import static com.googlecode.cqengine.query.QueryFactory.in;
import static com.googlecode.cqengine.query.QueryFactory.queryOptions;
import static java.util.Collections.singleton;

Expand Down Expand Up @@ -70,6 +73,7 @@ public class ConcurrentIndexedCollection<O> implements IndexedCollection<O> {
protected final ObjectStore<O> objectStore;
protected final QueryEngineInternal<O> indexEngine;
protected final MetadataEngine<O> metadataEngine;
protected IConcurrentInvertedRadixTreesHolder indexOrderingConcurrentTreeHolder;

/**
* Creates a new {@link ConcurrentIndexedCollection} with default settings, using {@link OnHeapPersistence}.
Expand Down Expand Up @@ -135,6 +139,7 @@ public ResultSet<O> retrieve(Query<O> query) {
public ResultSet<O> retrieve(Query<O> query, QueryOptions queryOptions) {
final QueryOptions finalQueryOptions = openRequestScopeResourcesIfNecessary(queryOptions);
flagAsReadRequest(finalQueryOptions);
indexEngine.setConcurrentInvertedRadixTree(getConcurrentInvertedRadixTree());
ResultSet<O> results = indexEngine.retrieve(query, finalQueryOptions);
return new CloseableResultSet<O>(results, query, finalQueryOptions) {
@Override
Expand Down Expand Up @@ -577,4 +582,16 @@ public String toString() {
protected static void flagAsReadRequest(QueryOptions queryOptions) {
FlagsEnabled.forQueryOptions(queryOptions).add(PersistenceFlags.READ_REQUEST);
}


@Override
public void setConcurrentInvertedRadixTree(IConcurrentInvertedRadixTreesHolder singletonConcurrentTreeHolder) {
this.indexOrderingConcurrentTreeHolder = singletonConcurrentTreeHolder;
}


@Override
public IConcurrentInvertedRadixTreesHolder getConcurrentInvertedRadixTree() {
return this.indexOrderingConcurrentTreeHolder;
}
}
12 changes: 12 additions & 0 deletions code/src/main/java/com/googlecode/cqengine/IndexedCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import com.googlecode.cqengine.engine.QueryEngine;
import com.googlecode.cqengine.index.Index;
import com.googlecode.cqengine.index.indexOrdering.ConcurrentInvertedRadixTreesHolder;
import com.googlecode.cqengine.index.indexOrdering.IConcurrentInvertedRadixTreesHolder;
import com.googlecode.cqengine.metadata.MetadataEngine;
import com.googlecode.cqengine.persistence.Persistence;
import com.googlecode.cqengine.query.Query;
Expand Down Expand Up @@ -157,4 +159,14 @@ public interface IndexedCollection<O> extends Set<O>, QueryEngine<O> {
* on the distribution of attribute values in the collection.
*/
MetadataEngine<O> getMetadataEngine();



void setConcurrentInvertedRadixTree(IConcurrentInvertedRadixTreesHolder singletonConcurrentTreeHolder);



IConcurrentInvertedRadixTreesHolder getConcurrentInvertedRadixTree();

// get concurrent radix tree
}
Loading