{"action":"created","comment":{"url":"https://api.github.com/repos/twitter/cassovary/pulls/comments/40829730","id":40829730,"diff_hunk":"@@ -0,0 +1,428 @@\n+package com.twitter.cassovary.util.collections\n+\n+import java.util\n+\n+import it.unimi.dsi.fastutil.ints._\n+import it.unimi.dsi.fastutil.objects._\n+\n+import scala.collection.generic.CanBuildFrom\n+import scala.collection.mutable\n+import scala.{specialized => sp}\n+\n+/**\n+ * Specialized, fast and memory efficient implementation of mutable map.\n+ *\n+ * Provides basic operations only. See [[FastMapWrapper]] for how to use\n+ * it as a [[mutable.Map]].\n+ *\n+ * Use constructor provided in the companion object.\n+ */\n+trait FastMap[@sp(Int, Long, AnyRef) A, @sp(Int, Long, AnyRef) B] {\n+\n+  /**\n+   * Adds key-value pair to the map.\n+   */\n+  def +=(key: A, value: B): this.type\n+\n+  /**\n+   * Removes key-value pair with a given key.\n+   */\n+  def -=(key: A): this.type\n+\n+  /**\n+   * Get is optimized for retrieving elements contained in the Map.\n+   *\n+   * If the element is not in the map, returns `0` of given type (or false, null).\n+   */\n+  def get(key: A): B\n+\n+  def clear(): Unit\n+\n+  def contains(key: A): Boolean\n+\n+  def size(): Int\n+\n+  /**\n+   * Wraps as a [[mutable.Map]].\n+   */\n+  def asScala(): mutable.Map[A, B] = new FastMapWrapper[A, B](this)\n+\n+  /**\n+   * Returns iterator over key, value pairs stored in the map.\n+   *\n+   * Used only inside to conform to Scala's collections.\n+   */\n+  private[collections] def iterator: Iterator[(A, B)]\n+}\n+\n+/**\n+ * Implements incrementing value specified by a given key.\n+ */\n+trait AddTo[@sp(Int, Long, AnyRef) A] {\n+  def addTo(key: A, increment: Int)\n+}\n+\n+/**\n+ * Marks a [[FastMap]] with an iterator that preserves insertion order.\n+ */\n+trait InsertionOrderIterator\n+\n+/**\n+ * Features creation of specialized FastMaps.\n+ */\n+object FastMap {","path":"cassovary-core/src/main/scala/com/twitter/cassovary/util/collections/FastMap.scala","position":73,"original_position":73,"commit_id":"3e86ee5126ef23adda87d4c165191602a33d6ee0","original_commit_id":"3e86ee5126ef23adda87d4c165191602a33d6ee0","user":{"login":"pankajgupta","id":71128,"avatar_url":"https://avatars.githubusercontent.com/u/71128?v=3","gravatar_id":"","url":"https://api.github.com/users/pankajgupta","html_url":"https://github.com/pankajgupta","followers_url":"https://api.github.com/users/pankajgupta/followers","following_url":"https://api.github.com/users/pankajgupta/following{/other_user}","gists_url":"https://api.github.com/users/pankajgupta/gists{/gist_id}","starred_url":"https://api.github.com/users/pankajgupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pankajgupta/subscriptions","organizations_url":"https://api.github.com/users/pankajgupta/orgs","repos_url":"https://api.github.com/users/pankajgupta/repos","events_url":"https://api.github.com/users/pankajgupta/events{/privacy}","received_events_url":"https://api.github.com/users/pankajgupta/received_events","type":"User","site_admin":false},"body":"make this extend FastMapFactory[FastMap] as this object really is a factory\r\nwhere \r\ntrait FastMapFactory[MapType[A,B] <: FastMap[A,B]] { def apply[@sp(...) A,@sp(...) B](): MapType }\r\n\r\nKind of like scala/collection/Map.scala and scala/collection/generic/MapFactory.scala","created_at":"2015-09-30T18:14:09Z","updated_at":"2015-09-30T18:14:09Z","html_url":"https://github.com/twitter/cassovary/pull/205#discussion_r40829730","pull_request_url":"https://api.github.com/repos/twitter/cassovary/pulls/205","_links":{"self":{"href":"https://api.github.com/repos/twitter/cassovary/pulls/comments/40829730"},"html":{"href":"https://github.com/twitter/cassovary/pull/205#discussion_r40829730"},"pull_request":{"href":"https://api.github.com/repos/twitter/cassovary/pulls/205"}}},"pull_request":{"url":"https://api.github.com/repos/twitter/cassovary/pulls/205","id":46130980,"html_url":"https://github.com/twitter/cassovary/pull/205","diff_url":"https://github.com/twitter/cassovary/pull/205.diff","patch_url":"https://github.com/twitter/cassovary/pull/205.patch","issue_url":"https://api.github.com/repos/twitter/cassovary/issues/205","number":205,"state":"open","locked":false,"title":"FastMap and FastQueue implementations","user":{"login":"szymonm","id":5087912,"avatar_url":"https://avatars.githubusercontent.com/u/5087912?v=3","gravatar_id":"","url":"https://api.github.com/users/szymonm","html_url":"https://github.com/szymonm","followers_url":"https://api.github.com/users/szymonm/followers","following_url":"https://api.github.com/users/szymonm/following{/other_user}","gists_url":"https://api.github.com/users/szymonm/gists{/gist_id}","starred_url":"https://api.github.com/users/szymonm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szymonm/subscriptions","organizations_url":"https://api.github.com/users/szymonm/orgs","repos_url":"https://api.github.com/users/szymonm/repos","events_url":"https://api.github.com/users/szymonm/events{/privacy}","received_events_url":"https://api.github.com/users/szymonm/received_events","type":"User","site_admin":false},"body":"This commit is a first commit to resolve #66. It introduces Map and\r\nQueue collections that are specialized, use fastutil collections\r\nunderneath and are easy to cast to Scala’s collections (in this case\r\nthey are no longer specialized).","created_at":"2015-09-28T08:28:09Z","updated_at":"2015-09-30T18:14:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twitter/cassovary/pulls/205/commits","review_comments_url":"https://api.github.com/repos/twitter/cassovary/pulls/205/comments","review_comment_url":"https://api.github.com/repos/twitter/cassovary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twitter/cassovary/issues/205/comments","statuses_url":"https://api.github.com/repos/twitter/cassovary/statuses/3e86ee5126ef23adda87d4c165191602a33d6ee0","head":{"label":"szymonm:feature/own-collections","ref":"feature/own-collections","sha":"3e86ee5126ef23adda87d4c165191602a33d6ee0","user":{"login":"szymonm","id":5087912,"avatar_url":"https://avatars.githubusercontent.com/u/5087912?v=3","gravatar_id":"","url":"https://api.github.com/users/szymonm","html_url":"https://github.com/szymonm","followers_url":"https://api.github.com/users/szymonm/followers","following_url":"https://api.github.com/users/szymonm/following{/other_user}","gists_url":"https://api.github.com/users/szymonm/gists{/gist_id}","starred_url":"https://api.github.com/users/szymonm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szymonm/subscriptions","organizations_url":"https://api.github.com/users/szymonm/orgs","repos_url":"https://api.github.com/users/szymonm/repos","events_url":"https://api.github.com/users/szymonm/events{/privacy}","received_events_url":"https://api.github.com/users/szymonm/received_events","type":"User","site_admin":false},"repo":{"id":17590418,"name":"cassovary","full_name":"szymonm/cassovary","owner":{"login":"szymonm","id":5087912,"avatar_url":"https://avatars.githubusercontent.com/u/5087912?v=3","gravatar_id":"","url":"https://api.github.com/users/szymonm","html_url":"https://github.com/szymonm","followers_url":"https://api.github.com/users/szymonm/followers","following_url":"https://api.github.com/users/szymonm/following{/other_user}","gists_url":"https://api.github.com/users/szymonm/gists{/gist_id}","starred_url":"https://api.github.com/users/szymonm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szymonm/subscriptions","organizations_url":"https://api.github.com/users/szymonm/orgs","repos_url":"https://api.github.com/users/szymonm/repos","events_url":"https://api.github.com/users/szymonm/events{/privacy}","received_events_url":"https://api.github.com/users/szymonm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/szymonm/cassovary","description":"Cassovary is a simple big graph processing library for the JVM","fork":true,"url":"https://api.github.com/repos/szymonm/cassovary","forks_url":"https://api.github.com/repos/szymonm/cassovary/forks","keys_url":"https://api.github.com/repos/szymonm/cassovary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/szymonm/cassovary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/szymonm/cassovary/teams","hooks_url":"https://api.github.com/repos/szymonm/cassovary/hooks","issue_events_url":"https://api.github.com/repos/szymonm/cassovary/issues/events{/number}","events_url":"https://api.github.com/repos/szymonm/cassovary/events","assignees_url":"https://api.github.com/repos/szymonm/cassovary/assignees{/user}","branches_url":"https://api.github.com/repos/szymonm/cassovary/branches{/branch}","tags_url":"https://api.github.com/repos/szymonm/cassovary/tags","blobs_url":"https://api.github.com/repos/szymonm/cassovary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/szymonm/cassovary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/szymonm/cassovary/git/refs{/sha}","trees_url":"https://api.github.com/repos/szymonm/cassovary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/szymonm/cassovary/statuses/{sha}","languages_url":"https://api.github.com/repos/szymonm/cassovary/languages","stargazers_url":"https://api.github.com/repos/szymonm/cassovary/stargazers","contributors_url":"https://api.github.com/repos/szymonm/cassovary/contributors","subscribers_url":"https://api.github.com/repos/szymonm/cassovary/subscribers","subscription_url":"https://api.github.com/repos/szymonm/cassovary/subscription","commits_url":"https://api.github.com/repos/szymonm/cassovary/commits{/sha}","git_commits_url":"https://api.github.com/repos/szymonm/cassovary/git/commits{/sha}","comments_url":"https://api.github.com/repos/szymonm/cassovary/comments{/number}","issue_comment_url":"https://api.github.com/repos/szymonm/cassovary/issues/comments{/number}","contents_url":"https://api.github.com/repos/szymonm/cassovary/contents/{+path}","compare_url":"https://api.github.com/repos/szymonm/cassovary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/szymonm/cassovary/merges","archive_url":"https://api.github.com/repos/szymonm/cassovary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/szymonm/cassovary/downloads","issues_url":"https://api.github.com/repos/szymonm/cassovary/issues{/number}","pulls_url":"https://api.github.com/repos/szymonm/cassovary/pulls{/number}","milestones_url":"https://api.github.com/repos/szymonm/cassovary/milestones{/number}","notifications_url":"https://api.github.com/repos/szymonm/cassovary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/szymonm/cassovary/labels{/name}","releases_url":"https://api.github.com/repos/szymonm/cassovary/releases{/id}","created_at":"2014-03-10T11:24:08Z","updated_at":"2015-09-22T12:13:06Z","pushed_at":"2015-09-28T08:42:21Z","git_url":"git://github.com/szymonm/cassovary.git","ssh_url":"git@github.com:szymonm/cassovary.git","clone_url":"https://github.com/szymonm/cassovary.git","svn_url":"https://github.com/szymonm/cassovary","homepage":"http://twitter.com/cassovary","size":53555,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"twitter:master","ref":"master","sha":"59d2c6556683ab425c431ef0b354adf199af5199","user":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"repo":{"id":3509388,"name":"cassovary","full_name":"twitter/cassovary","owner":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twitter/cassovary","description":"Cassovary is a simple big graph processing library for the JVM","fork":false,"url":"https://api.github.com/repos/twitter/cassovary","forks_url":"https://api.github.com/repos/twitter/cassovary/forks","keys_url":"https://api.github.com/repos/twitter/cassovary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twitter/cassovary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twitter/cassovary/teams","hooks_url":"https://api.github.com/repos/twitter/cassovary/hooks","issue_events_url":"https://api.github.com/repos/twitter/cassovary/issues/events{/number}","events_url":"https://api.github.com/repos/twitter/cassovary/events","assignees_url":"https://api.github.com/repos/twitter/cassovary/assignees{/user}","branches_url":"https://api.github.com/repos/twitter/cassovary/branches{/branch}","tags_url":"https://api.github.com/repos/twitter/cassovary/tags","blobs_url":"https://api.github.com/repos/twitter/cassovary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twitter/cassovary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twitter/cassovary/git/refs{/sha}","trees_url":"https://api.github.com/repos/twitter/cassovary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twitter/cassovary/statuses/{sha}","languages_url":"https://api.github.com/repos/twitter/cassovary/languages","stargazers_url":"https://api.github.com/repos/twitter/cassovary/stargazers","contributors_url":"https://api.github.com/repos/twitter/cassovary/contributors","subscribers_url":"https://api.github.com/repos/twitter/cassovary/subscribers","subscription_url":"https://api.github.com/repos/twitter/cassovary/subscription","commits_url":"https://api.github.com/repos/twitter/cassovary/commits{/sha}","git_commits_url":"https://api.github.com/repos/twitter/cassovary/git/commits{/sha}","comments_url":"https://api.github.com/repos/twitter/cassovary/comments{/number}","issue_comment_url":"https://api.github.com/repos/twitter/cassovary/issues/comments{/number}","contents_url":"https://api.github.com/repos/twitter/cassovary/contents/{+path}","compare_url":"https://api.github.com/repos/twitter/cassovary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twitter/cassovary/merges","archive_url":"https://api.github.com/repos/twitter/cassovary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twitter/cassovary/downloads","issues_url":"https://api.github.com/repos/twitter/cassovary/issues{/number}","pulls_url":"https://api.github.com/repos/twitter/cassovary/pulls{/number}","milestones_url":"https://api.github.com/repos/twitter/cassovary/milestones{/number}","notifications_url":"https://api.github.com/repos/twitter/cassovary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twitter/cassovary/labels{/name}","releases_url":"https://api.github.com/repos/twitter/cassovary/releases{/id}","created_at":"2012-02-21T23:22:30Z","updated_at":"2015-09-30T03:23:09Z","pushed_at":"2015-09-28T18:35:16Z","git_url":"git://github.com/twitter/cassovary.git","ssh_url":"git@github.com:twitter/cassovary.git","clone_url":"https://github.com/twitter/cassovary.git","svn_url":"https://github.com/twitter/cassovary","homepage":"http://twitter.com/cassovary","size":54556,"stargazers_count":768,"watchers_count":768,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":102,"mirror_url":null,"open_issues_count":28,"forks":102,"open_issues":28,"watchers":768,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twitter/cassovary/pulls/205"},"html":{"href":"https://github.com/twitter/cassovary/pull/205"},"issue":{"href":"https://api.github.com/repos/twitter/cassovary/issues/205"},"comments":{"href":"https://api.github.com/repos/twitter/cassovary/issues/205/comments"},"review_comments":{"href":"https://api.github.com/repos/twitter/cassovary/pulls/205/comments"},"review_comment":{"href":"https://api.github.com/repos/twitter/cassovary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twitter/cassovary/pulls/205/commits"},"statuses":{"href":"https://api.github.com/repos/twitter/cassovary/statuses/3e86ee5126ef23adda87d4c165191602a33d6ee0"}}}}