{"action":"created","comment":{"url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/comments/113009272","pull_request_review_id":34366399,"id":113009272,"diff_hunk":"@@ -0,0 +1,127 @@\n+/**\n+ * Copyright 2016-2017 The OpenTracing Authors\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n+ * in compliance 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 distributed under the License\n+ * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n+ * or implied. See the License for the specific language governing permissions and limitations under\n+ * the License.\n+ */\n+package io.opentracing;\n+\n+import java.util.Map;\n+\n+/**\n+ * A noop (i.e., cheap-as-possible) implementation of a Source.\n+ */\n+public class NoopSource implements ActiveSpanSource {\n+    public static final ActiveSpan NOOP_ACTIVE_SPAN = new NoopActiveSpan();\n+    public static final ActiveSpan.Continuation NOOP_CONTINUATION = new NoopContinuation();\n+\n+    @Override\n+    public ActiveSpan makeActive(Span span) {\n+        return NOOP_ACTIVE_SPAN;\n+    }\n+\n+    @Override\n+    public ActiveSpan activeSpan() { return NOOP_ACTIVE_SPAN; }\n+\n+    public static class NoopActiveSpan implements ActiveSpan {\n+        @Override\n+        public void deactivate() {}\n+\n+        @Override\n+        public Continuation capture() {\n+            return NOOP_CONTINUATION;\n+        }\n+\n+        @Override\n+        public SpanContext context() {\n+            return NoopSpanContextImpl.INSTANCE;\n+        }\n+\n+        @Override\n+        public void finish() {\n+\n+        }\n+\n+        @Override\n+        public void finish(long finishMicros) {\n+\n+        }\n+\n+        @Override\n+        public void close() {}\n+\n+        @Override\n+        public Span setTag(String key, String value) {\n+            return null;","path":"opentracing-noop/src/main/java/io/opentracing/NoopSource.java","position":62,"original_position":62,"commit_id":"089c90479176c46b2a5e35c2be3751da8dcbdf16","original_commit_id":"089c90479176c46b2a5e35c2be3751da8dcbdf16","user":{"login":"objectiser","id":164562,"avatar_url":"https://avatars0.githubusercontent.com/u/164562?v=3","gravatar_id":"","url":"https://api.github.com/users/objectiser","html_url":"https://github.com/objectiser","followers_url":"https://api.github.com/users/objectiser/followers","following_url":"https://api.github.com/users/objectiser/following{/other_user}","gists_url":"https://api.github.com/users/objectiser/gists{/gist_id}","starred_url":"https://api.github.com/users/objectiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objectiser/subscriptions","organizations_url":"https://api.github.com/users/objectiser/orgs","repos_url":"https://api.github.com/users/objectiser/repos","events_url":"https://api.github.com/users/objectiser/events{/privacy}","received_events_url":"https://api.github.com/users/objectiser/received_events","type":"User","site_admin":false},"body":"Or `NoopActiveSpan` extend `NoopSpan`?","created_at":"2017-04-24T17:37:32Z","updated_at":"2017-04-24T17:37:32Z","html_url":"https://github.com/opentracing/opentracing-java/pull/115#discussion_r113009272","pull_request_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/115","_links":{"self":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/comments/113009272"},"html":{"href":"https://github.com/opentracing/opentracing-java/pull/115#discussion_r113009272"},"pull_request":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/115","id":112886887,"html_url":"https://github.com/opentracing/opentracing-java/pull/115","diff_url":"https://github.com/opentracing/opentracing-java/pull/115.diff","patch_url":"https://github.com/opentracing/opentracing-java/pull/115.patch","issue_url":"https://api.github.com/repos/opentracing/opentracing-java/issues/115","number":115,"state":"open","locked":false,"title":"Introduce ActiveSpan, ActiveSpan.Continuation, and ActiveSpanSource","user":{"login":"bhs","id":2251553,"avatar_url":"https://avatars1.githubusercontent.com/u/2251553?v=3","gravatar_id":"","url":"https://api.github.com/users/bhs","html_url":"https://github.com/bhs","followers_url":"https://api.github.com/users/bhs/followers","following_url":"https://api.github.com/users/bhs/following{/other_user}","gists_url":"https://api.github.com/users/bhs/gists{/gist_id}","starred_url":"https://api.github.com/users/bhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhs/subscriptions","organizations_url":"https://api.github.com/users/bhs/orgs","repos_url":"https://api.github.com/users/bhs/repos","events_url":"https://api.github.com/users/bhs/events{/privacy}","received_events_url":"https://api.github.com/users/bhs/received_events","type":"User","site_admin":false},"body":"This is a relatively small diff against what can be found in https://github.com/opentracing/opentracing-java/pull/111\r\n\r\nI created a separate PR since – IMO – it can be difficult to discuss two alternatives in Github PRs unless they're separate, well, PRs.\r\n\r\n## Delta from #111 \r\n\r\n- There is no more activate()-time parameter about finish() behavior. Instead, ActiveSpanHolder.Continuation has internal refcounting. This leads to terser code and (hopefully) fewer bugs: either from forgetting to finish(), or from not-knowing what to pass to activate(), especially in Runnable/Callable wrappers (which was a real problem in my explorations with \"real\" codebases).\r\n- Per the above, ActiveSpanHolder and ActiveSpanHolder.Continuation are abstract classes rather than pure interfaces, and thus the refcounting is actually part of OT-Java rather than OT-Java impls.\r\n- I also addressed a variety of naming and minor semantic concerns from #111 \r\n\r\n## About the reference-counting...\r\n\r\nIMO the relationship in #111 between `Span.finish()` and `Continuation.deactivate()` was borderline unacceptable. While that's addressed (syntactically) in this PR, the result is that `Continuation` manages an `AtomicInt` and core `opentracing-java` gets further into the business of implementation than it has to date.\r\n\r\n## Desired feedback\r\n\r\nI'd love to hear about structural/API-level concerns, see structural/API-level alternatives, and perhaps learn about naming preferences.\r\n\r\nLet's not nitpick this review in too much detail; or at least not until the \"WIP\" prefix is removed. All in due time. :)","created_at":"2017-03-28T04:17:10Z","updated_at":"2017-04-24T17:37:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"840fbf25eb346891080d2d925a562c7a40eb8411","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/115/commits","review_comments_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/115/comments","review_comment_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opentracing/opentracing-java/issues/115/comments","statuses_url":"https://api.github.com/repos/opentracing/opentracing-java/statuses/089c90479176c46b2a5e35c2be3751da8dcbdf16","head":{"label":"bhs:bhs/ash_core","ref":"bhs/ash_core","sha":"089c90479176c46b2a5e35c2be3751da8dcbdf16","user":{"login":"bhs","id":2251553,"avatar_url":"https://avatars1.githubusercontent.com/u/2251553?v=3","gravatar_id":"","url":"https://api.github.com/users/bhs","html_url":"https://github.com/bhs","followers_url":"https://api.github.com/users/bhs/followers","following_url":"https://api.github.com/users/bhs/following{/other_user}","gists_url":"https://api.github.com/users/bhs/gists{/gist_id}","starred_url":"https://api.github.com/users/bhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhs/subscriptions","organizations_url":"https://api.github.com/users/bhs/orgs","repos_url":"https://api.github.com/users/bhs/repos","events_url":"https://api.github.com/users/bhs/events{/privacy}","received_events_url":"https://api.github.com/users/bhs/received_events","type":"User","site_admin":false},"repo":{"id":82522010,"name":"opentracing-java","full_name":"bhs/opentracing-java","owner":{"login":"bhs","id":2251553,"avatar_url":"https://avatars1.githubusercontent.com/u/2251553?v=3","gravatar_id":"","url":"https://api.github.com/users/bhs","html_url":"https://github.com/bhs","followers_url":"https://api.github.com/users/bhs/followers","following_url":"https://api.github.com/users/bhs/following{/other_user}","gists_url":"https://api.github.com/users/bhs/gists{/gist_id}","starred_url":"https://api.github.com/users/bhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhs/subscriptions","organizations_url":"https://api.github.com/users/bhs/orgs","repos_url":"https://api.github.com/users/bhs/repos","events_url":"https://api.github.com/users/bhs/events{/privacy}","received_events_url":"https://api.github.com/users/bhs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bhs/opentracing-java","description":"OpenTracing API for Java","fork":true,"url":"https://api.github.com/repos/bhs/opentracing-java","forks_url":"https://api.github.com/repos/bhs/opentracing-java/forks","keys_url":"https://api.github.com/repos/bhs/opentracing-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bhs/opentracing-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bhs/opentracing-java/teams","hooks_url":"https://api.github.com/repos/bhs/opentracing-java/hooks","issue_events_url":"https://api.github.com/repos/bhs/opentracing-java/issues/events{/number}","events_url":"https://api.github.com/repos/bhs/opentracing-java/events","assignees_url":"https://api.github.com/repos/bhs/opentracing-java/assignees{/user}","branches_url":"https://api.github.com/repos/bhs/opentracing-java/branches{/branch}","tags_url":"https://api.github.com/repos/bhs/opentracing-java/tags","blobs_url":"https://api.github.com/repos/bhs/opentracing-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bhs/opentracing-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bhs/opentracing-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/bhs/opentracing-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bhs/opentracing-java/statuses/{sha}","languages_url":"https://api.github.com/repos/bhs/opentracing-java/languages","stargazers_url":"https://api.github.com/repos/bhs/opentracing-java/stargazers","contributors_url":"https://api.github.com/repos/bhs/opentracing-java/contributors","subscribers_url":"https://api.github.com/repos/bhs/opentracing-java/subscribers","subscription_url":"https://api.github.com/repos/bhs/opentracing-java/subscription","commits_url":"https://api.github.com/repos/bhs/opentracing-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/bhs/opentracing-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/bhs/opentracing-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/bhs/opentracing-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/bhs/opentracing-java/contents/{+path}","compare_url":"https://api.github.com/repos/bhs/opentracing-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bhs/opentracing-java/merges","archive_url":"https://api.github.com/repos/bhs/opentracing-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bhs/opentracing-java/downloads","issues_url":"https://api.github.com/repos/bhs/opentracing-java/issues{/number}","pulls_url":"https://api.github.com/repos/bhs/opentracing-java/pulls{/number}","milestones_url":"https://api.github.com/repos/bhs/opentracing-java/milestones{/number}","notifications_url":"https://api.github.com/repos/bhs/opentracing-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bhs/opentracing-java/labels{/name}","releases_url":"https://api.github.com/repos/bhs/opentracing-java/releases{/id}","deployments_url":"https://api.github.com/repos/bhs/opentracing-java/deployments","created_at":"2017-02-20T05:55:42Z","updated_at":"2017-02-20T05:55:44Z","pushed_at":"2017-04-21T06:00:47Z","git_url":"git://github.com/bhs/opentracing-java.git","ssh_url":"git@github.com:bhs/opentracing-java.git","clone_url":"https://github.com/bhs/opentracing-java.git","svn_url":"https://github.com/bhs/opentracing-java","homepage":"http://opentracing.io","size":661,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"opentracing:master","ref":"master","sha":"28238c9af5b8e3b5fc6e3e4a0bb16c2e14da8fa4","user":{"login":"opentracing","id":15482765,"avatar_url":"https://avatars2.githubusercontent.com/u/15482765?v=3","gravatar_id":"","url":"https://api.github.com/users/opentracing","html_url":"https://github.com/opentracing","followers_url":"https://api.github.com/users/opentracing/followers","following_url":"https://api.github.com/users/opentracing/following{/other_user}","gists_url":"https://api.github.com/users/opentracing/gists{/gist_id}","starred_url":"https://api.github.com/users/opentracing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentracing/subscriptions","organizations_url":"https://api.github.com/users/opentracing/orgs","repos_url":"https://api.github.com/users/opentracing/repos","events_url":"https://api.github.com/users/opentracing/events{/privacy}","received_events_url":"https://api.github.com/users/opentracing/received_events","type":"Organization","site_admin":false},"repo":{"id":48295629,"name":"opentracing-java","full_name":"opentracing/opentracing-java","owner":{"login":"opentracing","id":15482765,"avatar_url":"https://avatars2.githubusercontent.com/u/15482765?v=3","gravatar_id":"","url":"https://api.github.com/users/opentracing","html_url":"https://github.com/opentracing","followers_url":"https://api.github.com/users/opentracing/followers","following_url":"https://api.github.com/users/opentracing/following{/other_user}","gists_url":"https://api.github.com/users/opentracing/gists{/gist_id}","starred_url":"https://api.github.com/users/opentracing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentracing/subscriptions","organizations_url":"https://api.github.com/users/opentracing/orgs","repos_url":"https://api.github.com/users/opentracing/repos","events_url":"https://api.github.com/users/opentracing/events{/privacy}","received_events_url":"https://api.github.com/users/opentracing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opentracing/opentracing-java","description":"OpenTracing API for Java","fork":false,"url":"https://api.github.com/repos/opentracing/opentracing-java","forks_url":"https://api.github.com/repos/opentracing/opentracing-java/forks","keys_url":"https://api.github.com/repos/opentracing/opentracing-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentracing/opentracing-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentracing/opentracing-java/teams","hooks_url":"https://api.github.com/repos/opentracing/opentracing-java/hooks","issue_events_url":"https://api.github.com/repos/opentracing/opentracing-java/issues/events{/number}","events_url":"https://api.github.com/repos/opentracing/opentracing-java/events","assignees_url":"https://api.github.com/repos/opentracing/opentracing-java/assignees{/user}","branches_url":"https://api.github.com/repos/opentracing/opentracing-java/branches{/branch}","tags_url":"https://api.github.com/repos/opentracing/opentracing-java/tags","blobs_url":"https://api.github.com/repos/opentracing/opentracing-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentracing/opentracing-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentracing/opentracing-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentracing/opentracing-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentracing/opentracing-java/statuses/{sha}","languages_url":"https://api.github.com/repos/opentracing/opentracing-java/languages","stargazers_url":"https://api.github.com/repos/opentracing/opentracing-java/stargazers","contributors_url":"https://api.github.com/repos/opentracing/opentracing-java/contributors","subscribers_url":"https://api.github.com/repos/opentracing/opentracing-java/subscribers","subscription_url":"https://api.github.com/repos/opentracing/opentracing-java/subscription","commits_url":"https://api.github.com/repos/opentracing/opentracing-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentracing/opentracing-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentracing/opentracing-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentracing/opentracing-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentracing/opentracing-java/contents/{+path}","compare_url":"https://api.github.com/repos/opentracing/opentracing-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentracing/opentracing-java/merges","archive_url":"https://api.github.com/repos/opentracing/opentracing-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentracing/opentracing-java/downloads","issues_url":"https://api.github.com/repos/opentracing/opentracing-java/issues{/number}","pulls_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls{/number}","milestones_url":"https://api.github.com/repos/opentracing/opentracing-java/milestones{/number}","notifications_url":"https://api.github.com/repos/opentracing/opentracing-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentracing/opentracing-java/labels{/name}","releases_url":"https://api.github.com/repos/opentracing/opentracing-java/releases{/id}","deployments_url":"https://api.github.com/repos/opentracing/opentracing-java/deployments","created_at":"2015-12-19T20:07:30Z","updated_at":"2017-04-24T13:03:45Z","pushed_at":"2017-04-24T04:50:40Z","git_url":"git://github.com/opentracing/opentracing-java.git","ssh_url":"git@github.com:opentracing/opentracing-java.git","clone_url":"https://github.com/opentracing/opentracing-java.git","svn_url":"https://github.com/opentracing/opentracing-java","homepage":"http://opentracing.io","size":439,"stargazers_count":266,"watchers_count":266,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":20,"forks":61,"open_issues":20,"watchers":266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/115"},"html":{"href":"https://github.com/opentracing/opentracing-java/pull/115"},"issue":{"href":"https://api.github.com/repos/opentracing/opentracing-java/issues/115"},"comments":{"href":"https://api.github.com/repos/opentracing/opentracing-java/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/opentracing/opentracing-java/statuses/089c90479176c46b2a5e35c2be3751da8dcbdf16"}}}}
{"actor":{"display_login":"objectiser"}}