Releases: ydb-platform/yoj-project
YOJ 2.6.22 (minor fixes)
YOJ 2.6.21 (fix NPE in YdbRepositoryTransaction.trace)
- FIX occasional NPE in
YdbRepositoryTransaction.trace()
java.lang.NullPointerException: Cannot invoke "tech.ydb.table.Session.getId()" because "this.session" is null
YOJ 2.6.20
❌ Please do not use this release as it can cause NPE in YdbRepositoryTransaction.trace()
, use 2.6.21 instead.
-
InMemoryDataShard
: Allow to replaceTreeMap
with an explicitly sortedLinkedHashMap
to reduce comparison count
If you have a massive amount ofinsert()
s/save()
s and only occasionally get the list of sorted entities,
you will likely gain massive performance benefits from using an alternative in-memory data shard map
implementation usingLinkedHashMap
(even if sorted oninsert()
, but especially if sorted on reads).To switch map implementation, set the
tech.ydb.yoj.repository.test.inmemory.impl
system property
tooninsert
(for sorting data oninsert()
) oronget
(for sorting data on first read.) -
Bump SnakeYAML version: 2.3 -> 2.4
YOJ 2.6.19 (Query statistics)
❌ Please do not use this release as it can cause NPE in YdbRepositoryTransaction.trace()
, use 2.6.21 instead.
- Add query statistics collection and improve query traces
- Query traces are now easier to read by humans, and also include more information. For maximum verbosity, enable the following Java system properties:
tech.ydb.yoj.repository.ydb.trace.dumpYdbParams
: Additionally log converted query parameter values, as represented by YDB Java SDKValue
tech.ydb.yoj.repository.ydb.trace.verboseObjParams
: Log all statement parameters, not just the first fewtech.ydb.yoj.repository.ydb.trace.verboseObjResults
: Log all statement results, not just the first few
- Query traces are now easier to read by humans, and also include more information. For maximum verbosity, enable the following Java system properties:
- #148: Remove
--!syntax_v1
directive from YQL queries generated by YOJ
YOJ 2.6.18 (Case-insensitive LIKE/CONTAINS)
Features:
- #146 (Support case-insensitive LIKE/CONTAINS)
Dependency Updates:
- Protobuf: 3.24.0 -> 3.25.5 (fixes GHSA-735f-pc8j-v9w8)
- Netty: 4.1.100.Final -> 4.1.118.Final (fixes GHSA-4g8c-wm8x-jfhw)
- Jackson: 2.17.1 -> 2.17.3
- Log4j2: 2.17.2 -> 2.23.1
- GSON: 2.10.1 -> 2.12.1
- errorprone annotations: 2.14.0 -> 2.36.0
- Kotlin (optional dependency): 1.9.22 -> 1.9.24
- Mockito (test dependency): 5.5.0 -> 5.11.0
- SnakeYAML (test dependency, for Log4j2 YAML config in tests): 1.33 -> 2.3
- Testcontainers (test dependency, for testing
yoj-repository-ydb-v2
): 1.19.1 -> 1.19..5 - Docker Java (test dependency, for testing
yoj-repository-ydb-v2
): 3.3.3 -> 3.4.2 - Kotlin Compile Testing (test dependency, for testing
yoj-ext-meta-generator
): 1.5.0 -> 1.6.0
Improvements:
YOJ 2.5.15 (backport case-insensitive LIKE/CONTAINS from 2.6.18)
YOJ 2.6.17 (UUID YDB columns)
- #140: Add support for YDB
UUID
column type, viaDbType.UUID
specified in@Column(dbType=...)
annotation (or a meta-annotation carrying (possibly transitively) a@Column
annotation). - Update YDB SDK to 2.3.14 (was 2.3.9) and YDB Proto APIs to 1.7.1 (was 1.6.4)
YOJ 2.6.16 (API improvements)
Key changes ( ❌ denotes breaking changes )
- ➕
YdbTable
now exposes itsQueryExecutor
to subclasses via aprotected getExecutor()
method, and adds apublic getSchema()
method for getting entity schema used for mapping the rows of this table. This makes custom tables with custom queries a little less quirky (but this is still far from an official way of creating custom statements; that will be explored in #43). - ➕ New
@InternalApi
annotation that clearly specifies which publicly visible parts of YOJ API (interfaces, classes, methods, fields, constants, and so on) are implementation details exposed for cross-package and cross-module usage. - ❌
Table
interface methodfind(Set<ID>)
is now required. Direct implementors ofTable
must implement this new method (either by delegating to anotherTable
or by using the internalTableQueryImpl
utility). Those who extendedAbstractDelegatingTable
don't need to do anything. - ❌
Table
interface has dropped thegetFirstLevelCache()
method. There is no replacement.- Direct implementors of
Table
should just delete their implementation ofgetFirstLevelCache()
. - Users of
Table.getFirstLevelCache()
should do one of the following:- Reconsider their usage of Internal API.
- If the usage cannot be eliminated, obtain a
FirstLevelCache
instance by getting it from currentRepositoryTransaction
'sTransactionLocal
:First-level cache can only be used if you have avar tx = Tx.Current.get(); var repositoryTransaction = tx.getRepositoryTransaction(); var transactionLocal = repositoryTransaction.getTransactionLocal(); var cache = transactionLocal.firstLevelCache(<table descriptor>);
RepositoryTransaction
instance or can obtain it from currentTx
instance (which is established byTxManager
, so if you're inside a transaction body, you can do this). First-level cache is per-table descriptor per-transaction; its behavior outside of transaction is undefined.
- Direct implementors of
YOJ 2.6.15 (radical multi-table support improvements)
Features and bugfixes
- Fix #131: Incorrect query results when same entity but different tables is used with find, save and insert
- ❌
Table
interface has new required methods:getTableDescriptor()
andgetFirstLevelCache()
(the second one is temporary, and will be ❌ removed in a subsequent release) - ❌
FirstLevelCache.entities()
method has been removed without deprecating it first. It was unused by all YOJ users. - ❌
FirstLevelCache.snapshot(Class)
method has been replaced by theFirstLevelCache.snapshot()
method, becauseFirstLevelCache
is now per-entity type (or, more specifically, per-table descriptor). Its usage among YOJ users was insignificant. - ❌
TransactionLocal.firstLevelCache()
method has been replaced by theTransactionLocal.firstLevelCache(TableDescriptor)
method. Its usage among YOJ users was insignificant. - ❌
RepositoryCache.Key
now requires an explicitTableDescriptor
, to cache statement results separately for different tables of the sameEntity
. YOJ-bundledYqlStatement
s have all been migrated to use the new constructor, but anyone who has a customstoreToCache
/readFromCache
implementation in their customYqlStatement
must migrate ASAP.- The old
RepositoryCache.Key(Class, Object)
constructor is deprecated for removal, ❌ will now fail on classes that do not implementEntity
, so it is of extremely limited usage, and ❌ will start throwingUnsupportedOperationException
or be removed in YOJ 2.7.0+
- The old
- ➕
FirstLevelCache
now has a type argument (FirstLevelCache<E extends Entity<E>>
); any usage without type argument will now be flagged as raw type usage. Consequently, the mostly-internalTable.getFirstLevelCache()
method now returnsFirstLevelCache<E>
(where<E>
is the table's entity type).- Please do not start using the
Table.getFirstLevelCache()
method in end-user code. It is intended to be deleted from theTable
interface!
- Please do not start using the
YOJ 2.6.14 (improved FieldValue.{ofObj,getRaw})
- #130: Improve
FieldValue.{ofObj,getRaw}
to better fit existing usage, especially withPageToken
implementations- Backwards compatibility: Always flatten the value in
FieldValue.getRaw()
, as YOJ 2.5.x series did. - Improvement: Allow to use any wrapper (and not only top-level wrapper or raw unwrapped value) as arguments to
FieldValue.ofObj()
- Backwards compatibility: Always flatten the value in