forked from futurewei-cloud/alcor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39f7d50
commit ef723ba
Showing
10 changed files
with
117 additions
and
52 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
lib/src/main/java/com/futurewei/alcor/common/exception/DatabaseAddException.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.futurewei.alcor.common.exception; | ||
|
||
public class DatabaseAddException extends Exception { | ||
|
||
public DatabaseAddException (String message) { | ||
super(message); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...net_manager/src/main/java/com/futurewei/alcor/subnet/config/ThreadPoolExecutorConfig.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.futurewei.alcor.subnet.config; | ||
|
||
public class ThreadPoolExecutorConfig { | ||
|
||
public static int corePoolSize = 10; | ||
public static int maximumPoolSize = 20; | ||
public static int KeepAliveTime = 5000; | ||
public static int capacity = 1024; | ||
|
||
} |
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
8 changes: 6 additions & 2 deletions
8
...ubnet_manager/src/main/java/com/futurewei/alcor/subnet/utils/ThreadPoolExecutorUtils.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,14 +1,18 @@ | ||
package com.futurewei.alcor.subnet.utils; | ||
|
||
import com.futurewei.alcor.subnet.config.ThreadPoolExecutorConfig; | ||
import com.google.common.util.concurrent.ThreadFactoryBuilder; | ||
|
||
import java.util.concurrent.LinkedBlockingQueue; | ||
import java.util.concurrent.ThreadPoolExecutor; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
public class ThreadPoolExecutorUtils { | ||
public static final ThreadPoolExecutor SELECT_POOL_EXECUTOR = new ThreadPoolExecutor(10, 20, 5000, | ||
public static final ThreadPoolExecutor SELECT_POOL_EXECUTOR = new ThreadPoolExecutor( | ||
ThreadPoolExecutorConfig.corePoolSize, | ||
ThreadPoolExecutorConfig.maximumPoolSize, | ||
ThreadPoolExecutorConfig.KeepAliveTime, | ||
TimeUnit.MILLISECONDS, | ||
new LinkedBlockingQueue<>(1024), | ||
new LinkedBlockingQueue<>(ThreadPoolExecutorConfig.capacity), | ||
new ThreadFactoryBuilder().setNameFormat("selectThreadPoolExecutor-%d").build()); | ||
} |
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