Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2871,6 +2871,7 @@ public SettableFuture<ConfigTaskResult> removeDataNode(
future.setException(
new IOException(
"The DataNode to be removed is not in the cluster, or the input format is incorrect."));
return future;
}

LOGGER.info("Starting to remove DataNode with nodeIds: {}", nodeIds);
Expand Down Expand Up @@ -2940,6 +2941,7 @@ public SettableFuture<ConfigTaskResult> removeConfigNode(
future.setException(
new IOException(
"The ConfigNode to be removed is not in the cluster, or the input format is incorrect."));
return future;
}

TConfigNodeLocation configNodeLocation = removeConfigNodeLocations.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ public void start() {
final StringBuilder failedTsFiles =
new StringBuilder(
!tsFileNodeList.isEmpty()
? tsFileNodeList.get(0).getTsFileResource().getTsFilePath()
? tsFileNodeList
.get(failedTsFileNodeIndexes.get(0))
.getTsFileResource()
.getTsFilePath()
: "");
final ListIterator<Integer> iterator = failedTsFileNodeIndexes.listIterator(1);
while (iterator.hasNext()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void writeToDataRegion(DataRegion dataRegion, LoadTsFilePieceNode pieceNo
}
}

final Optional<CleanupTask> cleanupTask = Optional.of(uuid2CleanupTask.get(uuid));
final Optional<CleanupTask> cleanupTask = Optional.ofNullable(uuid2CleanupTask.get(uuid));
cleanupTask.ifPresent(CleanupTask::markLoadTaskRunning);
try {
final AtomicReference<Exception> exception = new AtomicReference<>();
Expand Down Expand Up @@ -293,7 +293,7 @@ public boolean loadAll(
return false;
}

final Optional<CleanupTask> cleanupTask = Optional.of(uuid2CleanupTask.get(uuid));
final Optional<CleanupTask> cleanupTask = Optional.ofNullable(uuid2CleanupTask.get(uuid));
cleanupTask.ifPresent(CleanupTask::markLoadTaskRunning);
try {
uuid2WriterManager.get(uuid).loadAll(isGeneratedByPipe, timePartitionProgressIndexMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public synchronized boolean isFilePendingOrLoading(final String file) {
return loadingFileSet.contains(file) || pendingFileSet.contains(file);
}

public int size() {
public synchronized int size() {
return pendingFileQueue.size() + loadingFileSet.size();
}

public boolean isEmpty() {
public synchronized boolean isEmpty() {
return pendingFileQueue.isEmpty() && loadingFileSet.isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ public static void validateParameters(final String key, final String value) {

public static void validateDatabaseLevelParam(final String databaseLevel) {
try {
int level = Integer.parseInt(databaseLevel);
final int level = Integer.parseInt(databaseLevel);
if (level < DATABASE_LEVEL_MIN_VALUE) {
throw new SemanticException(
String.format(
"Given database level %d is less than the minimum value %d, please input a valid database level.",
level, DATABASE_LEVEL_MIN_VALUE));
}
} catch (Exception e) {
} catch (final NumberFormatException e) {
throw new SemanticException(
String.format(
"Given database level %s is not a valid integer, please input a valid database level.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public synchronized LoadTsFileDataCacheMemoryBlock allocateDataCacheMemoryBlock(
final long actuallyAllocateMemoryInBytes =
tryAllocateFromQuery(MEMORY_TOTAL_SIZE_FROM_QUERY_IN_BYTES >> 2);
dataCacheMemoryBlock = new LoadTsFileDataCacheMemoryBlock(actuallyAllocateMemoryInBytes);
usedMemorySizeInBytes.addAndGet(actuallyAllocateMemoryInBytes);
LOGGER.info(
"Create Data Cache Memory Block {}, allocate memory {}",
dataCacheMemoryBlock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void unbindFrom(AbstractMetricService metricService) {
stage));

metricService.remove(
MetricType.RATE,
MetricType.COUNTER,
Metric.LOAD_DISK_IO.toString(),
Tag.NAME.toString(),
String.valueOf(IoTDBDescriptor.getInstance().getConfig().getDataNodeId()));
Expand Down
Loading