Skip to content

Commit 72bb7d9

Browse files
committed
spotless
1 parent 5bbd984 commit 72bb7d9

8 files changed

Lines changed: 21 additions & 23 deletions

File tree

integration-test/src/test/java/org/apache/iotdb/db/it/iotconsensusv2/IoTDBIoTConsensusV23C3DBasicITBase.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
import org.apache.iotdb.confignode.it.regionmigration.IoTDBRegionOperationReliabilityITFramework;
2323
import org.apache.iotdb.consensus.ConsensusFactory;
24-
import org.apache.iotdb.isession.SessionConfig;
2524
import org.apache.iotdb.isession.ITableSession;
25+
import org.apache.iotdb.isession.SessionConfig;
2626
import org.apache.iotdb.it.env.EnvFactory;
2727
import org.apache.iotdb.it.env.cluster.node.DataNodeWrapper;
2828
import org.apache.iotdb.itbase.env.BaseEnv;
@@ -41,10 +41,10 @@
4141
import java.io.IOException;
4242
import java.nio.file.Files;
4343
import java.nio.file.Paths;
44-
import java.util.Arrays;
4544
import java.sql.Connection;
4645
import java.sql.ResultSet;
4746
import java.sql.Statement;
47+
import java.util.Arrays;
4848
import java.util.Collections;
4949
import java.util.HashSet;
5050
import java.util.List;
@@ -424,7 +424,9 @@ public void testObjectReplicaConsistency() throws Exception {
424424
.orElseThrow(() -> new AssertionError("Follower DataNode not found"));
425425

426426
LOGGER.info(
427-
"Stopping object-region leader DataNode {} (region {})", leaderDataNodeId, targetRegionId);
427+
"Stopping object-region leader DataNode {} (region {})",
428+
leaderDataNodeId,
429+
targetRegionId);
428430
leaderNode.stopForcibly();
429431
Assert.assertFalse("Leader should be stopped", leaderNode.isAlive());
430432

@@ -449,7 +451,8 @@ public void testObjectReplicaConsistency() throws Exception {
449451
}
450452
}
451453

