Skip to content

Commit

Permalink
IGNITE-14823 Current abbrevation (#11104)
Browse files Browse the repository at this point in the history
  • Loading branch information
nizhikov authored Dec 18, 2023
1 parent 2e3ae15 commit d2d9c3d
Show file tree
Hide file tree
Showing 21 changed files with 100 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1110,13 +1110,13 @@ private Result implementCaseWhen(RexCall call) {
*/
private void implementRecursively(final RexToLixTranslator currentTranslator,
final List<RexNode> operandList, final ParameterExpression valueVariable, int pos) {
final BlockBuilder currentBlockBuilder = currentTranslator.getBlockBuilder();
final BlockBuilder curBlockBuilder = currentTranslator.getBlockBuilder();
final List<Type> storageTypes = ConverterUtils.internalTypes(operandList);
// [ELSE] clause
if (pos == operandList.size() - 1) {
Expression res = implementCallOperand2(operandList.get(pos),
storageTypes.get(pos), currentTranslator);
currentBlockBuilder.add(
curBlockBuilder.add(
Expressions.statement(
Expressions.assign(valueVariable,
ConverterUtils.convert(res, valueVariable.getType()))));
Expand All @@ -1132,7 +1132,7 @@ private void implementRecursively(final RexToLixTranslator currentTranslator,
// Code for {if} branch
final RexNode ifTrueNode = operandList.get(pos + 1);
final BlockBuilder ifTrueBlockBuilder =
new BlockBuilder(true, currentBlockBuilder);
new BlockBuilder(true, curBlockBuilder);
final RexToLixTranslator ifTrueTranslator =
currentTranslator.setBlock(ifTrueBlockBuilder);
final Expression ifTrueRes = implementCallOperand2(ifTrueNode,
Expand All @@ -1145,18 +1145,18 @@ private void implementRecursively(final RexToLixTranslator currentTranslator,
final BlockStatement ifTrue = ifTrueBlockBuilder.toBlock();
// There is no [ELSE] clause
if (pos + 1 == operandList.size() - 1) {
currentBlockBuilder.add(
curBlockBuilder.add(
Expressions.ifThen(tester, ifTrue));
return;
}
// Generate code for {else} branch recursively
final BlockBuilder ifFalseBlockBuilder =
new BlockBuilder(true, currentBlockBuilder);
new BlockBuilder(true, curBlockBuilder);
final RexToLixTranslator ifFalseTranslator =
currentTranslator.setBlock(ifFalseBlockBuilder);
implementRecursively(ifFalseTranslator, operandList, valueVariable, pos + 2);
final BlockStatement ifFalse = ifFalseBlockBuilder.toBlock();
currentBlockBuilder.add(
curBlockBuilder.add(
Expressions.ifThenElse(tester, ifTrue, ifFalse));
}

Expand Down
2 changes: 1 addition & 1 deletion modules/checkstyle/src/main/resources/abbrevations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ config,cfg
context,ctx
contexts,ctxs
count,cnt
#current,cur
current,cur
#database,db
#default,dflt
#destination,dest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,19 @@ public QueryEntity(Class<?> keyCls, Class<?> valCls) {
@NotNull private Collection<QueryIndex> checkIndexes(QueryEntity target, StringBuilder conflicts) {
HashSet<QueryIndex> indexesToAdd = new HashSet<>();

Map<String, QueryIndex> currentIndexes = new HashMap<>();
Map<String, QueryIndex> curIndexes = new HashMap<>();

for (QueryIndex index : getIndexes()) {
if (currentIndexes.put(index.getName(), index) != null)
if (curIndexes.put(index.getName(), index) != null)
throw new IllegalStateException("Duplicate key");
}

for (QueryIndex queryIndex : target.getIndexes()) {
if (currentIndexes.containsKey(queryIndex.getName())) {
if (curIndexes.containsKey(queryIndex.getName())) {
checkEquals(
conflicts,
"index " + queryIndex.getName(),
currentIndexes.get(queryIndex.getName()),
curIndexes.get(queryIndex.getName()),
queryIndex
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ private void processPartIterator(
final boolean skipConditions = checkFirst > 0 || checkThrough > 0;
final boolean bothSkipConditions = checkFirst > 0 && checkThrough > 0;

long current = 0;
long cur = 0;
long processedNumber = 0;

while (it.hasNextX() && !validateCtx.isCancelled()) {
Expand All @@ -596,18 +596,18 @@ private void processPartIterator(
if (bothSkipConditions) {
if (processedNumber > checkFirst)
break;
else if (current++ % checkThrough > 0)
else if (cur++ % checkThrough > 0)
continue;
else
processedNumber++;
}
else {
if (checkFirst > 0) {
if (current++ > checkFirst)
if (cur++ > checkFirst)
break;
}
else {
if (current++ % checkThrough > 0)
if (cur++ % checkThrough > 0)
continue;
}
}
Expand Down Expand Up @@ -768,7 +768,7 @@ private Map<String, ValidateIndexesPartitionResult> processIndex(
final boolean skipConditions = checkFirst > 0 || checkThrough > 0;
final boolean bothSkipConditions = checkFirst > 0 && checkThrough > 0;

long current = 0;
long cur = 0;
long processedNumber = 0;

KeyCacheObject previousKey = null;
Expand Down Expand Up @@ -798,18 +798,18 @@ private Map<String, ValidateIndexesPartitionResult> processIndex(
if (bothSkipConditions) {
if (processedNumber > checkFirst)
break;
else if (current++ % checkThrough > 0)
else if (cur++ % checkThrough > 0)
continue;
else
processedNumber++;
}
else {
if (checkFirst > 0) {
if (current++ > checkFirst)
if (cur++ > checkFirst)
break;
}
else {
if (current++ % checkThrough > 0)
if (cur++ % checkThrough > 0)
continue;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,20 +494,20 @@ private List<List<ClusterNode>> baselineAssignmentWithoutOfflineNodes(DiscoCache

for (int p = 0; p < assignment.size(); p++) {
List<ClusterNode> baselineMapping = assignment.get(p);
List<ClusterNode> currentMapping = null;
List<ClusterNode> curMapping = null;

for (ClusterNode node : baselineMapping) {
ClusterNode aliveNode = alives.get(node.consistentId());

if (aliveNode != null) {
if (currentMapping == null)
currentMapping = new ArrayList<>();
if (curMapping == null)
curMapping = new ArrayList<>();

currentMapping.add(aliveNode);
curMapping.add(aliveNode);
}
}

result.add(p, currentMapping != null ? currentMapping : Collections.<ClusterNode>emptyList());
result.add(p, curMapping != null ? curMapping : Collections.<ClusterNode>emptyList());
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public CsvLineProcessorBlock(BulkLoadCsvFormat format) {
@Override public void accept(String input, boolean isLastPortion) throws IgniteCheckedException {
List<String> fields = new ArrayList<>();

StringBuilder currentField = new StringBuilder(256);
StringBuilder curField = new StringBuilder(256);

ReaderState state = ReaderState.IDLE;

final int length = input.length();
int copy = 0;
int current = 0;
int cur = 0;
int prev = -1;
int copyStart = 0;

Expand All @@ -82,20 +82,20 @@ public CsvLineProcessorBlock(BulkLoadCsvFormat format) {
symbol = 0;

while (true) {
if (current == length) {
if (cur == length) {
if (!quotesMatched)
throw new IgniteCheckedException(new SQLException("Unmatched quote found at the end of line "
+ line + ", symbol " + symbol));

if (copy > 0)
currentField.append(input, copyStart, copyStart + copy);
curField.append(input, copyStart, copyStart + copy);

addField(fields, currentField, prev == quoteChars);
addField(fields, curField, prev == quoteChars);

break;
}

final char c = input.charAt(current++);
final char c = input.charAt(cur++);
symbol++;

if (state == ReaderState.QUOTED) {
Expand All @@ -104,28 +104,28 @@ public CsvLineProcessorBlock(BulkLoadCsvFormat format) {
quotesMatched = !quotesMatched;

if (copy > 0) {
currentField.append(input, copyStart, copyStart + copy);
curField.append(input, copyStart, copyStart + copy);

copy = 0;
}

copyStart = current;
copyStart = cur;
}
else
copy++;
}
else {
if (c == fldDelim) {
if (copy > 0) {
currentField.append(input, copyStart, copyStart + copy);
curField.append(input, copyStart, copyStart + copy);

copy = 0;
}

addField(fields, currentField, prev == quoteChars);
addField(fields, curField, prev == quoteChars);

currentField = new StringBuilder();
copyStart = current;
curField = new StringBuilder();
copyStart = cur;

state = ReaderState.IDLE;
}
Expand All @@ -137,7 +137,7 @@ else if (c == quoteChars && state != ReaderState.UNQUOTED) {
if (prev == quoteChars)
copy++;
else
copyStart = current;
copyStart = cur;
}
else {
if (c == quoteChars) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ public void unregisterAll() {
* Awaits last registered caches configurations persist future.
*/
private void waitLastRegistration() {
IgniteInternalFuture<?> currentFut = cachesConfPersistFuture;
IgniteInternalFuture<?> curFut = cachesConfPersistFuture;

if (currentFut != null && !currentFut.isDone()) {
if (curFut != null && !curFut.isDone()) {
try {
currentFut.get();
curFut.get();
}
catch (IgniteCheckedException e) {
throw new IgniteException("Failed to wait for last registered caches registration future", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2933,16 +2933,16 @@ private boolean skipInterceptor(@Nullable GridCacheVersion explicitVer) {
@Override public boolean apply(@Nullable CacheDataRow row) {
boolean update0;

GridCacheVersion currentVer = row != null ? row.version() : GridCacheMapEntry.this.ver;
GridCacheVersion curVer = row != null ? row.version() : GridCacheMapEntry.this.ver;

boolean isStartVer = cctx.shared().versions().isStartVersion(currentVer);
boolean isStartVer = cctx.shared().versions().isStartVersion(curVer);

if (cctx.group().persistenceEnabled()) {
if (!isStartVer) {
if (cctx.atomic())
update0 = ATOMIC_VER_COMPARATOR.compare(currentVer, ver) < 0;
update0 = ATOMIC_VER_COMPARATOR.compare(curVer, ver) < 0;
else
update0 = currentVer.compareTo(ver) < 0;
update0 = curVer.compareTo(ver) < 0;
}
else
update0 = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,9 @@ private void processEventInactive(DiscoveryEvent evt, DiscoCache cache) {
new MessageHandler<GridDhtPartitionsFullMessage>() {
@Override public void onMessage(ClusterNode node, GridDhtPartitionsFullMessage msg) {
if (msg.exchangeId() == null) {
GridDhtPartitionsExchangeFuture currentExchange = lastTopologyFuture();
GridDhtPartitionsExchangeFuture curExchange = lastTopologyFuture();

if (currentExchange != null && currentExchange.addOrMergeDelayedFullMessage(node, msg)) {
if (curExchange != null && curExchange.addOrMergeDelayedFullMessage(node, msg)) {
if (log.isInfoEnabled()) {
log.info("Delay process full message without exchange id (there is exchange in progress) " +
"[nodeId=" + node.id() + "]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2237,12 +2237,12 @@ public void checkRestart() {
* Throws {@code IgniteCacheRestartingException} if proxy is restarting.
*/
public void checkRestart(boolean noWait) {
RestartFuture currentFut = restartFut.get();
RestartFuture curFut = restartFut.get();

if (currentFut != null) {
if (curFut != null) {
try {
if (!noWait) {
currentFut.get(1, TimeUnit.SECONDS);
curFut.get(1, TimeUnit.SECONDS);

return;
}
Expand All @@ -2251,7 +2251,7 @@ public void checkRestart(boolean noWait) {
//do nothing
}

throw new IgniteCacheRestartingException(new IgniteFutureImpl<>(currentFut, exec()), cacheName);
throw new IgniteCacheRestartingException(new IgniteFutureImpl<>(curFut, exec()), cacheName);
}
}

Expand Down Expand Up @@ -2296,10 +2296,10 @@ public RestartFuture suspend() {
* @param fut Finish restart future.
*/
public void registrateFutureRestart(GridFutureAdapter<?> fut) {
RestartFuture currentFut = restartFut.get();
RestartFuture curFut = restartFut.get();

if (currentFut != null)
currentFut.addRestartFinishedFuture(fut);
if (curFut != null)
curFut.addRestartFinishedFuture(fut);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,13 +938,13 @@ public void merge(GridDhtPartitionsFullMessage other, GridDiscoveryManager disco
if (currMap == null)
partitions().put(grpId, updMap);
else {
ClusterNode currentMapSentBy = discovery.node(currMap.nodeId());
ClusterNode curMapSentBy = discovery.node(currMap.nodeId());
ClusterNode newMapSentBy = discovery.node(updMap.nodeId());

if (newMapSentBy == null)
continue;

if (currentMapSentBy == null || newMapSentBy.order() > currentMapSentBy.order() || updMap.compareTo(currMap) >= 0)
if (curMapSentBy == null || newMapSentBy.order() > curMapSentBy.order() || updMap.compareTo(currMap) >= 0)
partitions().put(grpId, updMap);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ public Map<Integer, Map<UUID, Long>> validatePartitionsUpdateCounters(
if (ignorePartitions != null && ignorePartitions.contains(p))
continue;

long currentCounter = countersMap.updateCounterAt(i);
long curCounter = countersMap.updateCounterAt(i);

process(invalidPartitions, updateCountersAndNodesByPartitions, p, nodeId, currentCounter);
process(invalidPartitions, updateCountersAndNodesByPartitions, p, nodeId, curCounter);
}
}

Expand Down Expand Up @@ -278,9 +278,9 @@ public Map<Integer, Map<UUID, Long>> validatePartitionsSizes(
if (ignorePartitions != null && ignorePartitions.contains(p))
continue;

long currentSize = sizesMap.getOrDefault(p, 0L);
long curSize = sizesMap.getOrDefault(p, 0L);

process(invalidPartitions, sizesAndNodesByPartitions, p, nodeId, currentSize);
process(invalidPartitions, sizesAndNodesByPartitions, p, nodeId, curSize);
}
}

Expand Down
Loading

0 comments on commit d2d9c3d

Please sign in to comment.