Skip to content

Commit

Permalink
table-cache: remove getFirstLevelCache from table
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Lavrukov committed Apr 8, 2024
1 parent 977e279 commit 6fbd377
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,6 @@ private <ID extends Entity.Id<T>> boolean readTableFilter(T e, ReadTableParams<I
return true;
}

@Override
public FirstLevelCache getFirstLevelCache() {
return transaction.getTransactionLocal().firstLevelCache();
}

@Nullable
@Override
public T postLoad(T entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,6 @@ public <ID extends Id<T>> void migrate(ID id) {
executor.getTransactionLocal().projectionCache().save(entityToSave);
}

@Override
public FirstLevelCache getFirstLevelCache() {
return executor.getTransactionLocal().firstLevelCache();
}

@Override
@NonNull
public T postLoad(T e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import tech.ydb.yoj.repository.db.Tx;
import tech.ydb.yoj.repository.db.ViewSchema;
import tech.ydb.yoj.repository.db.bulk.BulkParams;
import tech.ydb.yoj.repository.db.cache.FirstLevelCache;
import tech.ydb.yoj.repository.db.cache.TransactionLocal;
import tech.ydb.yoj.repository.db.readtable.ReadTableParams;
import tech.ydb.yoj.repository.db.statement.Changeset;
Expand Down Expand Up @@ -461,11 +460,6 @@ public <ID extends Id<T>> void migrate(ID id) {
executor.getTransactionLocal().projectionCache().save(entityToSave);
}

@Override
public FirstLevelCache getFirstLevelCache() {
return executor.getTransactionLocal().firstLevelCache();
}

@Override
@NonNull
public T postLoad(T e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import tech.ydb.yoj.databind.expression.FilterExpression;
import tech.ydb.yoj.databind.expression.OrderExpression;
import tech.ydb.yoj.repository.db.bulk.BulkParams;
import tech.ydb.yoj.repository.db.cache.FirstLevelCache;
import tech.ydb.yoj.repository.db.list.ListRequest;
import tech.ydb.yoj.repository.db.list.ListResult;
import tech.ydb.yoj.repository.db.list.ViewListResult;
Expand Down Expand Up @@ -158,10 +157,6 @@ default <ID extends Entity.Id<T>> Stream<ID> readTableIds() {
return readTableIds(ReadTableParams.getDefault());
}

default FirstLevelCache getFirstLevelCache() {
return null;
}

@NonNull
default <X extends Exception> T find(Entity.Id<T> id, Supplier<? extends X> throwIfAbsent) throws X {
T found = find(id);
Expand Down Expand Up @@ -276,7 +271,7 @@ default <ID extends Entity.Id<T>> List<T> find(Set<ID> ids) {
}

var orderBy = EntityExpressions.defaultOrder(getType());
var cache = getFirstLevelCache();
var cache = Tx.Current.get().getRepositoryTransaction().getTransactionLocal().firstLevelCache();
var isPartialIdMode = ids.iterator().next().isPartial();

var foundInCache = ids.stream()
Expand Down

0 comments on commit 6fbd377

Please sign in to comment.