{"action":"created","comment":{"url":"https://api.github.com/repos/Alluxio/alluxio/pulls/comments/62423779","id":62423779,"diff_hunk":"@@ -0,0 +1,61 @@\n+/*\n+ * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0\n+ * (the “License”). You may not use this work except in compliance with the License, which is\n+ * available at www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n+ * either express or implied, as more fully set forth in the License.\n+ *\n+ * See the NOTICE file distributed with this work for information regarding copyright ownership.\n+ */\n+\n+package alluxio.kafka.connect;\n+\n+import alluxio.kafka.connect.format.JsonFormat;\n+\n+import org.apache.kafka.common.config.AbstractConfig;\n+import org.apache.kafka.common.config.ConfigDef;\n+import org.apache.kafka.common.config.ConfigDef.Type;\n+\n+import java.util.Map;\n+\n+/**\n+ * This class is responsible for reading and storing allxuio connector config parameters.\n+ */\n+public class AlluxioSinkConnectorConfig extends AbstractConfig {\n+\n+  public static final String ALLUXIO_URL = \"alluxio.url\";\n+  public static final String TOPICS_DIR = \"topics.dir\";\n+  public static final String ROTATION_RECORD_NUM = \"rotation.num\";\n+  public static final String ROTATION_TIME_INTERVAL = \"rotation.time.interval\";\n+  public static final String ALLUXIO_FORMAT = \"alluxio.format\";\n+  public static final int OFFSET_LENGTH = 10;\n+  public static final String ALLUXIO_CONNECTOR_VERSION = \"1.1.0\";\n+  private static final String ALLUXIO_URL_DOC =\n+      \"alluxio url address, eg. alluxio://localhost:19998\";\n+  private static final String TOPICS_DIR_DOC = \"The top level directory name in alluxio\";\n+  private static final String ROTATION_RECORD_NUM_DOC =\n+      \"The record number of alluxio file rotation\";\n+  private static final String ROTATION_TIME_INTERVAL_DOC =\n+      \"The time interval of alluxio file rotation\";\n+  private static final String ALLUXIO_FORMAT_DOC = \"The converter format from kafka to alluxio\";\n+  static ConfigDef sConfig = new ConfigDef()\n+      .define(ALLUXIO_URL, Type.STRING, \"alluxio://localhost:19998\", ConfigDef.Importance.HIGH,\n+          ALLUXIO_URL_DOC)\n+      .define(TOPICS_DIR, Type.STRING, \"topics\", ConfigDef.Importance.HIGH, TOPICS_DIR_DOC)\n+      .define(ROTATION_RECORD_NUM, Type.LONG, \"5000\", ConfigDef.Importance.HIGH,\n+          ROTATION_RECORD_NUM_DOC)\n+      .define(ROTATION_TIME_INTERVAL, Type.LONG, \"-1\", ConfigDef.Importance.LOW,\n+          ROTATION_TIME_INTERVAL_DOC)\n+      .define(ALLUXIO_FORMAT, Type.STRING, JsonFormat.class.getName(),","path":"integration/kafka/src/main/java/alluxio/kafka/connect/AlluxioSinkConnectorConfig.java","position":50,"original_position":50,"commit_id":"c0d43241af4c47dbd247bbdf32d7d49f80fdd4b1","original_commit_id":"c0d43241af4c47dbd247bbdf32d7d49f80fdd4b1","user":{"login":"Ishiihara","id":1189848,"avatar_url":"https://avatars.githubusercontent.com/u/1189848?v=3","gravatar_id":"","url":"https://api.github.com/users/Ishiihara","html_url":"https://github.com/Ishiihara","followers_url":"https://api.github.com/users/Ishiihara/followers","following_url":"https://api.github.com/users/Ishiihara/following{/other_user}","gists_url":"https://api.github.com/users/Ishiihara/gists{/gist_id}","starred_url":"https://api.github.com/users/Ishiihara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ishiihara/subscriptions","organizations_url":"https://api.github.com/users/Ishiihara/orgs","repos_url":"https://api.github.com/users/Ishiihara/repos","events_url":"https://api.github.com/users/Ishiihara/events{/privacy}","received_events_url":"https://api.github.com/users/Ishiihara/received_events","type":"User","site_admin":false},"body":"Also, it seems to pay off to define a static variable for each configurations default value, at least we explicitly express the type information. ","created_at":"2016-05-07T22:45:47Z","updated_at":"2016-05-07T22:45:47Z","html_url":"https://github.com/Alluxio/alluxio/pull/3048#discussion_r62423779","pull_request_url":"https://api.github.com/repos/Alluxio/alluxio/pulls/3048","_links":{"self":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/comments/62423779"},"html":{"href":"https://github.com/Alluxio/alluxio/pull/3048#discussion_r62423779"},"pull_request":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/3048"}}},"pull_request":{"url":"https://api.github.com/repos/Alluxio/alluxio/pulls/3048","id":67003500,"html_url":"https://github.com/Alluxio/alluxio/pull/3048","diff_url":"https://github.com/Alluxio/alluxio/pull/3048.diff","patch_url":"https://github.com/Alluxio/alluxio/pull/3048.patch","issue_url":"https://api.github.com/repos/Alluxio/alluxio/issues/3048","number":3048,"state":"open","locked":false,"title":"[ALLUXIO-1886] Add Kafka Connect to export stream data to alluxio","user":{"login":"zhutongxue","id":3257543,"avatar_url":"https://avatars.githubusercontent.com/u/3257543?v=3","gravatar_id":"","url":"https://api.github.com/users/zhutongxue","html_url":"https://github.com/zhutongxue","followers_url":"https://api.github.com/users/zhutongxue/followers","following_url":"https://api.github.com/users/zhutongxue/following{/other_user}","gists_url":"https://api.github.com/users/zhutongxue/gists{/gist_id}","starred_url":"https://api.github.com/users/zhutongxue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhutongxue/subscriptions","organizations_url":"https://api.github.com/users/zhutongxue/orgs","repos_url":"https://api.github.com/users/zhutongxue/repos","events_url":"https://api.github.com/users/zhutongxue/events{/privacy}","received_events_url":"https://api.github.com/users/zhutongxue/received_events","type":"User","site_admin":false},"body":"https://alluxio.atlassian.net/browse/ALLUXIO-1886\r\nAdd kafka connector code in Intergration module ","created_at":"2016-04-19T11:41:09Z","updated_at":"2016-05-07T22:45:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d39afe458b3ccd7a7e4c084f48152683f99639fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Alluxio/alluxio/pulls/3048/commits","review_comments_url":"https://api.github.com/repos/Alluxio/alluxio/pulls/3048/comments","review_comment_url":"https://api.github.com/repos/Alluxio/alluxio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Alluxio/alluxio/issues/3048/comments","statuses_url":"https://api.github.com/repos/Alluxio/alluxio/statuses/c0d43241af4c47dbd247bbdf32d7d49f80fdd4b1","head":{"label":"PasaLab:connect","ref":"connect","sha":"c0d43241af4c47dbd247bbdf32d7d49f80fdd4b1","user":{"login":"PasaLab","id":6230048,"avatar_url":"https://avatars.githubusercontent.com/u/6230048?v=3","gravatar_id":"","url":"https://api.github.com/users/PasaLab","html_url":"https://github.com/PasaLab","followers_url":"https://api.github.com/users/PasaLab/followers","following_url":"https://api.github.com/users/PasaLab/following{/other_user}","gists_url":"https://api.github.com/users/PasaLab/gists{/gist_id}","starred_url":"https://api.github.com/users/PasaLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PasaLab/subscriptions","organizations_url":"https://api.github.com/users/PasaLab/orgs","repos_url":"https://api.github.com/users/PasaLab/repos","events_url":"https://api.github.com/users/PasaLab/events{/privacy}","received_events_url":"https://api.github.com/users/PasaLab/received_events","type":"Organization","site_admin":false},"repo":{"id":21603565,"name":"tachyon","full_name":"PasaLab/tachyon","owner":{"login":"PasaLab","id":6230048,"avatar_url":"https://avatars.githubusercontent.com/u/6230048?v=3","gravatar_id":"","url":"https://api.github.com/users/PasaLab","html_url":"https://github.com/PasaLab","followers_url":"https://api.github.com/users/PasaLab/followers","following_url":"https://api.github.com/users/PasaLab/following{/other_user}","gists_url":"https://api.github.com/users/PasaLab/gists{/gist_id}","starred_url":"https://api.github.com/users/PasaLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PasaLab/subscriptions","organizations_url":"https://api.github.com/users/PasaLab/orgs","repos_url":"https://api.github.com/users/PasaLab/repos","events_url":"https://api.github.com/users/PasaLab/events{/privacy}","received_events_url":"https://api.github.com/users/PasaLab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PasaLab/tachyon","description":"Memory-centric Storage System for Big Data Analytics","fork":true,"url":"https://api.github.com/repos/PasaLab/tachyon","forks_url":"https://api.github.com/repos/PasaLab/tachyon/forks","keys_url":"https://api.github.com/repos/PasaLab/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PasaLab/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PasaLab/tachyon/teams","hooks_url":"https://api.github.com/repos/PasaLab/tachyon/hooks","issue_events_url":"https://api.github.com/repos/PasaLab/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/PasaLab/tachyon/events","assignees_url":"https://api.github.com/repos/PasaLab/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/PasaLab/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/PasaLab/tachyon/tags","blobs_url":"https://api.github.com/repos/PasaLab/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PasaLab/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PasaLab/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/PasaLab/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PasaLab/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/PasaLab/tachyon/languages","stargazers_url":"https://api.github.com/repos/PasaLab/tachyon/stargazers","contributors_url":"https://api.github.com/repos/PasaLab/tachyon/contributors","subscribers_url":"https://api.github.com/repos/PasaLab/tachyon/subscribers","subscription_url":"https://api.github.com/repos/PasaLab/tachyon/subscription","commits_url":"https://api.github.com/repos/PasaLab/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/PasaLab/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/PasaLab/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/PasaLab/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/PasaLab/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/PasaLab/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PasaLab/tachyon/merges","archive_url":"https://api.github.com/repos/PasaLab/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PasaLab/tachyon/downloads","issues_url":"https://api.github.com/repos/PasaLab/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/PasaLab/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/PasaLab/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/PasaLab/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PasaLab/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/PasaLab/tachyon/releases{/id}","deployments_url":"https://api.github.com/repos/PasaLab/tachyon/deployments","created_at":"2014-07-08T07:42:41Z","updated_at":"2016-01-27T01:44:37Z","pushed_at":"2016-05-04T12:24:44Z","git_url":"git://github.com/PasaLab/tachyon.git","ssh_url":"git@github.com:PasaLab/tachyon.git","clone_url":"https://github.com/PasaLab/tachyon.git","svn_url":"https://github.com/PasaLab/tachyon","homepage":"http://tachyon-project.org","size":48831,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Alluxio:connect","ref":"connect","sha":"94ce39e198aef7c9acb363a96d9f01655ae4382f","user":{"login":"Alluxio","id":16203694,"avatar_url":"https://avatars.githubusercontent.com/u/16203694?v=3","gravatar_id":"","url":"https://api.github.com/users/Alluxio","html_url":"https://github.com/Alluxio","followers_url":"https://api.github.com/users/Alluxio/followers","following_url":"https://api.github.com/users/Alluxio/following{/other_user}","gists_url":"https://api.github.com/users/Alluxio/gists{/gist_id}","starred_url":"https://api.github.com/users/Alluxio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alluxio/subscriptions","organizations_url":"https://api.github.com/users/Alluxio/orgs","repos_url":"https://api.github.com/users/Alluxio/repos","events_url":"https://api.github.com/users/Alluxio/events{/privacy}","received_events_url":"https://api.github.com/users/Alluxio/received_events","type":"Organization","site_admin":false},"repo":{"id":7276954,"name":"alluxio","full_name":"Alluxio/alluxio","owner":{"login":"Alluxio","id":16203694,"avatar_url":"https://avatars.githubusercontent.com/u/16203694?v=3","gravatar_id":"","url":"https://api.github.com/users/Alluxio","html_url":"https://github.com/Alluxio","followers_url":"https://api.github.com/users/Alluxio/followers","following_url":"https://api.github.com/users/Alluxio/following{/other_user}","gists_url":"https://api.github.com/users/Alluxio/gists{/gist_id}","starred_url":"https://api.github.com/users/Alluxio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alluxio/subscriptions","organizations_url":"https://api.github.com/users/Alluxio/orgs","repos_url":"https://api.github.com/users/Alluxio/repos","events_url":"https://api.github.com/users/Alluxio/events{/privacy}","received_events_url":"https://api.github.com/users/Alluxio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Alluxio/alluxio","description":"Alluxio, formerly Tachyon, Memory-Speed Virtual Distributed Storage System","fork":false,"url":"https://api.github.com/repos/Alluxio/alluxio","forks_url":"https://api.github.com/repos/Alluxio/alluxio/forks","keys_url":"https://api.github.com/repos/Alluxio/alluxio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alluxio/alluxio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alluxio/alluxio/teams","hooks_url":"https://api.github.com/repos/Alluxio/alluxio/hooks","issue_events_url":"https://api.github.com/repos/Alluxio/alluxio/issues/events{/number}","events_url":"https://api.github.com/repos/Alluxio/alluxio/events","assignees_url":"https://api.github.com/repos/Alluxio/alluxio/assignees{/user}","branches_url":"https://api.github.com/repos/Alluxio/alluxio/branches{/branch}","tags_url":"https://api.github.com/repos/Alluxio/alluxio/tags","blobs_url":"https://api.github.com/repos/Alluxio/alluxio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alluxio/alluxio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alluxio/alluxio/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alluxio/alluxio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alluxio/alluxio/statuses/{sha}","languages_url":"https://api.github.com/repos/Alluxio/alluxio/languages","stargazers_url":"https://api.github.com/repos/Alluxio/alluxio/stargazers","contributors_url":"https://api.github.com/repos/Alluxio/alluxio/contributors","subscribers_url":"https://api.github.com/repos/Alluxio/alluxio/subscribers","subscription_url":"https://api.github.com/repos/Alluxio/alluxio/subscription","commits_url":"https://api.github.com/repos/Alluxio/alluxio/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alluxio/alluxio/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alluxio/alluxio/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alluxio/alluxio/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alluxio/alluxio/contents/{+path}","compare_url":"https://api.github.com/repos/Alluxio/alluxio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alluxio/alluxio/merges","archive_url":"https://api.github.com/repos/Alluxio/alluxio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alluxio/alluxio/downloads","issues_url":"https://api.github.com/repos/Alluxio/alluxio/issues{/number}","pulls_url":"https://api.github.com/repos/Alluxio/alluxio/pulls{/number}","milestones_url":"https://api.github.com/repos/Alluxio/alluxio/milestones{/number}","notifications_url":"https://api.github.com/repos/Alluxio/alluxio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alluxio/alluxio/labels{/name}","releases_url":"https://api.github.com/repos/Alluxio/alluxio/releases{/id}","deployments_url":"https://api.github.com/repos/Alluxio/alluxio/deployments","created_at":"2012-12-21T17:43:46Z","updated_at":"2016-05-07T13:38:10Z","pushed_at":"2016-05-07T18:12:41Z","git_url":"git://github.com/Alluxio/alluxio.git","ssh_url":"git@github.com:Alluxio/alluxio.git","clone_url":"https://github.com/Alluxio/alluxio.git","svn_url":"https://github.com/Alluxio/alluxio","homepage":"http://www.alluxio.org/","size":80178,"stargazers_count":2331,"watchers_count":2331,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":917,"mirror_url":null,"open_issues_count":28,"forks":917,"open_issues":28,"watchers":2331,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/3048"},"html":{"href":"https://github.com/Alluxio/alluxio/pull/3048"},"issue":{"href":"https://api.github.com/repos/Alluxio/alluxio/issues/3048"},"comments":{"href":"https://api.github.com/repos/Alluxio/alluxio/issues/3048/comments"},"review_comments":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/3048/comments"},"review_comment":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/3048/commits"},"statuses":{"href":"https://api.github.com/repos/Alluxio/alluxio/statuses/c0d43241af4c47dbd247bbdf32d7d49f80fdd4b1"}}}}