GitHub PullRequestReviewCommentEvent at 2014-09-12 05:16:54
Repository: maestro
Actor: SamRoberts
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/CommBank/maestro/pulls/comments/17463333","id":17463333,"diff_hunk":"@@ -0,0 +1,142 @@\n+package au.com.cba.omnia.maestro.core.task\n+\n+import java.io.File\n+\n+import cascading.flow.FlowDef\n+import cascading.tap.Tap\n+\n+import com.twitter.scalding._, TDsl._, Dsl._\n+\n+import org.apache.log4j.Logger\n+import org.joda.time.{DateTime, DateTimeZone}\n+\n+import au.com.cba.omnia.parlour.{ExportSqoopJob, ImportSqoopJob, ParlourExportOptions, ParlourImportOptions}\n+import au.com.cba.omnia.parlour.SqoopSyntax.{ParlourExportDsl, ParlourImportDsl}\n+\n+/**\n+  * Import and export data between a database and HDFS.\n+  * \n+  * Methods return a Job that can be added to a cascade.\n+  * \n+  * See the example at `au.com.cba.omnia.maestro.example.CustomerSqoopExample`.\n+  * \n+  *\n+  */\n+trait Sqoop {\n+\n+  /**\n+   * For a given `domain` and `tableName`, [[ImportPath]] creates a standard\n+   * HDFS location: `\\$hdfsRoot/source/\\$source/\\$domain/\\$tableName/<year>/<month>/<day>`.\n+   *\n+   * Year, month and day are derived from the current date.\n+   *\n+   * @param hdfsRoot\n+   * @param source\n+   * @param domain\n+   * @param tableName\n+   */\n+  case class ImportPath(hdfsRoot: String, source: String, domain: String, tableName: String) {\n+    def path = {\n+      val date = DateTime.now(DateTimeZone.UTC).toString(List(\"yyyy\",\"MM\", \"dd\") mkString File.separator)\n+      List(hdfsRoot, \"source\", source, domain, tableName, date) mkString File.separator\n+    }\n+  }\n+\n+  /**\n+   * Run a sqoop import using parlour import options\n+   *\n+   * <b>Use this method ONLY if non-standard settings are required</b>\n+   * \n+   * @param options: Parlor import options\n+   */\n+  def sqoopImport(\n+    nextJob: Job, \n+    options: ParlourImportOptions[_]\n+  )(args: Args)(implicit flowDef: FlowDef, mode: Mode): Job = {\n+    val logger = Logger.getLogger(\"Sqoop\")\n+    val sqoopOptions = options.toSqoopOptions\n+    logger.info(\"Start of sqoop import\")\n+    logger.info(s\"connectionString = ${sqoopOptions.getConnectString}\")\n+    logger.info(s\"tableName        = ${sqoopOptions.getTableName}\")\n+    logger.info(s\"targetDir        = ${sqoopOptions.getTargetDir}\")\n+    val sink:Tap[_,_,_] = nextJob.buildFlow.getSourcesCollection().iterator().next()","path":"maestro-core/src/main/scala/au/com/cba/omnia/maestro/core/task/Sqoop.scala","position":62,"original_position":62,"commit_id":"74c3a8d2b7cfd9cf1c6ba6246988229a3b49dd16","original_commit_id":"74c3a8d2b7cfd9cf1c6ba6246988229a3b49dd16","user":{"login":"SamRoberts","id":1086978,"avatar_url":"https://avatars.githubusercontent.com/u/1086978?v=2","gravatar_id":"7d8de5e8f29d5e7465e7ff21aea05ed8","url":"https://api.github.com/users/SamRoberts","html_url":"https://github.com/SamRoberts","followers_url":"https://api.github.com/users/SamRoberts/followers","following_url":"https://api.github.com/users/SamRoberts/following{/other_user}","gists_url":"https://api.github.com/users/SamRoberts/gists{/gist_id}","starred_url":"https://api.github.com/users/SamRoberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamRoberts/subscriptions","organizations_url":"https://api.github.com/users/SamRoberts/orgs","repos_url":"https://api.github.com/users/SamRoberts/repos","events_url":"https://api.github.com/users/SamRoberts/events{/privacy}","received_events_url":"https://api.github.com/users/SamRoberts/received_events","type":"User","site_admin":false},"body":"Are we assuming that the `nextJob` will only have one source here? If so, should we be checking for that?\r\n\r\nWhy have we taken this approach towards specifying the sink files for the import job? We have standard locations where everything is meant to be placed. This seems to put the responsibility for meeting those standards on the user. Is that correct?","created_at":"2014-09-12T05:16:54Z","updated_at":"2014-09-12T05:16:54Z","html_url":"https://github.com/CommBank/maestro/pull/174#discussion_r17463333","pull_request_url":"https://api.github.com/repos/CommBank/maestro/pulls/174","_links":{"self":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/comments/17463333"},"html":{"href":"https://github.com/CommBank/maestro/pull/174#discussion_r17463333"},"pull_request":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/174"}}},"pull_request":{"url":"https://api.github.com/repos/CommBank/maestro/pulls/174","id":21131628,"html_url":"https://github.com/CommBank/maestro/pull/174","diff_url":"https://github.com/CommBank/maestro/pull/174.diff","patch_url":"https://github.com/CommBank/maestro/pull/174.patch","issue_url":"https://api.github.com/repos/CommBank/maestro/issues/174","number":174,"state":"open","locked":false,"title":"Parlour/Sqoop integration","user":{"login":"tims","id":63295,"avatar_url":"https://avatars.githubusercontent.com/u/63295?v=2","gravatar_id":"d784c48baf0ea01393ba7039df111553","url":"https://api.github.com/users/tims","html_url":"https://github.com/tims","followers_url":"https://api.github.com/users/tims/followers","following_url":"https://api.github.com/users/tims/following{/other_user}","gists_url":"https://api.github.com/users/tims/gists{/gist_id}","starred_url":"https://api.github.com/users/tims/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tims/subscriptions","organizations_url":"https://api.github.com/users/tims/orgs","repos_url":"https://api.github.com/users/tims/repos","events_url":"https://api.github.com/users/tims/events{/privacy}","received_events_url":"https://api.github.com/users/tims/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-09-12T03:50:20Z","updated_at":"2014-09-12T05:16:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58debad89526e42f1f7b4bb92237290a614a89ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CommBank/maestro/pulls/174/commits","review_comments_url":"https://api.github.com/repos/CommBank/maestro/pulls/174/comments","review_comment_url":"https://api.github.com/repos/CommBank/maestro/pulls/comments/{number}","comments_url":"https://api.github.com/repos/CommBank/maestro/issues/174/comments","statuses_url":"https://api.github.com/repos/CommBank/maestro/statuses/74c3a8d2b7cfd9cf1c6ba6246988229a3b49dd16","head":{"label":"tims:sqoop","ref":"sqoop","sha":"74c3a8d2b7cfd9cf1c6ba6246988229a3b49dd16","user":{"login":"tims","id":63295,"avatar_url":"https://avatars.githubusercontent.com/u/63295?v=2","gravatar_id":"d784c48baf0ea01393ba7039df111553","url":"https://api.github.com/users/tims","html_url":"https://github.com/tims","followers_url":"https://api.github.com/users/tims/followers","following_url":"https://api.github.com/users/tims/following{/other_user}","gists_url":"https://api.github.com/users/tims/gists{/gist_id}","starred_url":"https://api.github.com/users/tims/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tims/subscriptions","organizations_url":"https://api.github.com/users/tims/orgs","repos_url":"https://api.github.com/users/tims/repos","events_url":"https://api.github.com/users/tims/events{/privacy}","received_events_url":"https://api.github.com/users/tims/received_events","type":"User","site_admin":false},"repo":{"id":21593138,"name":"maestro","full_name":"tims/maestro","owner":{"login":"tims","id":63295,"avatar_url":"https://avatars.githubusercontent.com/u/63295?v=2","gravatar_id":"d784c48baf0ea01393ba7039df111553","url":"https://api.github.com/users/tims","html_url":"https://github.com/tims","followers_url":"https://api.github.com/users/tims/followers","following_url":"https://api.github.com/users/tims/following{/other_user}","gists_url":"https://api.github.com/users/tims/gists{/gist_id}","starred_url":"https://api.github.com/users/tims/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tims/subscriptions","organizations_url":"https://api.github.com/users/tims/orgs","repos_url":"https://api.github.com/users/tims/repos","events_url":"https://api.github.com/users/tims/events{/privacy}","received_events_url":"https://api.github.com/users/tims/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tims/maestro","description":"Data Pipelines that are well typed and enforce good convention","fork":true,"url":"https://api.github.com/repos/tims/maestro","forks_url":"https://api.github.com/repos/tims/maestro/forks","keys_url":"https://api.github.com/repos/tims/maestro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tims/maestro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tims/maestro/teams","hooks_url":"https://api.github.com/repos/tims/maestro/hooks","issue_events_url":"https://api.github.com/repos/tims/maestro/issues/events{/number}","events_url":"https://api.github.com/repos/tims/maestro/events","assignees_url":"https://api.github.com/repos/tims/maestro/assignees{/user}","branches_url":"https://api.github.com/repos/tims/maestro/branches{/branch}","tags_url":"https://api.github.com/repos/tims/maestro/tags","blobs_url":"https://api.github.com/repos/tims/maestro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tims/maestro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tims/maestro/git/refs{/sha}","trees_url":"https://api.github.com/repos/tims/maestro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tims/maestro/statuses/{sha}","languages_url":"https://api.github.com/repos/tims/maestro/languages","stargazers_url":"https://api.github.com/repos/tims/maestro/stargazers","contributors_url":"https://api.github.com/repos/tims/maestro/contributors","subscribers_url":"https://api.github.com/repos/tims/maestro/subscribers","subscription_url":"https://api.github.com/repos/tims/maestro/subscription","commits_url":"https://api.github.com/repos/tims/maestro/commits{/sha}","git_commits_url":"https://api.github.com/repos/tims/maestro/git/commits{/sha}","comments_url":"https://api.github.com/repos/tims/maestro/comments{/number}","issue_comment_url":"https://api.github.com/repos/tims/maestro/issues/comments/{number}","contents_url":"https://api.github.com/repos/tims/maestro/contents/{+path}","compare_url":"https://api.github.com/repos/tims/maestro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tims/maestro/merges","archive_url":"https://api.github.com/repos/tims/maestro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tims/maestro/downloads","issues_url":"https://api.github.com/repos/tims/maestro/issues{/number}","pulls_url":"https://api.github.com/repos/tims/maestro/pulls{/number}","milestones_url":"https://api.github.com/repos/tims/maestro/milestones{/number}","notifications_url":"https://api.github.com/repos/tims/maestro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tims/maestro/labels{/name}","releases_url":"https://api.github.com/repos/tims/maestro/releases{/id}","created_at":"2014-07-08T01:19:29Z","updated_at":"2014-07-11T03:41:12Z","pushed_at":"2014-09-12T04:38:56Z","git_url":"git://github.com/tims/maestro.git","ssh_url":"git@github.com:tims/maestro.git","clone_url":"https://github.com/tims/maestro.git","svn_url":"https://github.com/tims/maestro","homepage":"","size":2492,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CommBank:master","ref":"master","sha":"19311ecceeb00ad2a8ba5b1db5e6c1a1afc7fac8","user":{"login":"CommBank","id":4240076,"avatar_url":"https://avatars.githubusercontent.com/u/4240076?v=2","gravatar_id":"89f708e8d47ed24762e84ba83347a044","url":"https://api.github.com/users/CommBank","html_url":"https://github.com/CommBank","followers_url":"https://api.github.com/users/CommBank/followers","following_url":"https://api.github.com/users/CommBank/following{/other_user}","gists_url":"https://api.github.com/users/CommBank/gists{/gist_id}","starred_url":"https://api.github.com/users/CommBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommBank/subscriptions","organizations_url":"https://api.github.com/users/CommBank/orgs","repos_url":"https://api.github.com/users/CommBank/repos","events_url":"https://api.github.com/users/CommBank/events{/privacy}","received_events_url":"https://api.github.com/users/CommBank/received_events","type":"Organization","site_admin":false},"repo":{"id":17347463,"name":"maestro","full_name":"CommBank/maestro","owner":{"login":"CommBank","id":4240076,"avatar_url":"https://avatars.githubusercontent.com/u/4240076?v=2","gravatar_id":"89f708e8d47ed24762e84ba83347a044","url":"https://api.github.com/users/CommBank","html_url":"https://github.com/CommBank","followers_url":"https://api.github.com/users/CommBank/followers","following_url":"https://api.github.com/users/CommBank/following{/other_user}","gists_url":"https://api.github.com/users/CommBank/gists{/gist_id}","starred_url":"https://api.github.com/users/CommBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommBank/subscriptions","organizations_url":"https://api.github.com/users/CommBank/orgs","repos_url":"https://api.github.com/users/CommBank/repos","events_url":"https://api.github.com/users/CommBank/events{/privacy}","received_events_url":"https://api.github.com/users/CommBank/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CommBank/maestro","description":"Data Pipelines that are well typed and enforce good convention","fork":false,"url":"https://api.github.com/repos/CommBank/maestro","forks_url":"https://api.github.com/repos/CommBank/maestro/forks","keys_url":"https://api.github.com/repos/CommBank/maestro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CommBank/maestro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CommBank/maestro/teams","hooks_url":"https://api.github.com/repos/CommBank/maestro/hooks","issue_events_url":"https://api.github.com/repos/CommBank/maestro/issues/events{/number}","events_url":"https://api.github.com/repos/CommBank/maestro/events","assignees_url":"https://api.github.com/repos/CommBank/maestro/assignees{/user}","branches_url":"https://api.github.com/repos/CommBank/maestro/branches{/branch}","tags_url":"https://api.github.com/repos/CommBank/maestro/tags","blobs_url":"https://api.github.com/repos/CommBank/maestro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CommBank/maestro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CommBank/maestro/git/refs{/sha}","trees_url":"https://api.github.com/repos/CommBank/maestro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CommBank/maestro/statuses/{sha}","languages_url":"https://api.github.com/repos/CommBank/maestro/languages","stargazers_url":"https://api.github.com/repos/CommBank/maestro/stargazers","contributors_url":"https://api.github.com/repos/CommBank/maestro/contributors","subscribers_url":"https://api.github.com/repos/CommBank/maestro/subscribers","subscription_url":"https://api.github.com/repos/CommBank/maestro/subscription","commits_url":"https://api.github.com/repos/CommBank/maestro/commits{/sha}","git_commits_url":"https://api.github.com/repos/CommBank/maestro/git/commits{/sha}","comments_url":"https://api.github.com/repos/CommBank/maestro/comments{/number}","issue_comment_url":"https://api.github.com/repos/CommBank/maestro/issues/comments/{number}","contents_url":"https://api.github.com/repos/CommBank/maestro/contents/{+path}","compare_url":"https://api.github.com/repos/CommBank/maestro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CommBank/maestro/merges","archive_url":"https://api.github.com/repos/CommBank/maestro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CommBank/maestro/downloads","issues_url":"https://api.github.com/repos/CommBank/maestro/issues{/number}","pulls_url":"https://api.github.com/repos/CommBank/maestro/pulls{/number}","milestones_url":"https://api.github.com/repos/CommBank/maestro/milestones{/number}","notifications_url":"https://api.github.com/repos/CommBank/maestro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CommBank/maestro/labels{/name}","releases_url":"https://api.github.com/repos/CommBank/maestro/releases{/id}","created_at":"2014-03-02T21:34:53Z","updated_at":"2014-09-02T14:32:54Z","pushed_at":"2014-09-12T04:15:27Z","git_url":"git://github.com/CommBank/maestro.git","ssh_url":"git@github.com:CommBank/maestro.git","clone_url":"https://github.com/CommBank/maestro.git","svn_url":"https://github.com/CommBank/maestro","homepage":"https://commbank.github.io/maestro","size":10745,"stargazers_count":14,"watchers_count":14,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":7,"mirror_url":null,"open_issues_count":58,"forks":7,"open_issues":58,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/174"},"html":{"href":"https://github.com/CommBank/maestro/pull/174"},"issue":{"href":"https://api.github.com/repos/CommBank/maestro/issues/174"},"comments":{"href":"https://api.github.com/repos/CommBank/maestro/issues/174/comments"},"review_comments":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/174/comments"},"review_comment":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/174/commits"},"statuses":{"href":"https://api.github.com/repos/CommBank/maestro/statuses/74c3a8d2b7cfd9cf1c6ba6246988229a3b49dd16"}}}}