{"action":"created","comment":{"url":"https://api.github.com/repos/apache/reef/pulls/comments/134589648","pull_request_review_id":57898429,"id":134589648,"diff_hunk":"@@ -0,0 +1,64 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"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,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package org.apache.reef.util;\n+\n+import java.lang.reflect.InvocationTargetException;\n+import java.lang.reflect.Method;\n+import java.util.concurrent.Callable;\n+\n+/**\n+ * Generic class which provides a simple mechanism to call a single method\n+ * on a concrete class.\n+ * @param <TReturn> The class type of the method return value.\n+ */\n+public final class MethodCallable<TReturn> implements Callable<TReturn> {\n+  private final Object obj;\n+  private final Object[] input;\n+  private final Method method;\n+\n+  /**\n+   * @param obj An subclass of object on which the method will be invoked.\n+   * @param input Parameter input values for the method invocation.\n+   * @param function A string which contains the name of the method to be invoked.\n+   */\n+  public MethodCallable(final Object obj, final String function,\n+                        final Object... input) throws NoSuchMethodException {\n+    this.obj = obj;\n+    this.input = input;\n+\n+    // Get the argument types.\n+    Class[] inputClass = new Class[input.length];","path":"lang/java/reef-utils/src/main/java/org/apache/reef/util/MethodCallable.java","position":46,"original_position":46,"commit_id":"2eade055a69b22f602d16d8a92a8f89dd97ebaab","original_commit_id":"2eade055a69b22f602d16d8a92a8f89dd97ebaab","user":{"login":"motus","id":31380,"avatar_url":"https://avatars1.githubusercontent.com/u/31380?v=4","gravatar_id":"","url":"https://api.github.com/users/motus","html_url":"https://github.com/motus","followers_url":"https://api.github.com/users/motus/followers","following_url":"https://api.github.com/users/motus/following{/other_user}","gists_url":"https://api.github.com/users/motus/gists{/gist_id}","starred_url":"https://api.github.com/users/motus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motus/subscriptions","organizations_url":"https://api.github.com/users/motus/orgs","repos_url":"https://api.github.com/users/motus/repos","events_url":"https://api.github.com/users/motus/events{/privacy}","received_events_url":"https://api.github.com/users/motus/received_events","type":"User","site_admin":false},"body":"`final`","created_at":"2017-08-22T20:16:08Z","updated_at":"2017-08-22T20:20:33Z","html_url":"https://github.com/apache/reef/pull/1365#discussion_r134589648","pull_request_url":"https://api.github.com/repos/apache/reef/pulls/1365","_links":{"self":{"href":"https://api.github.com/repos/apache/reef/pulls/comments/134589648"},"html":{"href":"https://github.com/apache/reef/pull/1365#discussion_r134589648"},"pull_request":{"href":"https://api.github.com/repos/apache/reef/pulls/1365"}}},"pull_request":{"url":"https://api.github.com/repos/apache/reef/pulls/1365","id":135439972,"html_url":"https://github.com/apache/reef/pull/1365","diff_url":"https://github.com/apache/reef/pull/1365.diff","patch_url":"https://github.com/apache/reef/pull/1365.patch","issue_url":"https://api.github.com/repos/apache/reef/issues/1365","number":1365,"state":"open","locked":false,"title":"[REEF-1864] Utility to convert asynchronous API to synchronous.","user":{"login":"dougmsft","id":8461862,"avatar_url":"https://avatars2.githubusercontent.com/u/8461862?v=4","gravatar_id":"","url":"https://api.github.com/users/dougmsft","html_url":"https://github.com/dougmsft","followers_url":"https://api.github.com/users/dougmsft/followers","following_url":"https://api.github.com/users/dougmsft/following{/other_user}","gists_url":"https://api.github.com/users/dougmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/dougmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougmsft/subscriptions","organizations_url":"https://api.github.com/users/dougmsft/orgs","repos_url":"https://api.github.com/users/dougmsft/repos","events_url":"https://api.github.com/users/dougmsft/events{/privacy}","received_events_url":"https://api.github.com/users/dougmsft/received_events","type":"User","site_admin":false},"body":"JIRA:\r\n  [REEF-1864](https://issues.apache.org/jira/browse/REEF-1864)\r\n\r\n  * Adds condition variable class to manage sleep on condition variables.\r\n  * Adds MultiAsyncToSynch class to for managing the callers of an API\r\n    which is synchronous but is implmented asynchronously.\r\n  * Adds MultiAsyncToSyncTest which verifies that non-timeout, timeout,\r\n    and multiple non-timeout calls are complete correctly.\r\n\r\nPull Request:\r\n  Closes #","created_at":"2017-08-12T00:32:25Z","updated_at":"2017-08-22T20:20:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6dee466a83dbdac1dbdc98fbce458c2d5dea2a1d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/reef/pulls/1365/commits","review_comments_url":"https://api.github.com/repos/apache/reef/pulls/1365/comments","review_comment_url":"https://api.github.com/repos/apache/reef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/reef/issues/1365/comments","statuses_url":"https://api.github.com/repos/apache/reef/statuses/2eade055a69b22f602d16d8a92a8f89dd97ebaab","head":{"label":"dougmsft:REEF-1864","ref":"REEF-1864","sha":"2eade055a69b22f602d16d8a92a8f89dd97ebaab","user":{"login":"dougmsft","id":8461862,"avatar_url":"https://avatars2.githubusercontent.com/u/8461862?v=4","gravatar_id":"","url":"https://api.github.com/users/dougmsft","html_url":"https://github.com/dougmsft","followers_url":"https://api.github.com/users/dougmsft/followers","following_url":"https://api.github.com/users/dougmsft/following{/other_user}","gists_url":"https://api.github.com/users/dougmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/dougmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougmsft/subscriptions","organizations_url":"https://api.github.com/users/dougmsft/orgs","repos_url":"https://api.github.com/users/dougmsft/repos","events_url":"https://api.github.com/users/dougmsft/events{/privacy}","received_events_url":"https://api.github.com/users/dougmsft/received_events","type":"User","site_admin":false},"repo":{"id":64526716,"name":"reef","full_name":"dougmsft/reef","owner":{"login":"dougmsft","id":8461862,"avatar_url":"https://avatars2.githubusercontent.com/u/8461862?v=4","gravatar_id":"","url":"https://api.github.com/users/dougmsft","html_url":"https://github.com/dougmsft","followers_url":"https://api.github.com/users/dougmsft/followers","following_url":"https://api.github.com/users/dougmsft/following{/other_user}","gists_url":"https://api.github.com/users/dougmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/dougmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougmsft/subscriptions","organizations_url":"https://api.github.com/users/dougmsft/orgs","repos_url":"https://api.github.com/users/dougmsft/repos","events_url":"https://api.github.com/users/dougmsft/events{/privacy}","received_events_url":"https://api.github.com/users/dougmsft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dougmsft/reef","description":"Mirror of Apache REEF","fork":true,"url":"https://api.github.com/repos/dougmsft/reef","forks_url":"https://api.github.com/repos/dougmsft/reef/forks","keys_url":"https://api.github.com/repos/dougmsft/reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dougmsft/reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dougmsft/reef/teams","hooks_url":"https://api.github.com/repos/dougmsft/reef/hooks","issue_events_url":"https://api.github.com/repos/dougmsft/reef/issues/events{/number}","events_url":"https://api.github.com/repos/dougmsft/reef/events","assignees_url":"https://api.github.com/repos/dougmsft/reef/assignees{/user}","branches_url":"https://api.github.com/repos/dougmsft/reef/branches{/branch}","tags_url":"https://api.github.com/repos/dougmsft/reef/tags","blobs_url":"https://api.github.com/repos/dougmsft/reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dougmsft/reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dougmsft/reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/dougmsft/reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dougmsft/reef/statuses/{sha}","languages_url":"https://api.github.com/repos/dougmsft/reef/languages","stargazers_url":"https://api.github.com/repos/dougmsft/reef/stargazers","contributors_url":"https://api.github.com/repos/dougmsft/reef/contributors","subscribers_url":"https://api.github.com/repos/dougmsft/reef/subscribers","subscription_url":"https://api.github.com/repos/dougmsft/reef/subscription","commits_url":"https://api.github.com/repos/dougmsft/reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/dougmsft/reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/dougmsft/reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/dougmsft/reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/dougmsft/reef/contents/{+path}","compare_url":"https://api.github.com/repos/dougmsft/reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dougmsft/reef/merges","archive_url":"https://api.github.com/repos/dougmsft/reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dougmsft/reef/downloads","issues_url":"https://api.github.com/repos/dougmsft/reef/issues{/number}","pulls_url":"https://api.github.com/repos/dougmsft/reef/pulls{/number}","milestones_url":"https://api.github.com/repos/dougmsft/reef/milestones{/number}","notifications_url":"https://api.github.com/repos/dougmsft/reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dougmsft/reef/labels{/name}","releases_url":"https://api.github.com/repos/dougmsft/reef/releases{/id}","deployments_url":"https://api.github.com/repos/dougmsft/reef/deployments","created_at":"2016-07-30T04:47:03Z","updated_at":"2017-04-04T02:52:09Z","pushed_at":"2017-08-21T20:58:23Z","git_url":"git://github.com/dougmsft/reef.git","ssh_url":"git@github.com:dougmsft/reef.git","clone_url":"https://github.com/dougmsft/reef.git","svn_url":"https://github.com/dougmsft/reef","homepage":"","size":56714,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"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":"apache:master","ref":"master","sha":"47593a77059e082b1e094af3b6811473cb5ac628","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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":25623941,"name":"reef","full_name":"apache/reef","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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/reef","description":"Mirror of Apache REEF","fork":false,"url":"https://api.github.com/repos/apache/reef","forks_url":"https://api.github.com/repos/apache/reef/forks","keys_url":"https://api.github.com/repos/apache/reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/reef/teams","hooks_url":"https://api.github.com/repos/apache/reef/hooks","issue_events_url":"https://api.github.com/repos/apache/reef/issues/events{/number}","events_url":"https://api.github.com/repos/apache/reef/events","assignees_url":"https://api.github.com/repos/apache/reef/assignees{/user}","branches_url":"https://api.github.com/repos/apache/reef/branches{/branch}","tags_url":"https://api.github.com/repos/apache/reef/tags","blobs_url":"https://api.github.com/repos/apache/reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/reef/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/reef/languages","stargazers_url":"https://api.github.com/repos/apache/reef/stargazers","contributors_url":"https://api.github.com/repos/apache/reef/contributors","subscribers_url":"https://api.github.com/repos/apache/reef/subscribers","subscription_url":"https://api.github.com/repos/apache/reef/subscription","commits_url":"https://api.github.com/repos/apache/reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/reef/contents/{+path}","compare_url":"https://api.github.com/repos/apache/reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/reef/merges","archive_url":"https://api.github.com/repos/apache/reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/reef/downloads","issues_url":"https://api.github.com/repos/apache/reef/issues{/number}","pulls_url":"https://api.github.com/repos/apache/reef/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/reef/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/reef/labels{/name}","releases_url":"https://api.github.com/repos/apache/reef/releases{/id}","deployments_url":"https://api.github.com/repos/apache/reef/deployments","created_at":"2014-10-23T07:00:10Z","updated_at":"2017-08-20T14:45:18Z","pushed_at":"2017-08-22T19:59:55Z","git_url":"git://github.com/apache/reef.git","ssh_url":"git@github.com:apache/reef.git","clone_url":"https://github.com/apache/reef.git","svn_url":"https://github.com/apache/reef","homepage":"","size":38867,"stargazers_count":71,"watchers_count":71,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":88,"mirror_url":"git://git.apache.org/reef.git","open_issues_count":11,"forks":88,"open_issues":11,"watchers":71,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/reef/pulls/1365"},"html":{"href":"https://github.com/apache/reef/pull/1365"},"issue":{"href":"https://api.github.com/repos/apache/reef/issues/1365"},"comments":{"href":"https://api.github.com/repos/apache/reef/issues/1365/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/reef/pulls/1365/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/reef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/reef/pulls/1365/commits"},"statuses":{"href":"https://api.github.com/repos/apache/reef/statuses/2eade055a69b22f602d16d8a92a8f89dd97ebaab"}}}}
{"actor":{"display_login":"motus"}}