Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 1.9.0 webank sonar #640

Merged
merged 7 commits into from
Nov 8, 2024
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
9 changes: 9 additions & 0 deletions codecheck.ignore
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
linkis-commons/linkis-common/src/main/java/org/apache/linkis/common/utils/DESUtil.java
linkis-public-enhancements/linkis-pes-common/src/main/java/org/apache/linkis/cs/common/serialize/helper/ContextSerializationHelper.java
linkis-public-enhancements/linkis-pes-common/src/main/java/org/apache/linkis/cs/listener/callback/imp/DefaultContextIDCallbackEngine.java
linkis-public-enhancements/linkis-pes-common/src/main/java/org/apache/linkis/cs/listener/callback/imp/DefaultContextKeyCallbackEngine.java
linkis-computation-governance/linkis-manager/linkis-label-common/src/main/java/org/apache/linkis/manager/label/utils/EngineTypeLabelCreator.java
linkis-public-enhancements/linkis-pes-common/src/main/java/org/apache/linkis/cs/listener/ListenerBus/ContextAsyncListenerBus.java
linkis-computation-governance/linkis-manager/linkis-manager-persistence/src/main/resources/mapper/common/LabelManagerMapper.xml
linkis-engineconn-plugins/hbase/hbase-core/src/main/java/org/apache/linkis/manager/engineplugin/hbase/HBaseConnectionManager.java
linkis-public-enhancements/linkis-instance-label-server/src/main/resources/mapper/common/InsLabelRelationMapper.xml
linkis-commons/linkis-common/src/main/java/org/apache/linkis/common/utils/AESUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public static void checkStatus() {
} else {
LOG.info("CurrentUser is not null");
}
assert curUsr != null;
if (loginUsr.getClass() != curUsr.getClass()) {
LOG.info("getClass() is different");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class UJESClientFactory {

public static UJESClient getReusable(VarAccess stdVarAccess) {
if (client == null) { // NOSONAR
synchronized (UJESClientFactory.class) {
if (client == null) {
synchronized (UJESClientFactory.class) { // NOSONAR
if (client == null) { // NOSONAR
client = getNew(stdVarAccess);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public static ExecutorService newFixedThreadPool(

public static ThreadPoolExecutor getCachedThreadPoolExecutor() {
if (cachedThreadPool == null) { // NOSONAR
synchronized (SchedulerManager.class) {
if (cachedThreadPool == null) {
synchronized (SchedulerManager.class) { // NOSONAR
if (cachedThreadPool == null) { // NOSONAR
cachedThreadPool = newCachedThreadPool(THREAD_NUM, THREAD_NAME, IS_DEAMON);
}
}
Expand All @@ -73,8 +73,8 @@ public static ThreadPoolExecutor getCachedThreadPoolExecutor() {

public static ExecutorService getFixedThreadPool() {
if (fixedThreadPool == null) { // NOSONAR
synchronized (SchedulerManager.class) {
if (fixedThreadPool == null) {
synchronized (SchedulerManager.class) { // NOSONAR
if (fixedThreadPool == null) { // NOSONAR
fixedThreadPool = newFixedThreadPool(THREAD_NUM, THREAD_NAME, IS_DEAMON);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public Message taskinfo(
}
}
}
assert undoneTasks != null;
Message resp =
Message.ok("success")
.data("taskNumber", undoneTasks.length)
Expand Down
2 changes: 1 addition & 1 deletion linkis-engineconn-plugins/flink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>3.4.0</version>
<exclusions>
<exclusion>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
</exclusion>
</exclusions>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ public Operation createOperation(SqlCommandCall call, FlinkEngineConnContext con

public static OperationFactory getInstance() {
if (operationFactory == null) { // NOSONAR
synchronized (OperationFactory.class) {
if (operationFactory == null) {
synchronized (OperationFactory.class) { // NOSONAR
if (operationFactory == null) { // NOSONAR
operationFactory =
ClassUtil.getInstance(OperationFactory.class, new OperationFactoryImpl());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ private SqlParser.Config createSqlParserConfig(boolean isBlinkPlanner) {

public static SqlCommandParser getInstance() {
if (sqlCommandParser == null) { // NOSONAR
synchronized (OperationFactory.class) {
if (sqlCommandParser == null) {
synchronized (OperationFactory.class) { // NOSONAR
if (sqlCommandParser == null) { // NOSONAR
sqlCommandParser =
ClassUtil.getInstance(SqlCommandParser.class, new SqlCommandParserImpl());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ public class HBaseConnectionManager {
private static final AtomicBoolean kerberosEnvInit = new AtomicBoolean(false);
private static final int KERBEROS_RE_LOGIN_MAX_RETRY = 5;
private static final long KERBEROS_RE_LOGIN_INTERVAL = 30 * 60 * 1000L;
private static volatile HBaseConnectionManager instance = null;
private static volatile HBaseConnectionManager instance = null; // NOSONAR

private HBaseConnectionManager() {
connectionMap = new ConcurrentHashMap<>();
}

public static HBaseConnectionManager getInstance() {
if (instance == null) { // NOSONAR
synchronized (HBaseConnectionManager.class) {
if (instance == null) {
synchronized (HBaseConnectionManager.class) { // NOSONAR
if (instance == null) { // NOSONAR
instance = new HBaseConnectionManager();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
public class HBaseShellCommands {
private static final Logger LOG = LoggerFactory.getLogger(HBaseShellCommands.class);
private static final String COMMANDS_PATH = "hbase-ruby/shell/commands/";
private static volatile Set<String> commandsSet;
private static volatile Set<String> commandsSet; // NOSONAR

private HBaseShellCommands() {}

public static Set<String> getAllCommands() throws IOException {
if (commandsSet == null) {
synchronized (HBaseShellCommands.class) {
if (commandsSet == null) {
if (commandsSet == null) { // NOSONAR
synchronized (HBaseShellCommands.class) { // NOSONAR
if (commandsSet == null) { // NOSONAR
Set<String> sortedSet = new TreeSet<>();
URL commandFilesUrl =
HBaseShellCommands.class.getClassLoader().getResource(COMMANDS_PATH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class HBaseShellSessionManager {
private static final Logger LOG = LoggerFactory.getLogger(HBaseShellSessionManager.class);
private final ConcurrentHashMap<String, HBaseShellSession> shellSessionMap;
private static volatile HBaseShellSessionManager instance = null;
private static volatile HBaseShellSessionManager instance = null; // NOSONAR

private final ReentrantLock lock = new ReentrantLock();

Expand All @@ -39,8 +39,8 @@ private HBaseShellSessionManager() {

public static HBaseShellSessionManager getInstance() {
if (instance == null) { // NOSONAR
synchronized (HBaseShellSessionManager.class) {
if (instance == null) {
synchronized (HBaseShellSessionManager.class) { // NOSONAR
if (instance == null) { // NOSONAR
instance = new HBaseShellSessionManager();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class ConnectionManager {
private final Map<String, DataSource> dataSourceFactories;
private final JDBCDataSourceConfigurations jdbcDataSourceConfigurations;

private static volatile ConnectionManager connectionManager;
private static volatile ConnectionManager connectionManager; // NOSONAR
private ScheduledExecutorService scheduledExecutorService;
private Integer kinitFailCount = 0;

Expand All @@ -63,8 +63,8 @@ private ConnectionManager() {

public static ConnectionManager getInstance() {
if (connectionManager == null) { // NOSONAR
synchronized (ConnectionManager.class) {
if (connectionManager == null) {
synchronized (ConnectionManager.class) { // NOSONAR
if (connectionManager == null) { // NOSONAR
connectionManager = new ConnectionManager();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ class SparkEngineConnFactory extends MultiExecutorEngineConnFactory with Logging
output
}(t => {
logger.warn("create spark repl classdir failed", t)
throw new SparkCreateFileException(
throw new SparkCreateFileException( // NOSONAR
SPARK_CREATE_EXCEPTION.getErrorCode,
SPARK_CREATE_EXCEPTION.getErrorDesc,
t
) // NOSONAR
)
null
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private ClientSingleton() {}
public static synchronized MonitorHTTPClient getInstance() {
if (instance == null) {
if (dwsClientConfig == null) {
dwsClientConfig = createClientConfig(null, null);
dwsClientConfig = createClientConfig(null, null); // NOSONAR
}
instance = new MonitorHTTPClientClientImpl(dwsClientConfig);
}
Expand All @@ -61,7 +61,7 @@ public static DWSClientConfig createClientConfig(String url, Map<String, Object>
}
int maxConnection =
(int)
parms.getOrDefault(
parms.getOrDefault( // NOSONAR
BmlConfiguration.CONNECTION_MAX_SIZE_SHORT_NAME(),
BmlConfiguration.CONNECTION_MAX_SIZE().getValue());
int connectTimeout =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,12 @@ public String convertHAIDToHAKey(HAContextID haContextID) throws CSErrorExceptio
|| StringUtils.isBlank(haContextID.getContextId())) {
throw new CSErrorException(
CSErrorCode.INVALID_HAID,
"Incomplete HAID Object cannot be encoded. mainInstance : " + haContextID == null
? "NULL"
: haContextID.getInstance() + ", backupInstance : " + haContextID == null
? "NULL"
: haContextID.getBackupInstance() + ", contextID : " + haContextID == null
? "NULL"
: haContextID.getContextId());
"Incomplete HAID Object cannot be encoded. mainInstance : "
+ (haContextID == null ? "NULL" : haContextID.getInstance())
+ ", backupInstance : "
+ (haContextID == null ? "NULL" : haContextID.getBackupInstance())
+ ", contextID : "
+ (haContextID == null ? "NULL" : haContextID.getContextId()));
}
if (StringUtils.isNumeric(haContextID.getContextId())) {
return encode(haContextID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.7.0</version>
<exclusions>
<exclusion>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
</exclusion>
</exclusions>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ private void resetRootHdfs() {

private FileSystem getRootHdfs() {
if (rootHdfs == null) { // NOSONAR
synchronized (this) {
if (rootHdfs == null) {
synchronized (this) { // NOSONAR
if (rootHdfs == null) { // NOSONAR
rootHdfs = HDFSUtils.getHDFSRootUserFileSystem();
KerberosUtils.startKerberosRefreshThread();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ private HttpContextClient(ContextClientConfig contextClientConfig) {

public static HttpContextClient getInstance(ContextClientConfig contextClientConfig) {
if (httpContextClient == null) { // NOSONAR
synchronized (HttpContextClient.class) {
if (httpContextClient == null) {
synchronized (HttpContextClient.class) { // NOSONAR
if (httpContextClient == null) { // NOSONAR
httpContextClient = new HttpContextClient(contextClientConfig);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class ContextClientListenerManager {
public static ContextClientListenerBus<ContextClientListener, Event>
getContextClientListenerBus() {
if (contextClientListenerBus == null) { // NOSONAR
synchronized (ContextClientListenerManager.class) {
if (contextClientListenerBus == null) {
synchronized (ContextClientListenerManager.class) { // NOSONAR
if (contextClientListenerBus == null) { // NOSONAR
contextClientListenerBus = new ContextClientListenerBus<ContextClientListener, Event>();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ private CSMetaDataService() {}

public static CSMetaDataService getInstance() {
if (null == csMetaDataService) { // NOSONAR
synchronized (CSMetaDataService.class) {
if (null == csMetaDataService) {
synchronized (CSMetaDataService.class) { // NOSONAR
if (null == csMetaDataService) { // NOSONAR
csMetaDataService = new CSMetaDataService();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ private CSNodeServiceImpl() {}

public static CSNodeService getInstance() {
if (null == csNodeService) { // NOSONAR
synchronized (CSNodeServiceImpl.class) {
if (null == csNodeService) {
synchronized (CSNodeServiceImpl.class) { // NOSONAR
if (null == csNodeService) { // NOSONAR
csNodeService = new CSNodeServiceImpl();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ private CSResourceService() {}

public static CSResourceService getInstance() {
if (null == csResourceService) { // NOSONAR
synchronized (CSResourceService.class) {
if (null == csResourceService) {
synchronized (CSResourceService.class) { // NOSONAR
if (null == csResourceService) { // NOSONAR
csResourceService = new CSResourceService();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ private CSResultDataServiceImpl() {}

public static CSResultDataService getInstance() {
if (null == csResultDataService) { // NOSONAR
synchronized (CSResultDataServiceImpl.class) {
if (null == csResultDataService) {
synchronized (CSResultDataServiceImpl.class) { // NOSONAR
if (null == csResultDataService) { // NOSONAR
csResultDataService = new CSResultDataServiceImpl();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ private CSTableService() {}

public static CSTableService getInstance() {
if (null == csTableService) { // NOSONAR
synchronized (CSTableService.class) {
if (null == csTableService) {
synchronized (CSTableService.class) { // NOSONAR
if (null == csTableService) { // NOSONAR
csTableService = new CSTableService();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public void putVariable(String contextIDStr, String contextKeyStr, LinkisVariabl

public static CSVariableService getInstance() {
if (null == csVariableService) { // NOSONAR
synchronized (CSVariableService.class) {
if (null == csVariableService) {
synchronized (CSVariableService.class) { // NOSONAR
if (null == csVariableService) { // NOSONAR
csVariableService = new CSVariableService();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ private CSWorkServiceImpl() {}

public static CSWorkService getInstance() {
if (null == csWorkService) { // NOSONAR
synchronized (CSWorkServiceImpl.class) {
if (null == csWorkService) {
synchronized (CSWorkServiceImpl.class) { // NOSONAR
if (null == csWorkService) { // NOSONAR
csWorkService = new CSWorkServiceImpl();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ private ContextHistoryClientServiceImpl() {}

public static ContextHistoryClientService getInstance() {
if (null == contextHistoryClientService) { // NOSONAR
synchronized (ContextHistoryClientServiceImpl.class) {
if (null == contextHistoryClientService) {
synchronized (ContextHistoryClientServiceImpl.class) { // NOSONAR
if (null == contextHistoryClientService) { // NOSONAR
contextHistoryClientService = new ContextHistoryClientServiceImpl();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ public <T> List<ContextKeyValue> searchUpstreamKeyValue(

public static SearchService getInstance() {
if (null == searchService) { // SONAR
synchronized (DefaultSearchService.class) {
if (null == searchService) {
synchronized (DefaultSearchService.class) { // NOSONAR
if (null == searchService) { // NOSONAR
searchService = new DefaultSearchService();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ private LinkisJobDataServiceImpl() {}

public static LinkisJobDataService getInstance() {
if (null == linkisJobDataService) { // NOSONAR
synchronized (LinkisJobDataServiceImpl.class) {
if (null == linkisJobDataService) {
synchronized (LinkisJobDataServiceImpl.class) { // NOSONAR
if (null == linkisJobDataService) { // NOSONAR
linkisJobDataService = new LinkisJobDataServiceImpl();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public class LinkisErrorCodeHandler

public static LinkisErrorCodeHandler getInstance() {
if (null == linkisErrorCodeHandler) { // NOSONAR
synchronized (LinkisErrorCodeHandler.class) {
if (null == linkisErrorCodeHandler) {
synchronized (LinkisErrorCodeHandler.class) { // NOSONAR
if (null == linkisErrorCodeHandler) { // NOSONAR
linkisErrorCodeHandler = new LinkisErrorCodeHandler();
}
}
Expand Down
Loading
Loading