-
Notifications
You must be signed in to change notification settings - Fork 82
Configure number of thread used by Netty base RESTCONF #2576
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,8 @@ public class NettyRestConfConfiguration { | |
| private InetAddress inetAddress = InetAddress.getLoopbackAddress(); | ||
| private int httpPort = 8888; | ||
| private String restconfServletContextPath = "restconf"; | ||
| private String groupName = "lighty-netty-worker"; //use as default | ||
| private int workThreads = 0; //default 0 which is ODL netconf default allowing to use Netty default | ||
|
|
||
| public NettyRestConfConfiguration() { | ||
| } | ||
|
|
@@ -49,6 +51,7 @@ public NettyRestConfConfiguration(final NettyRestConfConfiguration restConfConfi | |
| this.domActionService = restConfConfiguration.getDomActionService(); | ||
| this.domNotificationService = restConfConfiguration.getDomNotificationService(); | ||
| this.domMountPointService = restConfConfiguration.getDomMountPointService(); | ||
| this.workThreads = restConfConfiguration.getWorkThreads(); | ||
| } | ||
|
|
||
| public NettyRestConfConfiguration(final DOMDataBroker domDataBroker, final DOMSchemaService schemaService, | ||
|
|
@@ -62,6 +65,26 @@ public NettyRestConfConfiguration(final DOMDataBroker domDataBroker, final DOMSc | |
| this.domMountPointService = domMountPointService; | ||
| } | ||
|
|
||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why empty line? |
||
| public int getWorkThreads() { | ||
| return workThreads; | ||
| } | ||
|
|
||
| public void setWorkThreads(int workThreads) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. final |
||
| if (workThreads < 0) { | ||
| throw new IllegalArgumentException("workThreads cannot be negative"); | ||
| } | ||
| this.workThreads = workThreads; | ||
| } | ||
Tobianas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public String getGroupName() { | ||
| return groupName; | ||
| } | ||
|
|
||
| public void setGroupName(String groupName) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. final |
||
| this.groupName = groupName; | ||
| } | ||
|
|
||
| public InetAddress getInetAddress() { | ||
| return this.inetAddress; | ||
| } | ||
|
|
@@ -147,13 +170,15 @@ public boolean equals(final Object obj) { | |
| && Objects.equals(domNotificationService, that.domNotificationService) | ||
| && Objects.equals(domMountPointService, that.domMountPointService) | ||
| && Objects.equals(inetAddress, that.inetAddress) | ||
| && Objects.equals(restconfServletContextPath, that.restconfServletContextPath); | ||
| && Objects.equals(restconfServletContextPath, that.restconfServletContextPath) | ||
| && Objects.equals(groupName, that.groupName) | ||
| && Objects.equals(workThreads, that.workThreads); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(domDataBroker, schemaService, domRpcService, domActionService, domNotificationService, | ||
| domMountPointService, inetAddress, httpPort, restconfServletContextPath); | ||
| domMountPointService, inetAddress, httpPort, restconfServletContextPath, groupName, workThreads); | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not Java style comment, and comments have no meaning IMO