Skip to content

Commit 8788710

Browse files
author
Robin Duda
committed
2 parents 8b7a538 + 83dfc7e commit 8788710

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Applications currently using chili-core
134134

135135
|application|description|
136136
|---|---|
137-
|[flashcards](https://flashcardsalligator.com/)|Progressive web app for studying with flashcards.|
137+
|[flashcards](https://github.com/codingchili/flashcards-webapp)|Progressive web app for studying with flashcards.|
138138
|[ethereum-ingest](https://github.com/codingchili/ethereum-ingest)|Ethereum block/transaction import utility.|
139139
|[zapperfly-asm](https://github.com/codingchili/zapperfly-asm)|Extra simple clustered build servers.|
140140
|[chili-game-ext](https://github.com/codingchili/chili-game-ext)|2D MMORPG game in development.|

core/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ dependencies {
4040
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.9'
4141

4242
compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:7.3.0'
43-
compile 'com.googlecode.cqengine:cqengine:3.4.0'
43+
compile 'com.googlecode.cqengine:cqengine:3.5.0'
4444

4545
/* keep these in sync with cqengine, used internally. */
46-
compile 'com.esotericsoftware:reflectasm:1.11.7'
47-
compile 'com.esotericsoftware:kryo:5.0.0-RC5'
46+
compile 'com.esotericsoftware:reflectasm:1.11.9'
47+
compile 'com.esotericsoftware:kryo:5.0.0-RC6'
4848

4949
testCompile 'io.vertx:vertx-unit:3.8.0'
5050
testCompile 'junit:junit:4.12'

core/main/java/com/codingchili/core/storage/IndexedMap.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.googlecode.cqengine.IndexedCollection;
44
import com.googlecode.cqengine.attribute.*;
5+
import com.googlecode.cqengine.attribute.support.SimpleFunction;
56
import com.googlecode.cqengine.query.option.QueryOptions;
67
import com.googlecode.cqengine.resultset.ResultSet;
78
import io.vertx.core.AsyncResult;
@@ -61,24 +62,25 @@ public IndexedCollection<Value> getDatabase() {
6162
return db;
6263
}
6364

64-
@SuppressWarnings("unchecked")
6565
public Attribute<Value, String> getAttribute(String fieldName, boolean multiValue) {
6666
if (holder.attributes.containsKey(fieldName)) {
6767
return holder.attributes.get(fieldName);
6868
} else {
6969
Attribute<Value, String> attribute;
7070

7171
if (multiValue) {
72-
attribute = new MultiValueAttribute<>((Class<Value>) Generic.class, String.class, fieldName) {
72+
attribute = new MultiValueAttribute<>(context.valueClass(), String.class, fieldName) {
7373
@Override
7474
public Iterable<String> getValues(Value indexing, QueryOptions queryOptions) {
7575
return Serializer.getValueByPath(indexing, fieldName).stream()
7676
.map(item -> (item + ""))::iterator;
7777
}
7878
};
7979
} else {
80-
attribute = attribute(fieldName, (indexing) ->
81-
(Serializer.getValueByPath(indexing, fieldName).iterator().next() + ""));
80+
attribute = attribute(context.valueClass(), String.class, fieldName,
81+
(SimpleFunction<Value, String>) (indexing) ->
82+
Serializer.getValueByPath(indexing, fieldName).iterator().next() + ""
83+
);
8284
}
8385
holder.attributes.put(fieldName, attribute);
8486
return attribute;
@@ -119,14 +121,6 @@ public void setMapper(Function<Value, Value> mapper) {
119121
this.mapper = mapper;
120122
}
121123

122-
/**
123-
* when creating an index on a multivalued attribute a reflective operation is invoked.
124-
* This reflective invocation fails since Value is of generic type. To circumvent this,
125-
* a class that implements Storable, which is the common interface with Value is used.
126-
*/
127-
private abstract class Generic implements Storable {
128-
}
129-
130124
@Override
131125
public void get(String key, Handler<AsyncResult<Value>> handler) {
132126
context.blocking(blocking -> {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)