Skip to content

Commit

Permalink
code format & fix sonar check
Browse files Browse the repository at this point in the history
  • Loading branch information
aiceflower committed Jan 13, 2025
1 parent 554713b commit df630e1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public class HDFSFileSystem extends FileSystem {

private static final String LOCKER_SUFFIX = "refresh";

private static final int REFRESH_INTERVAL = LinkisStorageConf.HDFS_FILE_SYSTEM_REFRESHE_INTERVAL() * 1000 * 60;
private static final int REFRESH_INTERVAL =
LinkisStorageConf.HDFS_FILE_SYSTEM_REFRESHE_INTERVAL() * 1000 * 60;

private static final ConcurrentHashMap<String, Long> lastCallTimes = new ConcurrentHashMap<>();

Expand Down Expand Up @@ -336,7 +337,7 @@ public boolean exists(FsPath dest) throws IOException {
private void resetRootHdfs() {
if (fs != null) {
String locker = user + LOCKER_SUFFIX;
synchronized (locker.intern()) {
synchronized (locker.intern()) { // NOSONAR
if (fs != null) {
if (HadoopConf.HDFS_ENABLE_CACHE()) {
long currentTime = System.currentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.linkis.storage.domain

import java.lang.reflect.Type

import com.google.gson.{GsonBuilder, ToNumberPolicy}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public class AMConfiguration {
CommonVars.apply("wds.linkis.allow.batch.kill.engine.types", "spark,hive,python");

public static final CommonVars<String> UNALLOW_BATCH_KILL_ENGINE_TYPES =
CommonVars.apply("wds.linkis.unallow.batch.kill.engine.types", "trino,appconn,io_file,jdbc,nebula");
CommonVars.apply(
"wds.linkis.unallow.batch.kill.engine.types", "trino,appconn,io_file,jdbc,nebula");
public static final CommonVars<String> MULTI_USER_ENGINE_USER =
CommonVars.apply("wds.linkis.multi.user.engine.user", getDefaultMultiEngineUser());
public static final String UDF_KILL_ENGINE_TYPE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ public int getCores() {
}

public int getInstances() {
return instances;
return this.instances;
}

public int getInstance() {
return instances;
return this.instances; // NOSONAR
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Random;
import java.util.stream.Stream;

/**
Expand Down Expand Up @@ -63,7 +63,7 @@ public final class FileUtils {

public static final String PACKAGE_SEPARATOR = ".";

public static final Random rnd = new Random();
public static final SecureRandom rand = new SecureRandom();

// ------------------------------------------------------------------------

Expand Down Expand Up @@ -96,7 +96,7 @@ public static String getRandomFilename(final String prefix) {
final StringBuilder stringBuilder = new StringBuilder(prefix);

for (int i = 0; i < RANDOM_FILE_NAME_LENGTH; i++) {
stringBuilder.append(ALPHABET[rnd.nextInt(ALPHABET.length)]);
stringBuilder.append(ALPHABET[rand.nextInt(ALPHABET.length)]);
}

return stringBuilder.toString();
Expand Down

0 comments on commit df630e1

Please sign in to comment.