{"action":"created","comment":{"url":"https://api.github.com/repos/locationtech/geomesa/pulls/comments/66061342","id":66061342,"diff_hunk":"@@ -0,0 +1,93 @@\n+/***********************************************************************\n+* Copyright (c) 2013-2016 Commonwealth Computer Research, Inc.\n+* All rights reserved. This program and the accompanying materials\n+* are made available under the terms of the Apache License, Version 2.0\n+* which accompanies this distribution and is available at\n+* http://www.opensource.org/licenses/apache2.0.php.\n+*************************************************************************/\n+\n+package org.locationtech.geomesa.tools.accumulo.commands\n+\n+import com.beust.jcommander.converters.{IParameterSplitter}\n+import com.beust.jcommander._\n+import org.geotools.data.DataStoreFinder\n+import org.locationtech.geomesa.tools.accumulo.commands.KeywordCommand.KeywordParameters\n+import org.locationtech.geomesa.tools.accumulo.{DataStoreHelper, GeoMesaConnectionParams}\n+import org.locationtech.geomesa.tools.common.OptionalFeatureTypeNameParam\n+import org.locationtech.geomesa.tools.common.commands._\n+\n+import scala.collection.JavaConversions._\n+import scala.io.StdIn\n+\n+class KeywordCommand(parent: JCommander) extends Command(parent) {\n+  import org.locationtech.geomesa.utils.geotools.RichSimpleFeatureType._\n+  override val command: String = \"keyword\"\n+  override val params = new KeywordParameters()\n+\n+  override def execute(): Unit = {\n+    val dsParams = new DataStoreHelper(params).paramMap\n+    val tryDs = DataStoreFinder.getDataStore(dsParams)\n+    if (tryDs == null) {\n+      throw new ParameterException(\"Could not load a data store with the provided parameters\")\n+    }\n+    tryDs.dispose()\n+\n+    val sft = tryDs.getSchema(params.featureName)\n+\n+    if (params.keywordsToAdd != null) {\n+      sft.addKeywords(params.keywordsToAdd.mkString(KEYWORDS_DELIMITER))\n+    }\n+\n+    if (params.keywordsToRemove != null) {\n+      sft.removeKeywords(params.keywordsToRemove.mkString(KEYWORDS_DELIMITER))\n+    }\n+\n+    if (params.removeAll) {\n+      val confirm = StdIn.readLine(\"Remove all keywords? (y/n): \")\n+      if (confirm.equals(\"y\")) {\n+        sft.removeAllKeywords()\n+      }\n+    }\n+\n+    tryDs.updateSchema(params.featureName, sft)\n+\n+    if (params.list) {\n+      println(\"Keywords: \" + sft.getKeywords.toString)\n+    }\n+\n+  }\n+\n+\n+}\n+\n+// Overrides JCommander's split on comma\n+class KeywordParameterSplitter extends IParameterSplitter {\n+  override def split(s : String): java.util.List[String] = s.split(\"\\u0000\").toList\n+}\n+\n+object KeywordCommand {\n+\n+  @Parameters(commandDescription = \"Add/Remove keywords on an existing schema\")","path":"geomesa-tools/src/main/scala/org/locationtech/geomesa/tools/accumulo/commands/KeywordCommand.scala","position":70,"original_position":70,"commit_id":"f8f2652e3bb894f0142214a7406ee0893bbb31e8","original_commit_id":"f8f2652e3bb894f0142214a7406ee0893bbb31e8","user":{"login":"elahrvivaz","id":7715322,"avatar_url":"https://avatars.githubusercontent.com/u/7715322?v=3","gravatar_id":"","url":"https://api.github.com/users/elahrvivaz","html_url":"https://github.com/elahrvivaz","followers_url":"https://api.github.com/users/elahrvivaz/followers","following_url":"https://api.github.com/users/elahrvivaz/following{/other_user}","gists_url":"https://api.github.com/users/elahrvivaz/gists{/gist_id}","starred_url":"https://api.github.com/users/elahrvivaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elahrvivaz/subscriptions","organizations_url":"https://api.github.com/users/elahrvivaz/orgs","repos_url":"https://api.github.com/users/elahrvivaz/repos","events_url":"https://api.github.com/users/elahrvivaz/events{/privacy}","received_events_url":"https://api.github.com/users/elahrvivaz/received_events","type":"User","site_admin":false},"body":"I would add 'List' to the description - e.g. 'add/remove/list'","created_at":"2016-06-07T12:32:10Z","updated_at":"2016-06-07T12:32:10Z","html_url":"https://github.com/locationtech/geomesa/pull/908#discussion_r66061342","pull_request_url":"https://api.github.com/repos/locationtech/geomesa/pulls/908","_links":{"self":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/comments/66061342"},"html":{"href":"https://github.com/locationtech/geomesa/pull/908#discussion_r66061342"},"pull_request":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/908"}}},"pull_request":{"url":"https://api.github.com/repos/locationtech/geomesa/pulls/908","id":72778290,"html_url":"https://github.com/locationtech/geomesa/pull/908","diff_url":"https://github.com/locationtech/geomesa/pull/908.diff","patch_url":"https://github.com/locationtech/geomesa/pull/908.patch","issue_url":"https://api.github.com/repos/locationtech/geomesa/issues/908","number":908,"state":"open","locked":false,"title":"Implements command line tools for adding and removing keywords","user":{"login":"atallahhezbor","id":7144661,"avatar_url":"https://avatars.githubusercontent.com/u/7144661?v=3","gravatar_id":"","url":"https://api.github.com/users/atallahhezbor","html_url":"https://github.com/atallahhezbor","followers_url":"https://api.github.com/users/atallahhezbor/followers","following_url":"https://api.github.com/users/atallahhezbor/following{/other_user}","gists_url":"https://api.github.com/users/atallahhezbor/gists{/gist_id}","starred_url":"https://api.github.com/users/atallahhezbor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atallahhezbor/subscriptions","organizations_url":"https://api.github.com/users/atallahhezbor/orgs","repos_url":"https://api.github.com/users/atallahhezbor/repos","events_url":"https://api.github.com/users/atallahhezbor/events{/privacy}","received_events_url":"https://api.github.com/users/atallahhezbor/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Atallah Hezbor <atallahhezbor@gmail.com>","created_at":"2016-06-06T21:08:29Z","updated_at":"2016-06-07T12:32:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"73b3d46fb953132008fb54c2df63a915cecf82d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/locationtech/geomesa/pulls/908/commits","review_comments_url":"https://api.github.com/repos/locationtech/geomesa/pulls/908/comments","review_comment_url":"https://api.github.com/repos/locationtech/geomesa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/locationtech/geomesa/issues/908/comments","statuses_url":"https://api.github.com/repos/locationtech/geomesa/statuses/f8f2652e3bb894f0142214a7406ee0893bbb31e8","head":{"label":"ccri:keywords_cli","ref":"keywords_cli","sha":"f8f2652e3bb894f0142214a7406ee0893bbb31e8","user":{"login":"ccri","id":1089783,"avatar_url":"https://avatars.githubusercontent.com/u/1089783?v=3","gravatar_id":"","url":"https://api.github.com/users/ccri","html_url":"https://github.com/ccri","followers_url":"https://api.github.com/users/ccri/followers","following_url":"https://api.github.com/users/ccri/following{/other_user}","gists_url":"https://api.github.com/users/ccri/gists{/gist_id}","starred_url":"https://api.github.com/users/ccri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccri/subscriptions","organizations_url":"https://api.github.com/users/ccri/orgs","repos_url":"https://api.github.com/users/ccri/repos","events_url":"https://api.github.com/users/ccri/events{/privacy}","received_events_url":"https://api.github.com/users/ccri/received_events","type":"Organization","site_admin":false},"repo":{"id":16865543,"name":"geomesa","full_name":"ccri/geomesa","owner":{"login":"ccri","id":1089783,"avatar_url":"https://avatars.githubusercontent.com/u/1089783?v=3","gravatar_id":"","url":"https://api.github.com/users/ccri","html_url":"https://github.com/ccri","followers_url":"https://api.github.com/users/ccri/followers","following_url":"https://api.github.com/users/ccri/following{/other_user}","gists_url":"https://api.github.com/users/ccri/gists{/gist_id}","starred_url":"https://api.github.com/users/ccri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccri/subscriptions","organizations_url":"https://api.github.com/users/ccri/orgs","repos_url":"https://api.github.com/users/ccri/repos","events_url":"https://api.github.com/users/ccri/events{/privacy}","received_events_url":"https://api.github.com/users/ccri/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ccri/geomesa","description":"docs","fork":true,"url":"https://api.github.com/repos/ccri/geomesa","forks_url":"https://api.github.com/repos/ccri/geomesa/forks","keys_url":"https://api.github.com/repos/ccri/geomesa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ccri/geomesa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ccri/geomesa/teams","hooks_url":"https://api.github.com/repos/ccri/geomesa/hooks","issue_events_url":"https://api.github.com/repos/ccri/geomesa/issues/events{/number}","events_url":"https://api.github.com/repos/ccri/geomesa/events","assignees_url":"https://api.github.com/repos/ccri/geomesa/assignees{/user}","branches_url":"https://api.github.com/repos/ccri/geomesa/branches{/branch}","tags_url":"https://api.github.com/repos/ccri/geomesa/tags","blobs_url":"https://api.github.com/repos/ccri/geomesa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ccri/geomesa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ccri/geomesa/git/refs{/sha}","trees_url":"https://api.github.com/repos/ccri/geomesa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ccri/geomesa/statuses/{sha}","languages_url":"https://api.github.com/repos/ccri/geomesa/languages","stargazers_url":"https://api.github.com/repos/ccri/geomesa/stargazers","contributors_url":"https://api.github.com/repos/ccri/geomesa/contributors","subscribers_url":"https://api.github.com/repos/ccri/geomesa/subscribers","subscription_url":"https://api.github.com/repos/ccri/geomesa/subscription","commits_url":"https://api.github.com/repos/ccri/geomesa/commits{/sha}","git_commits_url":"https://api.github.com/repos/ccri/geomesa/git/commits{/sha}","comments_url":"https://api.github.com/repos/ccri/geomesa/comments{/number}","issue_comment_url":"https://api.github.com/repos/ccri/geomesa/issues/comments{/number}","contents_url":"https://api.github.com/repos/ccri/geomesa/contents/{+path}","compare_url":"https://api.github.com/repos/ccri/geomesa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ccri/geomesa/merges","archive_url":"https://api.github.com/repos/ccri/geomesa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ccri/geomesa/downloads","issues_url":"https://api.github.com/repos/ccri/geomesa/issues{/number}","pulls_url":"https://api.github.com/repos/ccri/geomesa/pulls{/number}","milestones_url":"https://api.github.com/repos/ccri/geomesa/milestones{/number}","notifications_url":"https://api.github.com/repos/ccri/geomesa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ccri/geomesa/labels{/name}","releases_url":"https://api.github.com/repos/ccri/geomesa/releases{/id}","deployments_url":"https://api.github.com/repos/ccri/geomesa/deployments","created_at":"2014-02-15T15:39:50Z","updated_at":"2016-02-17T20:03:55Z","pushed_at":"2016-06-06T21:08:13Z","git_url":"git://github.com/ccri/geomesa.git","ssh_url":"git@github.com:ccri/geomesa.git","clone_url":"https://github.com/ccri/geomesa.git","svn_url":"https://github.com/ccri/geomesa","homepage":"","size":39952,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"locationtech:master","ref":"master","sha":"3740acf334f3a518b7481e0d292de3ae7a983fff","user":{"login":"locationtech","id":1991411,"avatar_url":"https://avatars.githubusercontent.com/u/1991411?v=3","gravatar_id":"","url":"https://api.github.com/users/locationtech","html_url":"https://github.com/locationtech","followers_url":"https://api.github.com/users/locationtech/followers","following_url":"https://api.github.com/users/locationtech/following{/other_user}","gists_url":"https://api.github.com/users/locationtech/gists{/gist_id}","starred_url":"https://api.github.com/users/locationtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/locationtech/subscriptions","organizations_url":"https://api.github.com/users/locationtech/orgs","repos_url":"https://api.github.com/users/locationtech/repos","events_url":"https://api.github.com/users/locationtech/events{/privacy}","received_events_url":"https://api.github.com/users/locationtech/received_events","type":"Organization","site_admin":false},"repo":{"id":13226069,"name":"geomesa","full_name":"locationtech/geomesa","owner":{"login":"locationtech","id":1991411,"avatar_url":"https://avatars.githubusercontent.com/u/1991411?v=3","gravatar_id":"","url":"https://api.github.com/users/locationtech","html_url":"https://github.com/locationtech","followers_url":"https://api.github.com/users/locationtech/followers","following_url":"https://api.github.com/users/locationtech/following{/other_user}","gists_url":"https://api.github.com/users/locationtech/gists{/gist_id}","starred_url":"https://api.github.com/users/locationtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/locationtech/subscriptions","organizations_url":"https://api.github.com/users/locationtech/orgs","repos_url":"https://api.github.com/users/locationtech/repos","events_url":"https://api.github.com/users/locationtech/events{/privacy}","received_events_url":"https://api.github.com/users/locationtech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/locationtech/geomesa","description":"GeoMesa is a suite of tools for working with big geo-spatial data in a distributed fashion.","fork":false,"url":"https://api.github.com/repos/locationtech/geomesa","forks_url":"https://api.github.com/repos/locationtech/geomesa/forks","keys_url":"https://api.github.com/repos/locationtech/geomesa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/locationtech/geomesa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/locationtech/geomesa/teams","hooks_url":"https://api.github.com/repos/locationtech/geomesa/hooks","issue_events_url":"https://api.github.com/repos/locationtech/geomesa/issues/events{/number}","events_url":"https://api.github.com/repos/locationtech/geomesa/events","assignees_url":"https://api.github.com/repos/locationtech/geomesa/assignees{/user}","branches_url":"https://api.github.com/repos/locationtech/geomesa/branches{/branch}","tags_url":"https://api.github.com/repos/locationtech/geomesa/tags","blobs_url":"https://api.github.com/repos/locationtech/geomesa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/locationtech/geomesa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/locationtech/geomesa/git/refs{/sha}","trees_url":"https://api.github.com/repos/locationtech/geomesa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/locationtech/geomesa/statuses/{sha}","languages_url":"https://api.github.com/repos/locationtech/geomesa/languages","stargazers_url":"https://api.github.com/repos/locationtech/geomesa/stargazers","contributors_url":"https://api.github.com/repos/locationtech/geomesa/contributors","subscribers_url":"https://api.github.com/repos/locationtech/geomesa/subscribers","subscription_url":"https://api.github.com/repos/locationtech/geomesa/subscription","commits_url":"https://api.github.com/repos/locationtech/geomesa/commits{/sha}","git_commits_url":"https://api.github.com/repos/locationtech/geomesa/git/commits{/sha}","comments_url":"https://api.github.com/repos/locationtech/geomesa/comments{/number}","issue_comment_url":"https://api.github.com/repos/locationtech/geomesa/issues/comments{/number}","contents_url":"https://api.github.com/repos/locationtech/geomesa/contents/{+path}","compare_url":"https://api.github.com/repos/locationtech/geomesa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/locationtech/geomesa/merges","archive_url":"https://api.github.com/repos/locationtech/geomesa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/locationtech/geomesa/downloads","issues_url":"https://api.github.com/repos/locationtech/geomesa/issues{/number}","pulls_url":"https://api.github.com/repos/locationtech/geomesa/pulls{/number}","milestones_url":"https://api.github.com/repos/locationtech/geomesa/milestones{/number}","notifications_url":"https://api.github.com/repos/locationtech/geomesa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/locationtech/geomesa/labels{/name}","releases_url":"https://api.github.com/repos/locationtech/geomesa/releases{/id}","deployments_url":"https://api.github.com/repos/locationtech/geomesa/deployments","created_at":"2013-09-30T20:13:46Z","updated_at":"2016-05-31T04:53:20Z","pushed_at":"2016-06-06T21:08:29Z","git_url":"git://github.com/locationtech/geomesa.git","ssh_url":"git@github.com:locationtech/geomesa.git","clone_url":"https://github.com/locationtech/geomesa.git","svn_url":"https://github.com/locationtech/geomesa","homepage":"https://www.locationtech.org/projects/technology.geomesa","size":44266,"stargazers_count":176,"watchers_count":176,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":89,"mirror_url":null,"open_issues_count":6,"forks":89,"open_issues":6,"watchers":176,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/908"},"html":{"href":"https://github.com/locationtech/geomesa/pull/908"},"issue":{"href":"https://api.github.com/repos/locationtech/geomesa/issues/908"},"comments":{"href":"https://api.github.com/repos/locationtech/geomesa/issues/908/comments"},"review_comments":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/908/comments"},"review_comment":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/908/commits"},"statuses":{"href":"https://api.github.com/repos/locationtech/geomesa/statuses/f8f2652e3bb894f0142214a7406ee0893bbb31e8"}}}}
{"actor":{"display_login":"elahrvivaz"}}