Skip to content

Commit

Permalink
temporary configurable tracing of txn.getAll()
Browse files Browse the repository at this point in the history
  • Loading branch information
penemue committed Feb 14, 2020
1 parent 83a8e8f commit 6bdef6c
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Copyright 2010 - 2020 JetBrains s.r.o.
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -45,6 +45,7 @@

@SuppressWarnings({"RawUseOfParameterizedType", "rawtypes"})
public class PersistentStoreTransaction implements StoreTransaction, TxnGetterStrategy, TxnProvider {

private static final Logger logger = LoggerFactory.getLogger(PersistentStoreTransaction.class);

enum TransactionType {
Expand Down Expand Up @@ -277,13 +278,21 @@ public List<String> getEntityTypes() {
return store.getEntityTypes(this);
}

// TODO: remove ASAP
private static int traceGetAllForEntityType = Integer.getInteger("jetbrains.exodus.entitystore.traceGetAllForEntityType", -1);

@Override
@NotNull
public EntityIterable getAll(@NotNull final String entityType) {
final int entityTypeId = store.getEntityTypeId(this, entityType, false);
if (entityTypeId < 0) {
return EntityIterableBase.EMPTY;
}
if (entityTypeId == traceGetAllForEntityType) {
if (logger.isErrorEnabled()) {
logger.error("txn.getAll() for entityTypeId = " + entityTypeId, new Throwable());
}
}
return new EntitiesOfTypeIterable(this, entityTypeId);
}

Expand Down

0 comments on commit 6bdef6c

Please sign in to comment.