Skip to content

Commit

Permalink
Merge pull request #553 from FgForrest/dev
Browse files Browse the repository at this point in the history
Hotfix patch
  • Loading branch information
novoj authored May 2, 2024
2 parents 22654a8 + 5fc1da6 commit 5ac0611
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h2>Zprovoznění Docker kontejneru</h2>
| __/\ V /| | || (_| | |_| | |_) |
\___| \_/ |_|\__\__,_|____/|____/

alpha build 10.1.2 (keep calm and report bugs 😉)
beta build 2024.5.4 (keep calm and report bugs 😉)
Visit us at: https://evitadb.io

Log config used: META-INF/logback.xml (original file `/evita/logback.xml` doesn't exist)
Expand Down Expand Up @@ -873,4 +873,4 @@ <h2>Kam se podíváme příště?</h2>

</article>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion documentation/user/en/get-started/query-our-dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ When this procedure is completed you should see the similar output in the consol
| __/\ V /| | || (_| | |_| | |_) |
\___| \_/ |_|\__\__,_|____/|____/
alpha build 0.8.ALPHA
beta build 2024.5.4 (keep calm and report bugs 😉)
Visit us at: https://evitadb.io
19:45:37.088 INFO i.e.s.c.DefaultCatalogPersistenceService - Catalog `evita` is being loaded and it contains:
Expand Down
2 changes: 1 addition & 1 deletion documentation/user/en/get-started/run-evitadb.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ When you start the evitaDB server you should see the following information in th
| __/\ V /| | || (_| | |_| | |_) |
\___| \_/ |_|\__\__,_|____/|____/
alpha build 0.9-SNAPSHOT (keep calm and report bugs 😉)
beta build 2024.5.4 (keep calm and report bugs 😉)
Visit us at: https://evitadb.io
Log config used: META-INF/logback.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private static class EvitaSessionProxy implements InvocationHandler {
private final EvitaSession evitaSession;
private final TracingContext tracingContext;

@Nullable
@Override
public Object invoke(Object proxy, Method method, Object[] args) {
try {
Expand Down Expand Up @@ -211,11 +212,14 @@ public Object invoke(Object proxy, Method method, Object[] args) {
// unwrap and rethrow
throw evitaInternalError;
} else {
log.error("Unexpected internal Evita error occurred: " + ex.getCause().getMessage(), targetException);
log.error(
"Unexpected internal Evita error occurred: " + ex.getCause().getMessage(),
targetException == null ? ex : targetException
);
throw new EvitaInternalError(
"Unexpected internal Evita error occurred: " + ex.getCause().getMessage(),
"Unexpected internal Evita error occurred.",
targetException
targetException == null ? ex : targetException
);
}
} catch (Throwable ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import io.evitadb.index.attribute.SortIndexChanges.ValueStartIndex;
import io.evitadb.index.bitmap.BaseBitmap;
import io.evitadb.index.bitmap.Bitmap;
import io.evitadb.index.bitmap.EmptyBitmap;
import io.evitadb.index.bool.TransactionalBoolean;
import io.evitadb.index.map.TransactionalMap;
import io.evitadb.store.model.StoragePart;
Expand Down Expand Up @@ -485,13 +486,12 @@ public <T extends Comparable<T>> Bitmap getRecordsEqualTo(@Nonnull T value) {
final Object normalizedValue = normalizer.apply(value);
@SuppressWarnings("unchecked") final TransactionalObjArray<T> theSortedRecordsValues = (TransactionalObjArray<T>) this.sortedRecordsValues;
@SuppressWarnings("unchecked") final int index = theSortedRecordsValues.indexOf((T) normalizedValue);
isTrue(
index >= 0,
"Value `" + value + "` is not present in the sort index!"
);

//noinspection unchecked
return getRecordsEqualToInternal((T) normalizedValue);
if (index >= 0) {
//noinspection unchecked
return getRecordsEqualToInternal((T) normalizedValue);
} else {
return EmptyBitmap.INSTANCE;
}
}

/**
Expand All @@ -502,12 +502,11 @@ public Bitmap getRecordsEqualTo(@Nonnull Object[] value) {
final ComparableArray normalizedValue = new ComparableArray(this.comparatorBase, (Object[]) normalizer.apply(value));
@SuppressWarnings("unchecked") final TransactionalObjArray<ComparableArray> theSortedRecordsValues = (TransactionalObjArray<ComparableArray>) this.sortedRecordsValues;
final int index = theSortedRecordsValues.indexOf(normalizedValue);
isTrue(
index >= 0,
"Value `" + Arrays.toString(value) + "` is not present in the sort index!"
);

return getRecordsEqualToInternal(normalizedValue);
if (index >= 0) {
return getRecordsEqualToInternal(normalizedValue);
} else {
return EmptyBitmap.INSTANCE;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import io.evitadb.core.EntityCollection;
import io.evitadb.core.Evita;
import io.evitadb.dataType.Predecessor;
import io.evitadb.exception.EvitaInvalidUsageException;
import io.evitadb.function.TriConsumer;
import io.evitadb.index.EntityIndex;
import io.evitadb.index.EntityIndexKey;
Expand Down Expand Up @@ -2235,7 +2234,7 @@ void shouldUpdateNonLocalizedEntityCompoundsOnChange() {
final SortIndex sortIndex = globalIndex.getSortIndex(new AttributeKey(attributeCodeEan));
assertNotNull(sortIndex);

assertThrows(EvitaInvalidUsageException.class, () -> sortIndex.getRecordsEqualTo(new Comparable<?>[]{"ABC", "123"}));
assertTrue(sortIndex.getRecordsEqualTo(new Comparable<?>[]{"ABC", "123"}).isEmpty());
assertArrayEquals(new int[]{1}, sortIndex.getRecordsEqualTo(new Comparable<?>[]{"Whatever", "578"}).getArray());
}
);
Expand Down Expand Up @@ -2369,7 +2368,7 @@ void shouldUpdateLocalizedEntityCompoundsOnChange() {
final SortIndex sortIndex = globalIndex.getSortIndex(new AttributeKey(attributeCodeEan, Locale.CANADA));
assertNotNull(sortIndex);

assertThrows(EvitaInvalidUsageException.class, () -> sortIndex.getRecordsEqualTo(new Comparable<?>[]{"ABC", "123"}));
assertTrue(sortIndex.getRecordsEqualTo(new Comparable<?>[]{"ABC", "123"}).isEmpty());
assertArrayEquals(new int[]{1}, sortIndex.getRecordsEqualTo(new Comparable<?>[]{"Whatever", "578"}).getArray());
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.evitadb.api.requestResponse.data.AttributesContract.AttributeKey;
import io.evitadb.api.requestResponse.schema.OrderBehaviour;
import io.evitadb.core.query.sort.SortedRecordsSupplierFactory.SortedRecordsProvider;
import io.evitadb.exception.EvitaInvalidUsageException;
import io.evitadb.index.attribute.SortIndex.ComparableArray;
import io.evitadb.index.attribute.SortIndex.ComparatorSource;
import io.evitadb.index.bitmap.BaseBitmap;
Expand Down Expand Up @@ -109,7 +108,7 @@ void shouldReturnCorrectBitmapForCardinalityOne() {
void shouldReturnCorrectBitmapForCardinalityOneAndCompoundIndex() {
final SortIndex sortIndex = createCompoundIndexWithBaseCardinalities();
assertEquals(new BaseBitmap(9), sortIndex.getRecordsEqualTo(new Object[]{"E", null}));
assertThrows(EvitaInvalidUsageException.class, () -> sortIndex.getRecordsEqualTo(new Object[]{"E", 1}));
assertTrue(sortIndex.getRecordsEqualTo(new Object[]{"E", 1}).isEmpty());
}

@Test
Expand Down Expand Up @@ -370,4 +369,4 @@ public int compareTo(ValueRecord o) {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ _____ _(_) |_ __ _| _ \\| __ )\s
\\___| \\_/ |_|\\__\\__,_|____/|____/\s\n\n""",
ConsoleColor.DARK_GREEN
);
ConsoleWriter.write("alpha build %s (keep calm and report bugs 😉)", new Object[]{VersionUtils.readVersion()}, ConsoleColor.LIGHT_GRAY);
ConsoleWriter.write("beta build %s (keep calm and report bugs 😉)", new Object[]{VersionUtils.readVersion()}, ConsoleColor.LIGHT_GRAY);
ConsoleWriter.write("\n", ConsoleColor.WHITE);
ConsoleWriter.write("Visit us at: ");
ConsoleWriter.write("https://evitadb.io", ConsoleColor.DARK_BLUE, ConsoleDecoration.UNDERLINE);
Expand Down

0 comments on commit 5ac0611

Please sign in to comment.