{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/comments/120349409","pull_request_review_id":42303590,"id":120349409,"diff_hunk":"@@ -175,6 +175,18 @@ private MySQLGuacamoleProperties() {}\n     };\n \n     /**\n+     * The connection weight for connections in balancing groups.","path":"extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/java/org/apache/guacamole/auth/mysql/MySQLGuacamoleProperties.java","position":null,"original_position":4,"commit_id":"2986c616906c1a606c215594283060409f85c5a6","original_commit_id":"955d5fb11f861f0476741a950cbb064150ae9bd4","user":{"login":"necouchman","id":4706000,"avatar_url":"https://avatars0.githubusercontent.com/u/4706000?v=3","gravatar_id":"","url":"https://api.github.com/users/necouchman","html_url":"https://github.com/necouchman","followers_url":"https://api.github.com/users/necouchman/followers","following_url":"https://api.github.com/users/necouchman/following{/other_user}","gists_url":"https://api.github.com/users/necouchman/gists{/gist_id}","starred_url":"https://api.github.com/users/necouchman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/necouchman/subscriptions","organizations_url":"https://api.github.com/users/necouchman/orgs","repos_url":"https://api.github.com/users/necouchman/repos","events_url":"https://api.github.com/users/necouchman/events{/privacy}","received_events_url":"https://api.github.com/users/necouchman/received_events","type":"User","site_admin":false},"body":"Removed.","created_at":"2017-06-06T12:53:04Z","updated_at":"2017-06-06T12:53:04Z","html_url":"https://github.com/apache/incubator-guacamole-client/pull/161#discussion_r120349409","pull_request_url":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/161","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/comments/120349409"},"html":{"href":"https://github.com/apache/incubator-guacamole-client/pull/161#discussion_r120349409"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/161"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/161","id":123405458,"html_url":"https://github.com/apache/incubator-guacamole-client/pull/161","diff_url":"https://github.com/apache/incubator-guacamole-client/pull/161.diff","patch_url":"https://github.com/apache/incubator-guacamole-client/pull/161.patch","issue_url":"https://api.github.com/repos/apache/incubator-guacamole-client/issues/161","number":161,"state":"open","locked":false,"title":"GUACAMOLE-102: Support Connection Load Balancing","user":{"login":"necouchman","id":4706000,"avatar_url":"https://avatars0.githubusercontent.com/u/4706000?v=3","gravatar_id":"","url":"https://api.github.com/users/necouchman","html_url":"https://github.com/necouchman","followers_url":"https://api.github.com/users/necouchman/followers","following_url":"https://api.github.com/users/necouchman/following{/other_user}","gists_url":"https://api.github.com/users/necouchman/gists{/gist_id}","starred_url":"https://api.github.com/users/necouchman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/necouchman/subscriptions","organizations_url":"https://api.github.com/users/necouchman/orgs","repos_url":"https://api.github.com/users/necouchman/repos","events_url":"https://api.github.com/users/necouchman/events{/privacy}","received_events_url":"https://api.github.com/users/necouchman/received_events","type":"User","site_admin":false},"body":"Okay, this is a LONG shot, but I've taken a stab at a basic implementation of a weighted load balancing algorithm in the Guacamole client.  This is likely to need a lot of work before it's actually ready for merging - I'm acknowledging that up-front :-).\r\n\r\nThis adds the table column for the connection weight into the DB schema, the necessary JDBC calls to grab, set, and update connection weight, and then the updates to the compare function to sort connections based on a \"Weighted Least Connection\" algorithm.\r\n\r\nThe algorithm itself has some nuances that are worth describing.  First, I tried to incorporate as much of what was discussed in the JIRA issue as possible.  Not setting the weight is acceptable, and will result in the algorithm calculating based on a weight of 1 when no weight is explicitly assigned.  I don't know if this is ideal, but kind of necessary to do something like this when doing a WLC calculation.  Weights of 0 and negative values cause the connection to be eliminated from the group - the thought is that these values can be used when updating weights externally/dynamically to denote systems that have not been polled yet (0) or that are administratively disabled (-1, etc.).  For the purposes of sorting the connections, the 0 and negative values are also replaced with a 1 so that the compare function works as expected, but are those connections will later be bypassed by the acquire() method.\r\n\r\nThe compare() method now adds one to the number of active connections of both items during comparison in order to avoid a zero value.  The rationale behind this is that it allows servers with higher weights and zero connections to be preferred over servers with lower weights and zero connections - without this addition anything with zero connections will end up basically equivalent regardless of its configured weight rather than actually being evaluated by weight.\r\n\r\nThe overall algorithm was taken from a combination of the LVS wiki page describing how they do WLC and a Citrix article on WLC connections.\r\n\r\nThis is a pretty simple initial implementation - I have some goals for building upon this in the future, but those are probably better discussed on the JIRA issue and not in this PR.\r\n\r\nFire away...","created_at":"2017-06-01T02:08:21Z","updated_at":"2017-06-06T12:53:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2352cf0ca2de0a591c88ad82f1b118063edaeb2e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/161/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/161/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-guacamole-client/issues/161/comments","statuses_url":"https://api.github.com/repos/apache/incubator-guacamole-client/statuses/2986c616906c1a606c215594283060409f85c5a6","head":{"label":"necouchman:GUACAMOLE-102","ref":"GUACAMOLE-102","sha":"2986c616906c1a606c215594283060409f85c5a6","user":{"login":"necouchman","id":4706000,"avatar_url":"https://avatars0.githubusercontent.com/u/4706000?v=3","gravatar_id":"","url":"https://api.github.com/users/necouchman","html_url":"https://github.com/necouchman","followers_url":"https://api.github.com/users/necouchman/followers","following_url":"https://api.github.com/users/necouchman/following{/other_user}","gists_url":"https://api.github.com/users/necouchman/gists{/gist_id}","starred_url":"https://api.github.com/users/necouchman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/necouchman/subscriptions","organizations_url":"https://api.github.com/users/necouchman/orgs","repos_url":"https://api.github.com/users/necouchman/repos","events_url":"https://api.github.com/users/necouchman/events{/privacy}","received_events_url":"https://api.github.com/users/necouchman/received_events","type":"User","site_admin":false},"repo":{"id":78248317,"name":"incubator-guacamole-client","full_name":"necouchman/incubator-guacamole-client","owner":{"login":"necouchman","id":4706000,"avatar_url":"https://avatars0.githubusercontent.com/u/4706000?v=3","gravatar_id":"","url":"https://api.github.com/users/necouchman","html_url":"https://github.com/necouchman","followers_url":"https://api.github.com/users/necouchman/followers","following_url":"https://api.github.com/users/necouchman/following{/other_user}","gists_url":"https://api.github.com/users/necouchman/gists{/gist_id}","starred_url":"https://api.github.com/users/necouchman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/necouchman/subscriptions","organizations_url":"https://api.github.com/users/necouchman/orgs","repos_url":"https://api.github.com/users/necouchman/repos","events_url":"https://api.github.com/users/necouchman/events{/privacy}","received_events_url":"https://api.github.com/users/necouchman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/necouchman/incubator-guacamole-client","description":"Mirror of Apache Guacamole Client (Incubating)","fork":true,"url":"https://api.github.com/repos/necouchman/incubator-guacamole-client","forks_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/forks","keys_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/teams","hooks_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/hooks","issue_events_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/issues/events{/number}","events_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/events","assignees_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/assignees{/user}","branches_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/branches{/branch}","tags_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/tags","blobs_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/statuses/{sha}","languages_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/languages","stargazers_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/stargazers","contributors_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/contributors","subscribers_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/subscribers","subscription_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/subscription","commits_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/contents/{+path}","compare_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/merges","archive_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/downloads","issues_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/issues{/number}","pulls_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/pulls{/number}","milestones_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/milestones{/number}","notifications_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/labels{/name}","releases_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/releases{/id}","deployments_url":"https://api.github.com/repos/necouchman/incubator-guacamole-client/deployments","created_at":"2017-01-07T00:10:55Z","updated_at":"2017-02-08T03:57:38Z","pushed_at":"2017-06-06T12:50:35Z","git_url":"git://github.com/necouchman/incubator-guacamole-client.git","ssh_url":"git@github.com:necouchman/incubator-guacamole-client.git","clone_url":"https://github.com/necouchman/incubator-guacamole-client.git","svn_url":"https://github.com/necouchman/incubator-guacamole-client","homepage":"","size":16193,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"91920d0b2d806de1a32908fa528b51ceb9068288","user":{"login":"apache","id":47359,"avatar_url":"https://avatars3.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":54452622,"name":"incubator-guacamole-client","full_name":"apache/incubator-guacamole-client","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars3.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-guacamole-client","description":"Mirror of Apache Guacamole Client (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-guacamole-client","forks_url":"https://api.github.com/repos/apache/incubator-guacamole-client/forks","keys_url":"https://api.github.com/repos/apache/incubator-guacamole-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-guacamole-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-guacamole-client/teams","hooks_url":"https://api.github.com/repos/apache/incubator-guacamole-client/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-guacamole-client/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-guacamole-client/events","assignees_url":"https://api.github.com/repos/apache/incubator-guacamole-client/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-guacamole-client/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-guacamole-client/tags","blobs_url":"https://api.github.com/repos/apache/incubator-guacamole-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-guacamole-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-guacamole-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-guacamole-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-guacamole-client/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-guacamole-client/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-guacamole-client/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-guacamole-client/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-guacamole-client/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-guacamole-client/subscription","commits_url":"https://api.github.com/repos/apache/incubator-guacamole-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-guacamole-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-guacamole-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-guacamole-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-guacamole-client/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-guacamole-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-guacamole-client/merges","archive_url":"https://api.github.com/repos/apache/incubator-guacamole-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-guacamole-client/downloads","issues_url":"https://api.github.com/repos/apache/incubator-guacamole-client/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-guacamole-client/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-guacamole-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-guacamole-client/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-guacamole-client/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-guacamole-client/deployments","created_at":"2016-03-22T07:00:06Z","updated_at":"2017-06-06T08:51:48Z","pushed_at":"2017-06-06T12:50:37Z","git_url":"git://github.com/apache/incubator-guacamole-client.git","ssh_url":"git@github.com:apache/incubator-guacamole-client.git","clone_url":"https://github.com/apache/incubator-guacamole-client.git","svn_url":"https://github.com/apache/incubator-guacamole-client","homepage":null,"size":15945,"stargazers_count":227,"watchers_count":227,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":94,"mirror_url":"git://git.apache.org/incubator-guacamole-client.git","open_issues_count":11,"forks":94,"open_issues":11,"watchers":227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/161"},"html":{"href":"https://github.com/apache/incubator-guacamole-client/pull/161"},"issue":{"href":"https://api.github.com/repos/apache/incubator-guacamole-client/issues/161"},"comments":{"href":"https://api.github.com/repos/apache/incubator-guacamole-client/issues/161/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/161/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-guacamole-client/pulls/161/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-guacamole-client/statuses/2986c616906c1a606c215594283060409f85c5a6"}}}}
{"actor":{"display_login":"necouchman"}}