GitHub PullRequestReviewCommentEvent at 2014-09-11 11:57:43
Repository: contentconnector
Actor: wigentics
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/comments/17416646","id":17416646,"diff_hunk":"@@ -0,0 +1,85 @@\n+package com.gentics.cr.lucene.search.collector;\n+\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * 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,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+import org.apache.lucene.util.PriorityQueue;\n+\n+final class LanguageHitQueue extends PriorityQueue<LanguageScoreDoc> {\n+\n+  private boolean prePopulate;\n+\n+  /**\n+   * Creates a new instance with <code>size</code> elements. If\n+   * <code>prePopulate</code> is set to true, the queue will pre-populate itself\n+   * with sentinel objects and set its {@link #size()} to <code>size</code>. In\n+   * that case, you should not rely on {@link #size()} to get the number of\n+   * actual elements that were added to the queue, but keep track yourself.<br>\n+   * <b>NOTE:</b> in case <code>prePopulate</code> is true, you should pop\n+   * elements from the queue using the following code example:\n+   * \n+   * <pre>\n+   * PriorityQueue pq = new HitQueue(10, true); // pre-populate.\n+   * ScoreDoc top = pq.top();\n+   * \n+   * // Add/Update one element.\n+   * top.score = 1.0f;\n+   * top.doc = 0;\n+   * top = (ScoreDoc) pq.updateTop();\n+   * int totalHits = 1;\n+   * \n+   * // Now pop only the elements that were *truly* inserted.\n+   * // First, pop all the sentinel elements (there are pq.size() - totalHits).\n+   * for (int i = pq.size() - totalHits; i &gt; 0; i--) pq.pop();\n+   * \n+   * // Now pop the truly added elements.\n+   * ScoreDoc[] results = new ScoreDoc[totalHits];\n+   * for (int i = totalHits - 1; i &gt;= 0; i--) {\n+   *   results[i] = (ScoreDoc) pq.pop();\n+   * }\n+   * </pre>\n+   * \n+   * <p><b>NOTE</b>: This class pre-allocate a full array of\n+   * length <code>size</code>.\n+   * \n+   * @param size\n+   *          the requested size of this queue.\n+   * @param prePopulate\n+   *          specifies whether to pre-populate the queue with sentinel values.\n+   * @see #getSentinelObject()\n+   */\n+  LanguageHitQueue(int size, boolean prePopulate) {\n+\tsuper(size,prePopulate);\n+  }\n+\n+  // Returns null if prePopulate is false.\n+  @Override\n+  protected LanguageScoreDoc getSentinelObject() {\n+    // Always set the doc Id to MAX_VALUE so that it won't be favored by\n+    // lessThan. This generally should not happen since if score is not NEG_INF,\n+    // TopScoreDocCollector will always add the object to the queue.\n+    return new LanguageScoreDoc(Integer.MAX_VALUE, Float.NEGATIVE_INFINITY, null);\n+  }\n+  \n+  @Override\n+  protected final boolean lessThan(LanguageScoreDoc hitA, LanguageScoreDoc hitB) {\n+    if (hitA.score == hitB.score)\n+      return hitA.doc > hitB.doc; ","path":"contentconnector-lucene/src/main/java/com/gentics/cr/lucene/search/collector/LanguageHitQueue.java","position":81,"original_position":81,"commit_id":"a4c1b179da71d290f3135eb4c530652d8a86e632","original_commit_id":"a4c1b179da71d290f3135eb4c530652d8a86e632","user":{"login":"wigentics","id":4445789,"avatar_url":"https://avatars.githubusercontent.com/u/4445789?v=2","gravatar_id":"7cf9c6043594713737c93861d94c8a4e","url":"https://api.github.com/users/wigentics","html_url":"https://github.com/wigentics","followers_url":"https://api.github.com/users/wigentics/followers","following_url":"https://api.github.com/users/wigentics/following{/other_user}","gists_url":"https://api.github.com/users/wigentics/gists{/gist_id}","starred_url":"https://api.github.com/users/wigentics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wigentics/subscriptions","organizations_url":"https://api.github.com/users/wigentics/orgs","repos_url":"https://api.github.com/users/wigentics/repos","events_url":"https://api.github.com/users/wigentics/events{/privacy}","received_events_url":"https://api.github.com/users/wigentics/received_events","type":"User","site_admin":false},"body":"Hat das eh keine unerwünschten Nebenwirkungen? Wenn ich das richtig verstanden habe, wirft es tendenziell jüngere docs lieber aus der queue als ältere...","created_at":"2014-09-11T11:57:43Z","updated_at":"2014-09-11T11:57:43Z","html_url":"https://github.com/gtxcontentconnector/contentconnector/pull/28#discussion_r17416646","pull_request_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/comments/17416646"},"html":{"href":"https://github.com/gtxcontentconnector/contentconnector/pull/28#discussion_r17416646"},"pull_request":{"href":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/28","id":21074447,"html_url":"https://github.com/gtxcontentconnector/contentconnector/pull/28","diff_url":"https://github.com/gtxcontentconnector/contentconnector/pull/28.diff","patch_url":"https://github.com/gtxcontentconnector/contentconnector/pull/28.patch","issue_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues/28","number":28,"state":"open","locked":false,"title":"Fr ers additions","user":{"login":"wigentics","id":4445789,"avatar_url":"https://avatars.githubusercontent.com/u/4445789?v=2","gravatar_id":"7cf9c6043594713737c93861d94c8a4e","url":"https://api.github.com/users/wigentics","html_url":"https://github.com/wigentics","followers_url":"https://api.github.com/users/wigentics/followers","following_url":"https://api.github.com/users/wigentics/following{/other_user}","gists_url":"https://api.github.com/users/wigentics/gists{/gist_id}","starred_url":"https://api.github.com/users/wigentics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wigentics/subscriptions","organizations_url":"https://api.github.com/users/wigentics/orgs","repos_url":"https://api.github.com/users/wigentics/repos","events_url":"https://api.github.com/users/wigentics/events{/privacy}","received_events_url":"https://api.github.com/users/wigentics/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-09-11T08:59:54Z","updated_at":"2014-09-11T11:57:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae6d7a03d05b75c76bb49ce2f183d99b5ba3b4a0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/28/commits","review_comments_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/28/comments","review_comment_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/comments/{number}","comments_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues/28/comments","statuses_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/statuses/a4c1b179da71d290f3135eb4c530652d8a86e632","head":{"label":"gtxcontentconnector:fr-ers-additions","ref":"fr-ers-additions","sha":"a4c1b179da71d290f3135eb4c530652d8a86e632","user":{"login":"gtxcontentconnector","id":3840954,"avatar_url":"https://avatars.githubusercontent.com/u/3840954?v=2","gravatar_id":"ca6ddc70c3078f2d7b36e631a5b5facf","url":"https://api.github.com/users/gtxcontentconnector","html_url":"https://github.com/gtxcontentconnector","followers_url":"https://api.github.com/users/gtxcontentconnector/followers","following_url":"https://api.github.com/users/gtxcontentconnector/following{/other_user}","gists_url":"https://api.github.com/users/gtxcontentconnector/gists{/gist_id}","starred_url":"https://api.github.com/users/gtxcontentconnector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtxcontentconnector/subscriptions","organizations_url":"https://api.github.com/users/gtxcontentconnector/orgs","repos_url":"https://api.github.com/users/gtxcontentconnector/repos","events_url":"https://api.github.com/users/gtxcontentconnector/events{/privacy}","received_events_url":"https://api.github.com/users/gtxcontentconnector/received_events","type":"Organization","site_admin":false},"repo":{"id":8747691,"name":"contentconnector","full_name":"gtxcontentconnector/contentconnector","owner":{"login":"gtxcontentconnector","id":3840954,"avatar_url":"https://avatars.githubusercontent.com/u/3840954?v=2","gravatar_id":"ca6ddc70c3078f2d7b36e631a5b5facf","url":"https://api.github.com/users/gtxcontentconnector","html_url":"https://github.com/gtxcontentconnector","followers_url":"https://api.github.com/users/gtxcontentconnector/followers","following_url":"https://api.github.com/users/gtxcontentconnector/following{/other_user}","gists_url":"https://api.github.com/users/gtxcontentconnector/gists{/gist_id}","starred_url":"https://api.github.com/users/gtxcontentconnector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtxcontentconnector/subscriptions","organizations_url":"https://api.github.com/users/gtxcontentconnector/orgs","repos_url":"https://api.github.com/users/gtxcontentconnector/repos","events_url":"https://api.github.com/users/gtxcontentconnector/events{/privacy}","received_events_url":"https://api.github.com/users/gtxcontentconnector/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gtxcontentconnector/contentconnector","description":"The Gentics Content Connector provides a simple solution to serve content from a Gentics Content Repository and other Datasources. The Suite is intended (but not limited) to be used for web applications and when used in servlets or portlets it maxes out the benefits of the given environment.","fork":false,"url":"https://api.github.com/repos/gtxcontentconnector/contentconnector","forks_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/forks","keys_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/teams","hooks_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/hooks","issue_events_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues/events{/number}","events_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/events","assignees_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/assignees{/user}","branches_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/branches{/branch}","tags_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/tags","blobs_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/refs{/sha}","trees_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/statuses/{sha}","languages_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/languages","stargazers_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/stargazers","contributors_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/contributors","subscribers_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/subscribers","subscription_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/subscription","commits_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/commits{/sha}","git_commits_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/commits{/sha}","comments_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/comments{/number}","issue_comment_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues/comments/{number}","contents_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/contents/{+path}","compare_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/merges","archive_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/downloads","issues_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues{/number}","pulls_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls{/number}","milestones_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/milestones{/number}","notifications_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/labels{/name}","releases_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/releases{/id}","created_at":"2013-03-13T08:07:38Z","updated_at":"2014-06-18T13:36:25Z","pushed_at":"2014-09-11T10:49:54Z","git_url":"git://github.com/gtxcontentconnector/contentconnector.git","ssh_url":"git@github.com:gtxcontentconnector/contentconnector.git","clone_url":"https://github.com/gtxcontentconnector/contentconnector.git","svn_url":"https://github.com/gtxcontentconnector/contentconnector","homepage":null,"size":57224,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":9,"mirror_url":null,"open_issues_count":6,"forks":9,"open_issues":6,"watchers":2,"default_branch":"master"}},"base":{"label":"gtxcontentconnector:dev","ref":"dev","sha":"400dbf31e81cf7857e6fe03cae54eb2089973916","user":{"login":"gtxcontentconnector","id":3840954,"avatar_url":"https://avatars.githubusercontent.com/u/3840954?v=2","gravatar_id":"ca6ddc70c3078f2d7b36e631a5b5facf","url":"https://api.github.com/users/gtxcontentconnector","html_url":"https://github.com/gtxcontentconnector","followers_url":"https://api.github.com/users/gtxcontentconnector/followers","following_url":"https://api.github.com/users/gtxcontentconnector/following{/other_user}","gists_url":"https://api.github.com/users/gtxcontentconnector/gists{/gist_id}","starred_url":"https://api.github.com/users/gtxcontentconnector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtxcontentconnector/subscriptions","organizations_url":"https://api.github.com/users/gtxcontentconnector/orgs","repos_url":"https://api.github.com/users/gtxcontentconnector/repos","events_url":"https://api.github.com/users/gtxcontentconnector/events{/privacy}","received_events_url":"https://api.github.com/users/gtxcontentconnector/received_events","type":"Organization","site_admin":false},"repo":{"id":8747691,"name":"contentconnector","full_name":"gtxcontentconnector/contentconnector","owner":{"login":"gtxcontentconnector","id":3840954,"avatar_url":"https://avatars.githubusercontent.com/u/3840954?v=2","gravatar_id":"ca6ddc70c3078f2d7b36e631a5b5facf","url":"https://api.github.com/users/gtxcontentconnector","html_url":"https://github.com/gtxcontentconnector","followers_url":"https://api.github.com/users/gtxcontentconnector/followers","following_url":"https://api.github.com/users/gtxcontentconnector/following{/other_user}","gists_url":"https://api.github.com/users/gtxcontentconnector/gists{/gist_id}","starred_url":"https://api.github.com/users/gtxcontentconnector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtxcontentconnector/subscriptions","organizations_url":"https://api.github.com/users/gtxcontentconnector/orgs","repos_url":"https://api.github.com/users/gtxcontentconnector/repos","events_url":"https://api.github.com/users/gtxcontentconnector/events{/privacy}","received_events_url":"https://api.github.com/users/gtxcontentconnector/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gtxcontentconnector/contentconnector","description":"The Gentics Content Connector provides a simple solution to serve content from a Gentics Content Repository and other Datasources. The Suite is intended (but not limited) to be used for web applications and when used in servlets or portlets it maxes out the benefits of the given environment.","fork":false,"url":"https://api.github.com/repos/gtxcontentconnector/contentconnector","forks_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/forks","keys_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/teams","hooks_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/hooks","issue_events_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues/events{/number}","events_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/events","assignees_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/assignees{/user}","branches_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/branches{/branch}","tags_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/tags","blobs_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/refs{/sha}","trees_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/statuses/{sha}","languages_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/languages","stargazers_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/stargazers","contributors_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/contributors","subscribers_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/subscribers","subscription_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/subscription","commits_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/commits{/sha}","git_commits_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/git/commits{/sha}","comments_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/comments{/number}","issue_comment_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues/comments/{number}","contents_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/contents/{+path}","compare_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/merges","archive_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/downloads","issues_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues{/number}","pulls_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls{/number}","milestones_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/milestones{/number}","notifications_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/labels{/name}","releases_url":"https://api.github.com/repos/gtxcontentconnector/contentconnector/releases{/id}","created_at":"2013-03-13T08:07:38Z","updated_at":"2014-06-18T13:36:25Z","pushed_at":"2014-09-11T10:49:54Z","git_url":"git://github.com/gtxcontentconnector/contentconnector.git","ssh_url":"git@github.com:gtxcontentconnector/contentconnector.git","clone_url":"https://github.com/gtxcontentconnector/contentconnector.git","svn_url":"https://github.com/gtxcontentconnector/contentconnector","homepage":null,"size":57224,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":9,"mirror_url":null,"open_issues_count":6,"forks":9,"open_issues":6,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/28"},"html":{"href":"https://github.com/gtxcontentconnector/contentconnector/pull/28"},"issue":{"href":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues/28"},"comments":{"href":"https://api.github.com/repos/gtxcontentconnector/contentconnector/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/gtxcontentconnector/contentconnector/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/gtxcontentconnector/contentconnector/statuses/a4c1b179da71d290f3135eb4c530652d8a86e632"}}}}