{"action":"created","comment":{"url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/comments/41139722","id":41139722,"diff_hunk":"@@ -0,0 +1,124 @@\n+/*! ******************************************************************************\n+ *\n+ * Pentaho Data Integration\n+ *\n+ * Copyright (C) 2002-2014 by Pentaho : http://www.pentaho.com\n+ *\n+ *******************************************************************************\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with\n+ * 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\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ *\n+ ******************************************************************************/\n+\n+package org.pentaho.di.trans.steps.cassandrasstableoutput.writer;\n+\n+import org.apache.cassandra.config.YamlConfigurationLoader;\n+import org.pentaho.di.core.row.RowMetaInterface;\n+\n+/**\n+ * //TODO Add some javadoc or remove this comment\n+ *\n+ * @author Pavel Sakun\n+ */\n+public class SSTableWriterBuilder {\n+  /** Path to cassandra YAML config */\n+  private String configFilePath;\n+\n+  /** CQL Version */\n+  private int cqlVersion;\n+\n+  /** The directory to output to */\n+  private String directory;\n+\n+  /** The keyspace to use */\n+  private String keyspace;\n+\n+  /** The name of the column family (table) to write to */\n+  private String columnFamily;\n+\n+  /** The key field used to determine unique keys (IDs) for rows */\n+  private String keyField;\n+\n+  /** Size (MB) of write buffer */\n+  private int bufferSize;\n+\n+  /** Input row meta */\n+  private RowMetaInterface rowMeta;\n+\n+  public SSTableWriterBuilder withConfig(String configFilePath) {\n+    if ( ! configFilePath.startsWith( \"file:\" )) {\n+      this.configFilePath = \"file:\" + configFilePath;\n+    } else {\n+      this.configFilePath = configFilePath;\n+    }\n+    return this;\n+  }\n+\n+  public SSTableWriterBuilder withDirectory(String outputDirectoryPath) {\n+    this.directory = outputDirectoryPath;\n+    return this;\n+  }\n+\n+  public SSTableWriterBuilder withKeyspace(String keyspaceName) {\n+    this.keyspace = keyspaceName;\n+    return this;\n+  }\n+  public SSTableWriterBuilder withColumnFamily(String columnFamilyName) {\n+    this.columnFamily = columnFamilyName;\n+    return this;\n+  }\n+  public SSTableWriterBuilder withKeyField(String keyField) {\n+    this.keyField = keyField;\n+    return this;\n+  }\n+  public SSTableWriterBuilder withBufferSize(int bufferSize) {\n+    this.bufferSize = bufferSize;\n+    return this;\n+  }\n+\n+  public SSTableWriterBuilder withRowMeta(RowMetaInterface rowMeta) {\n+    this.rowMeta = rowMeta;\n+    return this;\n+  }\n+\n+  public SSTableWriterBuilder withCqlVersion(int cqlVersion) {\n+    this.cqlVersion = cqlVersion;\n+    return this;\n+  }\n+\n+  public AbstractSSTableWriter build() throws Exception {\n+    System.setProperty(\"cassandra.config\", configFilePath);","path":"src/org/pentaho/di/trans/steps/cassandrasstableoutput/writer/SSTableWriterBuilder.java","position":100,"original_position":100,"commit_id":"ddc459cbd9c738240900b90375d318e727cc38a5","original_commit_id":"ddc459cbd9c738240900b90375d318e727cc38a5","user":{"login":"dkincade","id":974494,"avatar_url":"https://avatars.githubusercontent.com/u/974494?v=3","gravatar_id":"","url":"https://api.github.com/users/dkincade","html_url":"https://github.com/dkincade","followers_url":"https://api.github.com/users/dkincade/followers","following_url":"https://api.github.com/users/dkincade/following{/other_user}","gists_url":"https://api.github.com/users/dkincade/gists{/gist_id}","starred_url":"https://api.github.com/users/dkincade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkincade/subscriptions","organizations_url":"https://api.github.com/users/dkincade/orgs","repos_url":"https://api.github.com/users/dkincade/repos","events_url":"https://api.github.com/users/dkincade/events{/privacy}","received_events_url":"https://api.github.com/users/dkincade/received_events","type":"User","site_admin":false},"body":"@pentaho-nbaker @mattyb149 - should we be avoiding the use of System.setProperty() or this a case where it would be justified?","created_at":"2015-10-05T12:54:43Z","updated_at":"2015-10-05T12:54:43Z","html_url":"https://github.com/pentaho/pentaho-cassandra-plugin/pull/54#discussion_r41139722","pull_request_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/54","_links":{"self":{"href":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/comments/41139722"},"html":{"href":"https://github.com/pentaho/pentaho-cassandra-plugin/pull/54#discussion_r41139722"},"pull_request":{"href":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/54","id":46753208,"html_url":"https://github.com/pentaho/pentaho-cassandra-plugin/pull/54","diff_url":"https://github.com/pentaho/pentaho-cassandra-plugin/pull/54.diff","patch_url":"https://github.com/pentaho/pentaho-cassandra-plugin/pull/54.patch","issue_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/issues/54","number":54,"state":"open","locked":false,"title":"PDI-8731 - Cassandra SSTable Output (bulkloader) step does not work with Cassandra 1.1.x","user":{"login":"stepanovdg","id":1208467,"avatar_url":"https://avatars.githubusercontent.com/u/1208467?v=3","gravatar_id":"","url":"https://api.github.com/users/stepanovdg","html_url":"https://github.com/stepanovdg","followers_url":"https://api.github.com/users/stepanovdg/followers","following_url":"https://api.github.com/users/stepanovdg/following{/other_user}","gists_url":"https://api.github.com/users/stepanovdg/gists{/gist_id}","starred_url":"https://api.github.com/users/stepanovdg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepanovdg/subscriptions","organizations_url":"https://api.github.com/users/stepanovdg/orgs","repos_url":"https://api.github.com/users/stepanovdg/repos","events_url":"https://api.github.com/users/stepanovdg/events{/privacy}","received_events_url":"https://api.github.com/users/stepanovdg/received_events","type":"User","site_admin":false},"body":"* To original pull-request https://github.com/pentaho/pentaho-cassandra-plugin/pull/45 added tests.\r\n* Also made some cosmetic changes","created_at":"2015-10-05T08:10:20Z","updated_at":"2015-10-05T12:54:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4fb95adb748b680bb9baa9d78235f3b7afcc68c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/54/commits","review_comments_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/54/comments","review_comment_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/issues/54/comments","statuses_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/statuses/ddc459cbd9c738240900b90375d318e727cc38a5","head":{"label":"stepanovdg:PDI-8731","ref":"PDI-8731","sha":"ddc459cbd9c738240900b90375d318e727cc38a5","user":{"login":"stepanovdg","id":1208467,"avatar_url":"https://avatars.githubusercontent.com/u/1208467?v=3","gravatar_id":"","url":"https://api.github.com/users/stepanovdg","html_url":"https://github.com/stepanovdg","followers_url":"https://api.github.com/users/stepanovdg/followers","following_url":"https://api.github.com/users/stepanovdg/following{/other_user}","gists_url":"https://api.github.com/users/stepanovdg/gists{/gist_id}","starred_url":"https://api.github.com/users/stepanovdg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepanovdg/subscriptions","organizations_url":"https://api.github.com/users/stepanovdg/orgs","repos_url":"https://api.github.com/users/stepanovdg/repos","events_url":"https://api.github.com/users/stepanovdg/events{/privacy}","received_events_url":"https://api.github.com/users/stepanovdg/received_events","type":"User","site_admin":false},"repo":{"id":21388270,"name":"pentaho-cassandra-plugin","full_name":"stepanovdg/pentaho-cassandra-plugin","owner":{"login":"stepanovdg","id":1208467,"avatar_url":"https://avatars.githubusercontent.com/u/1208467?v=3","gravatar_id":"","url":"https://api.github.com/users/stepanovdg","html_url":"https://github.com/stepanovdg","followers_url":"https://api.github.com/users/stepanovdg/followers","following_url":"https://api.github.com/users/stepanovdg/following{/other_user}","gists_url":"https://api.github.com/users/stepanovdg/gists{/gist_id}","starred_url":"https://api.github.com/users/stepanovdg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepanovdg/subscriptions","organizations_url":"https://api.github.com/users/stepanovdg/orgs","repos_url":"https://api.github.com/users/stepanovdg/repos","events_url":"https://api.github.com/users/stepanovdg/events{/privacy}","received_events_url":"https://api.github.com/users/stepanovdg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stepanovdg/pentaho-cassandra-plugin","description":"","fork":true,"url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin","forks_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/forks","keys_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/teams","hooks_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/hooks","issue_events_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/events","assignees_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/tags","blobs_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/languages","stargazers_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/stargazers","contributors_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/contributors","subscribers_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/subscribers","subscription_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/subscription","commits_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/merges","archive_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/downloads","issues_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/labels{/name}","releases_url":"https://api.github.com/repos/stepanovdg/pentaho-cassandra-plugin/releases{/id}","created_at":"2014-07-01T13:18:05Z","updated_at":"2014-06-19T23:25:56Z","pushed_at":"2015-10-05T08:07:27Z","git_url":"git://github.com/stepanovdg/pentaho-cassandra-plugin.git","ssh_url":"git@github.com:stepanovdg/pentaho-cassandra-plugin.git","clone_url":"https://github.com/stepanovdg/pentaho-cassandra-plugin.git","svn_url":"https://github.com/stepanovdg/pentaho-cassandra-plugin","homepage":null,"size":62659,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pentaho:master","ref":"master","sha":"8460f0ddb941c472009b5597fa4bef0499ac6e99","user":{"login":"pentaho","id":1022787,"avatar_url":"https://avatars.githubusercontent.com/u/1022787?v=3","gravatar_id":"","url":"https://api.github.com/users/pentaho","html_url":"https://github.com/pentaho","followers_url":"https://api.github.com/users/pentaho/followers","following_url":"https://api.github.com/users/pentaho/following{/other_user}","gists_url":"https://api.github.com/users/pentaho/gists{/gist_id}","starred_url":"https://api.github.com/users/pentaho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pentaho/subscriptions","organizations_url":"https://api.github.com/users/pentaho/orgs","repos_url":"https://api.github.com/users/pentaho/repos","events_url":"https://api.github.com/users/pentaho/events{/privacy}","received_events_url":"https://api.github.com/users/pentaho/received_events","type":"Organization","site_admin":false},"repo":{"id":10365279,"name":"pentaho-cassandra-plugin","full_name":"pentaho/pentaho-cassandra-plugin","owner":{"login":"pentaho","id":1022787,"avatar_url":"https://avatars.githubusercontent.com/u/1022787?v=3","gravatar_id":"","url":"https://api.github.com/users/pentaho","html_url":"https://github.com/pentaho","followers_url":"https://api.github.com/users/pentaho/followers","following_url":"https://api.github.com/users/pentaho/following{/other_user}","gists_url":"https://api.github.com/users/pentaho/gists{/gist_id}","starred_url":"https://api.github.com/users/pentaho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pentaho/subscriptions","organizations_url":"https://api.github.com/users/pentaho/orgs","repos_url":"https://api.github.com/users/pentaho/repos","events_url":"https://api.github.com/users/pentaho/events{/privacy}","received_events_url":"https://api.github.com/users/pentaho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pentaho/pentaho-cassandra-plugin","description":"","fork":false,"url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin","forks_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/forks","keys_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/teams","hooks_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/hooks","issue_events_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/events","assignees_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/tags","blobs_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/languages","stargazers_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/stargazers","contributors_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/contributors","subscribers_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/subscribers","subscription_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/subscription","commits_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/merges","archive_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/downloads","issues_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/labels{/name}","releases_url":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/releases{/id}","created_at":"2013-05-29T17:33:12Z","updated_at":"2015-07-21T18:54:25Z","pushed_at":"2015-10-05T08:10:20Z","git_url":"git://github.com/pentaho/pentaho-cassandra-plugin.git","ssh_url":"git@github.com:pentaho/pentaho-cassandra-plugin.git","clone_url":"https://github.com/pentaho/pentaho-cassandra-plugin.git","svn_url":"https://github.com/pentaho/pentaho-cassandra-plugin","homepage":null,"size":64178,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":3,"forks":27,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/54"},"html":{"href":"https://github.com/pentaho/pentaho-cassandra-plugin/pull/54"},"issue":{"href":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/issues/54"},"comments":{"href":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/pentaho/pentaho-cassandra-plugin/statuses/ddc459cbd9c738240900b90375d318e727cc38a5"}}}}