452-
private Map<Integer, Pair<Integer, Set<Integer>>> waitForDataRegionMap(final Statement statement) {
454+
private Map<Integer, Pair<Integer, Set<Integer>>> waitForDataRegionMap(
455+
final Statement statement) {
453456
final AtomicReference<Map<Integer, Pair<Integer, Set<Integer>>>> dataRegionMapReference =
454457
new AtomicReference<>(Collections.emptyMap());
455458
Awaitility.await()
@@ -593,8 +596,7 @@ private void verifyObjectFileOnReplicas(
593596
final DataNodeWrapper wrapper =
594597
EnvFactory.getEnv()
595598
.dataNodeIdToWrapper(dataNodeId)
596-
.orElseThrow(
597-
() -> new AssertionError("DataNode not found: " + dataNodeId));
599+
.orElseThrow(() -> new AssertionError("DataNode not found: " + dataNodeId));
598600
Assert.assertTrue(
599601
"Expected object file on DataNode "
600602
+ dataNodeId
@@ -612,8 +614,7 @@ private void verifyObjectFileOnReplicas(
612614
private boolean containsObjectFile(
613615
final DataNodeWrapper wrapper, final int regionId, final byte[] expectedContent)
614616
throws IOException {
615-
final File objectRegionDir =
616-
new File(wrapper.getDataNodeObjectDir(), String.valueOf(regionId));
617+
final File objectRegionDir = new File(wrapper.getDataNodeObjectDir(), String.valueOf(regionId));
617618
return containsObjectFile(objectRegionDir, expectedContent);
618619
}
619620

iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/utils/Base32ObjectPath.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public Base32ObjectPath(Path path) {
9292
deviceIdSegments[i] = "";
9393
} else {
9494
deviceIdSegments[i] =
95-
new String(
96-
BaseEncoding.base32().omitPadding().decode(segment), StandardCharsets.UTF_8);
95+
new String(BaseEncoding.base32().omitPadding().decode(segment), StandardCharsets.UTF_8);
9796
}
9897
}
9998
deviceID = IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIdSegments);

iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/utils/ObjectTypeUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ public static Binary replaceRegionIdForObjectBinary(int newRegionId, Binary orig
120120
final IObjectPath newObjectPath;
121121
if (objectPath instanceof PlainObjectPath) {
122122
newObjectPath =
123-
new PlainObjectPath(objectPath.toString().replaceFirst(regionId + "", newRegionId + ""));
123+
new PlainObjectPath(
124+
objectPath.toString().replaceFirst(regionId + "", newRegionId + ""));
124125
} else {
125126
final String[] subPath = new String[path.getNameCount() - 1];
126127
for (int i = 1; i < path.getNameCount(); i++) {

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/iotconsensusv2/IoTConsensusV2Receiver.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,9 +1535,7 @@ private TIoTConsensusV2TransferResp onRequest(
15351535
// only update tsFileEventCount when tsFileEvent is first enqueue.
15361536
tsFileEventCount.incrementAndGet();
15371537
}
1538-
if (!isTransferTsFileSeal
1539-
&& !isTransferTsFilePiece
1540-
&& !shouldKeepRequestMetaAfterSuccess) {
1538+
if (!isTransferTsFileSeal && !isTransferTsFilePiece && !shouldKeepRequestMetaAfterSuccess) {
15411539
WALEventCount.incrementAndGet();
15421540
}
15431541
reqExecutionOrderBuffer.add(requestMeta);

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/iotconsensusv2/handler/IoTConsensusV2TsFileInsertionEventHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ private ObjectNode nextObjectNode(final ObjectFileDescriptor descriptor) {
221221
objectSize == 0
222222
? 0
223223
: (int) Math.min(readFileBufferSize, objectSize - currentObjectFileOffset);
224-
final boolean isEOF =
225-
objectSize == 0 || currentObjectFileOffset + pieceLength >= objectSize;
224+
final boolean isEOF = objectSize == 0 || currentObjectFileOffset + pieceLength >= objectSize;
226225
final ObjectNode objectNode =
227226
new ObjectNode(isEOF, currentObjectFileOffset, pieceLength, descriptor.getObjectPath());
228227

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/iotconsensusv2/payload/request/IoTConsensusV2ObjectFileUtils.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,11 @@ private static void collectObjectFileDescriptor(
338338
return;
339339
}
340340

341-
if (!TierManager.getInstance()
342-
.getAbsoluteObjectFilePath(objectPathString, true)
343-
.isPresent()) {
341+
if (!TierManager.getInstance().getAbsoluteObjectFilePath(objectPathString, true).isPresent()) {
344342
throw new ObjectFileNotExist(objectPathString);
345343
}
346344

347-
objectFileDescriptors.put(
348-
objectPathString, new ObjectFileDescriptor(objectSize, objectPath));
345+
objectFileDescriptors.put(objectPathString, new ObjectFileDescriptor(objectSize, objectPath));
349346
}
350347

351348
public static final class ObjectFileDescriptor {

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/RelationalInsertTabletNode.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,10 @@ private void handleObjectValue(
491491
final byte[] content = ReadWriteIOUtils.readBytes(buffer, buffer.remaining());
492492
final IObjectPath relativePath =
493493
IObjectPath.Factory.FACTORY.create(
494-
entry.getKey().getRegionId().getId(), times[row], getDeviceID(row), measurements[column]);
494+
entry.getKey().getRegionId().getId(),
495+
times[row],
496+
getDeviceID(row),
497+
measurements[column]);
495498
final ObjectNode objectNode = new ObjectNode(isEOF, offset, content, relativePath);
496499
objectNode.setDataRegionReplicaSet(entry.getKey());
497500
result.add(objectNode);

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.InsertRowsOfOneDeviceNode;
9292
import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.InsertTabletNode;
9393
import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.ObjectNode;
94-
import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.RelationalInsertRowNode;
9594
import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.RelationalDeleteDataNode;
95+
import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.RelationalInsertRowNode;
9696
import org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache.LastCacheLoadStrategy;
9797
import org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache.TableDeviceSchemaCache;
9898
import org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache.TreeDeviceSchemaCacheManager;

0 commit comments

Comments
 (0)