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

Code alarm processing & Fix the bug #3192,#3167 #3224

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

liuweiGit
Copy link

@liuweiGit liuweiGit commented Sep 5, 2023

Describe what this PR does / why we need it

Cleared DefaultClusterTokenClient. Java code alarm & repair LogBase. Java bug modify test cases, Repair FileWritableDataSource. Java bug modified FileDataSourceInit. Java increase test code

Does this pull request fix one issue?

#3192 #3167

Describe how you did it

Some code has been modified, see the following code for details

LogBase.java

Private constructors

Before the repair code:

    String logLevelString = properties.getProperty(LOG_LEVEL);
    if (logLevelString != null && (logLevelString = logLevelString.trim()).length() > 0) {
        try {
            logLevel = Level.parse(logLevelString);
        } catch (IllegalArgumentException e) {
            System.out.println("Log level : " + logLevel + " is invalid. Use default : " + LOG_DEFAULT_LEVEL.toString());
        }
    }
    System.out.println("INFO: Sentinel log level is: " + logLevel);

After the repair code:

    String logLevelString = properties.getProperty(LOG_LEVEL);
    if (logLevelString != null && (logLevelString = logLevelString.trim()).length() > 0) {
        try {
            logLevel = Level.parse(logLevelString);
        } catch (IllegalArgumentException e) {
            System.out.printf("Log level : %s is invalid. Use default : %s%n", logLevelString, logLevel);
        }
    }
    System.out.printf("INFO: Sentinel log level is: %s%n", logLevel);

FileWritableDataSource.java

Before the repair code:

public FileWritableDataSource(File file, Converter<T, String> configEncoder) {
    this(file, configEncoder, DEFAULT_CHARSET);
}

After the repair code:

public FileWritableDataSource(File file, Converter<T, String> configEncoder) {
    this(file, configEncoder, DEFAULT_CHARSET);
    File dir = file.getParentFile();
    if (!Files.exists(dir.toPath())) {
        dir.mkdirs();
    }
}

Describe how to verify it

LogBaseTest.testLoadProperties()
FileDataSourceInit.main();

Special notes for reviews

@CLAassistant
Copy link

CLAassistant commented Sep 5, 2023

CLA assistant check
All committers have signed the CLA.

@liuweiGit liuweiGit changed the title Code alarm processing Code alarm processing & Fix the bug #3192 Sep 7, 2023
@liuweiGit liuweiGit changed the title Code alarm processing & Fix the bug #3192 Code alarm processing & Fix the bug #3192,#3167 Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants