GitHub PullRequestReviewCommentEvent at 2014-10-13 11:38:15
Repository: netty
Actor: normanmaurer
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/netty/netty/pulls/comments/18764527","id":18764527,"diff_hunk":"@@ -0,0 +1,645 @@\n+/*\n+ * Copyright 2014 The Netty Project\n+ *\n+ * The Netty Project licenses this file to you under the Apache License,\n+ * version 2.0 (the \"License\"); you may not use this file except in compliance\n+ * with the License. You may obtain a copy of the License at:\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n+ * License for the specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package io.netty.channel.socket.aio;\n+\n+import io.netty.buffer.ByteBuf;\n+import io.netty.buffer.ByteBufAllocator;\n+import io.netty.channel.Channel;\n+import io.netty.channel.ChannelException;\n+import io.netty.channel.ChannelFuture;\n+import io.netty.channel.ChannelMetadata;\n+import io.netty.channel.ChannelOutboundBuffer;\n+import io.netty.channel.ChannelPipeline;\n+import io.netty.channel.ChannelPromise;\n+import io.netty.channel.EventLoop;\n+import io.netty.channel.FileRegion;\n+import io.netty.channel.RecvByteBufAllocator;\n+import io.netty.channel.aio.AbstractAioChannel;\n+import io.netty.channel.aio.AioCompletionHandler;\n+import io.netty.channel.aio.AioEventLoopGroup;\n+import io.netty.channel.socket.ChannelInputShutdownEvent;\n+import io.netty.channel.socket.ServerSocketChannel;\n+import io.netty.channel.socket.SocketChannel;\n+import io.netty.util.internal.StringUtil;\n+\n+import java.io.EOFException;\n+import java.io.IOException;\n+import java.net.InetSocketAddress;\n+import java.net.SocketAddress;\n+import java.nio.ByteBuffer;\n+import java.nio.channels.AsynchronousChannelGroup;\n+import java.nio.channels.AsynchronousCloseException;\n+import java.nio.channels.AsynchronousSocketChannel;\n+import java.nio.channels.ClosedChannelException;\n+import java.nio.channels.CompletionHandler;\n+import java.nio.channels.InterruptedByTimeoutException;\n+import java.nio.channels.WritableByteChannel;\n+import java.util.concurrent.TimeUnit;\n+\n+/**\n+ * {@link SocketChannel} implementation which uses NIO2.\n+ * <p/>\n+ * NIO2 is only supported on Java 7+.\n+ */\n+public class AioSocketChannel extends AbstractAioChannel implements SocketChannel {\n+\n+    private static final ChannelMetadata METADATA = new ChannelMetadata(false);\n+\n+    private static final CompletionHandler<Void, AioSocketChannel> CONNECT_HANDLER = new ConnectHandler();\n+    private static final CompletionHandler<Integer, AioSocketChannel> WRITE_HANDLER = new WriteHandler<Integer>();\n+    private static final CompletionHandler<Integer, AioSocketChannel> READ_HANDLER = new ReadHandler<Integer>();\n+    private static final CompletionHandler<Long, AioSocketChannel> GATHERING_WRITE_HANDLER = new WriteHandler<Long>();\n+    private static final CompletionHandler<Long, AioSocketChannel> SCATTERING_READ_HANDLER = new ReadHandler<Long>();\n+    private static final int NO_WRITE_IN_PROGRESS = 0;\n+    private static final int WRITE_IN_PROGRESS = 1;\n+    private static final int WRITE_FAILED = -2;","path":"transport/src/main/java/io/netty/channel/socket/aio/AioSocketChannel.java","position":68,"original_position":68,"commit_id":"d1de203eb968e5ee52d73735e03b16ec4c63b226","original_commit_id":"d1de203eb968e5ee52d73735e03b16ec4c63b226","user":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=2","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"body":"Please separate the static fields from the non-static to make it easier to read","created_at":"2014-10-13T11:38:15Z","updated_at":"2014-10-13T11:38:15Z","html_url":"https://github.com/netty/netty/pull/2938#discussion_r18764527","pull_request_url":"https://api.github.com/repos/netty/netty/pulls/2938","_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/comments/18764527"},"html":{"href":"https://github.com/netty/netty/pull/2938#discussion_r18764527"},"pull_request":{"href":"https://api.github.com/repos/netty/netty/pulls/2938"}}},"pull_request":{"url":"https://api.github.com/repos/netty/netty/pulls/2938","id":21735904,"html_url":"https://github.com/netty/netty/pull/2938","diff_url":"https://github.com/netty/netty/pull/2938.diff","patch_url":"https://github.com/netty/netty/pull/2938.patch","issue_url":"https://api.github.com/repos/netty/netty/issues/2938","number":2938,"state":"open","locked":false,"title":"Updated AIO transport abandoned in 4.0.CR3 to 4.0.23","user":{"login":"ajayappa","id":8881033,"avatar_url":"https://avatars.githubusercontent.com/u/8881033?v=2","gravatar_id":"","url":"https://api.github.com/users/ajayappa","html_url":"https://github.com/ajayappa","followers_url":"https://api.github.com/users/ajayappa/followers","following_url":"https://api.github.com/users/ajayappa/following{/other_user}","gists_url":"https://api.github.com/users/ajayappa/gists{/gist_id}","starred_url":"https://api.github.com/users/ajayappa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajayappa/subscriptions","organizations_url":"https://api.github.com/users/ajayappa/orgs","repos_url":"https://api.github.com/users/ajayappa/repos","events_url":"https://api.github.com/users/ajayappa/events{/privacy}","received_events_url":"https://api.github.com/users/ajayappa/received_events","type":"User","site_admin":false},"body":"Updated AIO transport abandoned in 4.0.CR3 to 4.0.23 to drastically reduce CPU usage.\r\n\r\nMotivation:\r\n\r\nWe use Netty for several of our production servers and received several complaints about high CPU usage under heavy load on windows OS. So we tried to see if using AIO transport instead of NIO transport would address this. \r\n\r\nModifications:\r\n\r\nUpdated the AIO transport from 4.0.CR3 to 4.0.23, Updated the read() and write() to conform to the API changes in 4.0.23\r\n\r\nResult:\r\n\r\nThe AIO transport consumes significantly less CPU usage under heavy load. We tested against windows 2008 R3. Other parameters like throughput, latency were found to be slightly better than NIO transport.","created_at":"2014-09-24T18:52:39Z","updated_at":"2014-10-13T11:38:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35c0228003b145283ccf4a1ebfe81877f722838f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/netty/netty/pulls/2938/commits","review_comments_url":"https://api.github.com/repos/netty/netty/pulls/2938/comments","review_comment_url":"https://api.github.com/repos/netty/netty/pulls/comments/{number}","comments_url":"https://api.github.com/repos/netty/netty/issues/2938/comments","statuses_url":"https://api.github.com/repos/netty/netty/statuses/d1de203eb968e5ee52d73735e03b16ec4c63b226","head":{"label":"ajayappa:aio_transport","ref":"aio_transport","sha":"d1de203eb968e5ee52d73735e03b16ec4c63b226","user":{"login":"ajayappa","id":8881033,"avatar_url":"https://avatars.githubusercontent.com/u/8881033?v=2","gravatar_id":"","url":"https://api.github.com/users/ajayappa","html_url":"https://github.com/ajayappa","followers_url":"https://api.github.com/users/ajayappa/followers","following_url":"https://api.github.com/users/ajayappa/following{/other_user}","gists_url":"https://api.github.com/users/ajayappa/gists{/gist_id}","starred_url":"https://api.github.com/users/ajayappa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajayappa/subscriptions","organizations_url":"https://api.github.com/users/ajayappa/orgs","repos_url":"https://api.github.com/users/ajayappa/repos","events_url":"https://api.github.com/users/ajayappa/events{/privacy}","received_events_url":"https://api.github.com/users/ajayappa/received_events","type":"User","site_admin":false},"repo":{"id":24426521,"name":"netty","full_name":"ajayappa/netty","owner":{"login":"ajayappa","id":8881033,"avatar_url":"https://avatars.githubusercontent.com/u/8881033?v=2","gravatar_id":"","url":"https://api.github.com/users/ajayappa","html_url":"https://github.com/ajayappa","followers_url":"https://api.github.com/users/ajayappa/followers","following_url":"https://api.github.com/users/ajayappa/following{/other_user}","gists_url":"https://api.github.com/users/ajayappa/gists{/gist_id}","starred_url":"https://api.github.com/users/ajayappa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajayappa/subscriptions","organizations_url":"https://api.github.com/users/ajayappa/orgs","repos_url":"https://api.github.com/users/ajayappa/repos","events_url":"https://api.github.com/users/ajayappa/events{/privacy}","received_events_url":"https://api.github.com/users/ajayappa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ajayappa/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":true,"url":"https://api.github.com/repos/ajayappa/netty","forks_url":"https://api.github.com/repos/ajayappa/netty/forks","keys_url":"https://api.github.com/repos/ajayappa/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ajayappa/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ajayappa/netty/teams","hooks_url":"https://api.github.com/repos/ajayappa/netty/hooks","issue_events_url":"https://api.github.com/repos/ajayappa/netty/issues/events{/number}","events_url":"https://api.github.com/repos/ajayappa/netty/events","assignees_url":"https://api.github.com/repos/ajayappa/netty/assignees{/user}","branches_url":"https://api.github.com/repos/ajayappa/netty/branches{/branch}","tags_url":"https://api.github.com/repos/ajayappa/netty/tags","blobs_url":"https://api.github.com/repos/ajayappa/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ajayappa/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ajayappa/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/ajayappa/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ajayappa/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/ajayappa/netty/languages","stargazers_url":"https://api.github.com/repos/ajayappa/netty/stargazers","contributors_url":"https://api.github.com/repos/ajayappa/netty/contributors","subscribers_url":"https://api.github.com/repos/ajayappa/netty/subscribers","subscription_url":"https://api.github.com/repos/ajayappa/netty/subscription","commits_url":"https://api.github.com/repos/ajayappa/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/ajayappa/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/ajayappa/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/ajayappa/netty/issues/comments/{number}","contents_url":"https://api.github.com/repos/ajayappa/netty/contents/{+path}","compare_url":"https://api.github.com/repos/ajayappa/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ajayappa/netty/merges","archive_url":"https://api.github.com/repos/ajayappa/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ajayappa/netty/downloads","issues_url":"https://api.github.com/repos/ajayappa/netty/issues{/number}","pulls_url":"https://api.github.com/repos/ajayappa/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/ajayappa/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/ajayappa/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ajayappa/netty/labels{/name}","releases_url":"https://api.github.com/repos/ajayappa/netty/releases{/id}","created_at":"2014-09-24T18:05:59Z","updated_at":"2014-09-24T16:33:45Z","pushed_at":"2014-10-02T15:25:38Z","git_url":"git://github.com/ajayappa/netty.git","ssh_url":"git@github.com:ajayappa/netty.git","clone_url":"https://github.com/ajayappa/netty.git","svn_url":"https://github.com/ajayappa/netty","homepage":"http://netty.io/","size":36098,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"netty:4.0","ref":"4.0","sha":"9968c61fbe02ac76d4a49fe60faf2f20f3ccee11","user":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=2","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"repo":{"id":1064563,"name":"netty","full_name":"netty/netty","owner":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=2","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/netty/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":false,"url":"https://api.github.com/repos/netty/netty","forks_url":"https://api.github.com/repos/netty/netty/forks","keys_url":"https://api.github.com/repos/netty/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netty/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netty/netty/teams","hooks_url":"https://api.github.com/repos/netty/netty/hooks","issue_events_url":"https://api.github.com/repos/netty/netty/issues/events{/number}","events_url":"https://api.github.com/repos/netty/netty/events","assignees_url":"https://api.github.com/repos/netty/netty/assignees{/user}","branches_url":"https://api.github.com/repos/netty/netty/branches{/branch}","tags_url":"https://api.github.com/repos/netty/netty/tags","blobs_url":"https://api.github.com/repos/netty/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netty/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netty/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/netty/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netty/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/netty/netty/languages","stargazers_url":"https://api.github.com/repos/netty/netty/stargazers","contributors_url":"https://api.github.com/repos/netty/netty/contributors","subscribers_url":"https://api.github.com/repos/netty/netty/subscribers","subscription_url":"https://api.github.com/repos/netty/netty/subscription","commits_url":"https://api.github.com/repos/netty/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/netty/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/netty/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/netty/netty/issues/comments/{number}","contents_url":"https://api.github.com/repos/netty/netty/contents/{+path}","compare_url":"https://api.github.com/repos/netty/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netty/netty/merges","archive_url":"https://api.github.com/repos/netty/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netty/netty/downloads","issues_url":"https://api.github.com/repos/netty/netty/issues{/number}","pulls_url":"https://api.github.com/repos/netty/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/netty/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/netty/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netty/netty/labels{/name}","releases_url":"https://api.github.com/repos/netty/netty/releases{/id}","created_at":"2010-11-09T09:22:21Z","updated_at":"2014-10-13T09:08:06Z","pushed_at":"2014-10-13T11:28:58Z","git_url":"git://github.com/netty/netty.git","ssh_url":"git@github.com:netty/netty.git","clone_url":"https://github.com/netty/netty.git","svn_url":"https://github.com/netty/netty","homepage":"http://netty.io/","size":118031,"stargazers_count":3605,"watchers_count":3605,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1708,"mirror_url":null,"open_issues_count":188,"forks":1708,"open_issues":188,"watchers":3605,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/2938"},"html":{"href":"https://github.com/netty/netty/pull/2938"},"issue":{"href":"https://api.github.com/repos/netty/netty/issues/2938"},"comments":{"href":"https://api.github.com/repos/netty/netty/issues/2938/comments"},"review_comments":{"href":"https://api.github.com/repos/netty/netty/pulls/2938/comments"},"review_comment":{"href":"https://api.github.com/repos/netty/netty/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/netty/netty/pulls/2938/commits"},"statuses":{"href":"https://api.github.com/repos/netty/netty/statuses/d1de203eb968e5ee52d73735e03b16ec4c63b226"}}}}