-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update docean java21 (#765)
- Loading branch information
Showing
31 changed files
with
82 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
jcommon/docean/src/main/java/com/xiaomi/youpin/docean/mvc/common/MvcConst.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package com.xiaomi.youpin.docean.mvc.common; | ||
|
||
import com.xiaomi.youpin.docean.mvc.MvcContext; | ||
import jdk.incubator.concurrent.ScopedValue; | ||
|
||
/** | ||
* @author [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,10 @@ | |
* @author [email protected] | ||
*/ | ||
@Slf4j | ||
public class LogFile implements ILogFile{ | ||
public class LogFile implements ILogFile { | ||
|
||
@Getter | ||
private String file; | ||
private String file; | ||
|
||
private MoneRandomAccessFile raf; | ||
|
||
|
@@ -38,13 +38,15 @@ public class LogFile implements ILogFile{ | |
@Getter | ||
private int beforePointerHashCode; | ||
|
||
private long pointer; | ||
@Getter | ||
private volatile long pointer; | ||
|
||
//行号 | ||
private long lineNumber; | ||
|
||
//每次读取时文件的最大偏移量 | ||
private long maxPointer; | ||
@Getter | ||
private volatile long maxPointer; | ||
|
||
private String md5; | ||
|
||
|
@@ -71,14 +73,14 @@ public LogFile(String file, ReadListener listener, long pointer, long lineNumber | |
|
||
private void open() { | ||
try { | ||
//日志文件进行切分时,减少FileNotFoundException概率 | ||
TimeUnit.SECONDS.sleep(5); | ||
//日志文件进行切分时,减少FileNotFoundException概率,这个应该删掉了,在使用前保证就好了,由于历史原因,降低了休眠时间 | ||
// TimeUnit.SECONDS.sleep(1); | ||
//4kb | ||
this.raf = new MoneRandomAccessFile(file, "r", 1024 * 4); | ||
reOpen = false; | ||
reFresh = false; | ||
} catch (InterruptedException e) { | ||
log.error("open file InterruptedException", e); | ||
// } catch (InterruptedException e) { | ||
// log.error("open file InterruptedException", e); | ||
} catch (FileNotFoundException e) { | ||
log.error("open file FileNotFoundException", e); | ||
} catch (IOException e) { | ||
|
@@ -238,7 +240,7 @@ public String md5(String msg) { | |
md.update(msg.getBytes()); | ||
byte[] digest = md.digest(); | ||
StringBuilder sb = new StringBuilder(2 * digest.length); | ||
for(byte b : digest) { | ||
for (byte b : digest) { | ||
sb.append(String.format("%02x", b & 0xff)); | ||
} | ||
return sb.toString().toUpperCase(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.