GitHub PullRequestReviewCommentEvent at 2014-02-17 17:53:21
Repository: javacountdown
Actor: karianna
Payload: {"comment":{"url":"https://api.github.com/repos/AdoptOpenJDK/javacountdown/pulls/comments/9799383","id":9799383,"diff_hunk":"@@ -0,0 +1,131 @@\n+package org.adoptopenjdk.javacountdown;\r\n+\r\n+import java.io.BufferedReader;\r\n+import java.io.FileNotFoundException;\r\n+import java.io.IOException;\r\n+import java.io.UnsupportedEncodingException;\r\n+import java.net.UnknownHostException;\r\n+\r\n+import com.mongodb.BasicDBObject;\r\n+import com.mongodb.DB;\r\n+import com.mongodb.DBCollection;\r\n+import com.mongodb.MongoClient;\r\n+\r\n+import java.io.File;\r\n+import java.io.FileInputStream;\r\n+import java.io.InputStreamReader;\r\n+\r\n+\r\n+public class ImportGeoData {\r\n+\t\r\n+\tprivate static final int PORT \t\t= 27017;\r\n+\tprivate static final String HOST \t= \"localhost\";\r\n+\t\r\n+\tprivate static final String COLLECTION_NAME = \"geoposition\";\r\n+\tprivate static final String DATABASE_NAME \t= \"jcountdown\";\r\n+\r\n+\tprivate static final String CSV_FILE_LOCATION \t\t= \"geoposition.csv\";\r\n+\t//private static final String CSV_TEST_FILE_LOCATION \t= \"geoposition_snapshot.csv\";\r\n+\r\n+\t\r\n+\tpublic static void main(String... args) {\r\n+\t\tImportGeoData importGeoData = new ImportGeoData();\r\n+\t\timportGeoData.execute();\r\n+\t}\r\n+\r\n+\t\r\n+\t\r\n+\t/**\r\n+\t * This method performs the import into the Mongo database.\r\n+\t */\r\n+\tpublic void execute() {\r\n+\r\n+\t\tString csvFile \t\t= CSV_FILE_LOCATION;\r\n+\t\tBufferedReader br \t= null;\r\n+\t\tString line \t\t= \"\";\r\n+\t\tString delimiter \t= \",\";\r\n+\t\t\r\n+\t\tJSONUtility jsonUtility = new JSONUtility();\r\n+\t\tDBCollection coll \t\t= createDBConnection();\r\n+\r\n+\t\ttry {\r","path":"javacountdown-ee6/src/main/java/org/adoptopenjdk/javacountdown/ImportGeoData.java","position":51,"original_position":51,"commit_id":"2db82c356ad9731579886630589f201ae9da3ab2","original_commit_id":"2db82c356ad9731579886630589f201ae9da3ab2","user":{"login":"karianna","id":180840,"avatar_url":"https://gravatar.com/avatar/aa753737ed7ccc5f27c71687afcd39b6?d=https%3A%2F%2Fidenticons.github.com%2Fe93bcffb849519450652935753dff534.png&r=x","gravatar_id":"aa753737ed7ccc5f27c71687afcd39b6","url":"https://api.github.com/users/karianna","html_url":"https://github.com/karianna","followers_url":"https://api.github.com/users/karianna/followers","following_url":"https://api.github.com/users/karianna/following{/other_user}","gists_url":"https://api.github.com/users/karianna/gists{/gist_id}","starred_url":"https://api.github.com/users/karianna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karianna/subscriptions","organizations_url":"https://api.github.com/users/karianna/orgs","repos_url":"https://api.github.com/users/karianna/repos","events_url":"https://api.github.com/users/karianna/events{/privacy}","received_events_url":"https://api.github.com/users/karianna/received_events","type":"User","site_admin":false},"body":"But what if that import goes wrong? :-D - could have partial/no/corrupt data (you never know with Mongo in particular...)","created_at":"2014-02-17T17:53:21Z","updated_at":"2014-02-17T17:53:21Z","html_url":"https://github.com/AdoptOpenJDK/javacountdown/pull/67#discussion_r9799383","pull_request_url":"https://api.github.com/repos/AdoptOpenJDK/javacountdown/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/AdoptOpenJDK/javacountdown/pulls/comments/9799383"},"html":{"href":"https://github.com/AdoptOpenJDK/javacountdown/pull/67#discussion_r9799383"},"pull_request":{"href":"https://api.github.com/repos/AdoptOpenJDK/javacountdown/pulls/67"}}}}