[ server ] [ scheduler ]- script scheduler fix bugs - 1
This commit is contained in:
@@ -21,12 +21,14 @@ import java.util.List;
|
||||
public class LogToArrayListCache {
|
||||
|
||||
// concurrent command execute logs
|
||||
public static List<ArrayList<String>> CachedCommandLog = List.of(
|
||||
new ArrayList<>(256),
|
||||
new ArrayList<>(256),
|
||||
new ArrayList<>(256),
|
||||
new ArrayList<>(256),
|
||||
new ArrayList<>(256)
|
||||
public static List<ArrayList<String>> CachedCommandLog = new ArrayList<>(
|
||||
List.of(
|
||||
new ArrayList<>(256),
|
||||
new ArrayList<>(256),
|
||||
new ArrayList<>(256),
|
||||
new ArrayList<>(256),
|
||||
new ArrayList<>(256)
|
||||
)
|
||||
);
|
||||
|
||||
public void cacheLog(String streamKey, Process process) {
|
||||
@@ -69,7 +71,14 @@ public class LogToArrayListCache {
|
||||
return CachedCommandLog.get(keyToIndex);
|
||||
}
|
||||
|
||||
|
||||
private int hashStreamKeyToCachedArrayListIndex(String streamKey) {
|
||||
int size = CachedCommandLog.size();
|
||||
return Math.abs(streamKey.hashCode() % size);
|
||||
}
|
||||
|
||||
|
||||
private int hashStreamKeyToCachedArrayListIndexWithProblem(String streamKey) {
|
||||
|
||||
int size = CachedCommandLog.size();
|
||||
int result = Math.abs(streamKey.hashCode() % size);
|
||||
|
||||
Reference in New Issue
Block a user