{"id":2960,"date":"2012-11-07T10:00:28","date_gmt":"2012-11-07T08:00:28","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=2960"},"modified":"2012-11-07T11:06:54","modified_gmt":"2012-11-07T09:06:54","slug":"couchbase-create-a-large-dataset-using-twitter-and-java","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html","title":{"rendered":"Couchbase : Create a large dataset using Twitter and Java"},"content":{"rendered":"<p>An easy way to create large dataset when playing\/demonstrating Couchbase -or any other NoSQL engine- is to inject Twitter feed into your database.<\/p>\n<p>For this small application I am using:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.couchbase.com\/downloads-all#couchbase-server-2-0\" target=\"_blank\">Couchbase Server 2.0 Server<\/a><\/li>\n<li><a href=\"http:\/\/www.couchbase.com\/develop\/java\/next\" target=\"_blank\">Couchbase Java SDK<\/a> (will be installed by Maven)<\/li>\n<li><a href=\"http:\/\/twitter4j.org\/\" target=\"_blank\">Twitter4J<\/a> (will be installed by Maven)<\/li>\n<li><a href=\"https:\/\/dev.twitter.com\/docs\/streaming-apis\" target=\"_blank\">Twitter Streaming API<\/a> called using Twitter4J<\/li>\n<\/ul>\n<p>In this example I am using Java to inject Tweets into Couchbase, you can obviously use another langage if you want to.<\/p>\n<p>The sources of this project are available on my Github repository\u00a0<a href=\"https:\/\/github.com\/tgrall\/couchbase-twitter-injector\" target=\"_blank\">Twitter Injector for Couchbase<\/a> you can also download the Binary version\u00a0<a href=\"https:\/\/github.com\/downloads\/tgrall\/couchbase-twitter-injector\/CouchbaseTwitterInjector.jar\" target=\"_blank\">here<\/a>, and execute the application from the command line, see <a href=\"http:\/\/www.blogger.com\/blogger.g?blogID=785895453418216075#runTheApp\" target=\"_blank\">Run The Application paragraph<\/a>. Do not forget to create your Twitter oAuth keys (see next paragraph)<\/p>\n<p><strong>Create oAuth Keys<\/strong><\/p>\n<p>The first thing to do to be able to use the Twitter API is to create a set of keys. If you want to learn more about all these keys\/tokens take a look to the oAuth protocol :\u00a0<a href=\"http:\/\/oauth.net\/\" target=\"_blank\">http:\/\/oauth.net\/<\/a><\/p>\n<p>1. Log in into the Twitter Development Portal :\u00a0<a href=\"https:\/\/dev.twitter.com\/\" target=\"_blank\">https:\/\/dev.twitter.com\/<\/a><\/p>\n<p>2. Create a new Application<\/p>\n<p>Click on the &#8216;Create an App&#8217; link or go into the &#8216;User Menu &gt; My Applications &gt; Create a new application&#8217;<\/p>\n<p>3. Enter the Application Details information<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-001.png\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-2961\" title=\"couchbase-twitter-001\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-001-300x163.png\" alt=\"\" width=\"300\" height=\"163\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-001-300x163.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-001.png 879w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>4. Click &#8216;Create Your Twitter Application&#8217; button<\/p>\n<p>Your application&#8217;s OAuth settings are now available :<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-002.png\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-2962\" title=\"couchbase-twitter-002\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-002-300x131.png\" alt=\"\" width=\"300\" height=\"131\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-002-300x131.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-002.png 816w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>5- Go down on the Application Settings page and click on the &#8216;Create My Access Token&#8217; button<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-003.png\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-2963\" title=\"couchbase-twitter-003\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-003-300x85.png\" alt=\"\" width=\"300\" height=\"85\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-003-300x85.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/11\/couchbase-twitter-003.png 946w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>You have now all the necessary information to create your application:<\/p>\n<ul>\n<li>Consumer key<\/li>\n<li>Consumer secret<\/li>\n<li>Access token<\/li>\n<li>Access token secret<\/li>\n<\/ul>\n<p>These keys will be uses in the <code>twitter4j.properties<\/code> file when running the Java application from the command line see<\/p>\n<p><strong>Create the Java Application<br \/>\n<\/strong><br \/>\nThe following code is the main code of the application:<\/p>\n<pre class=\"brush:java\">package com.couchbase.demo;\r\n\r\nimport com.couchbase.client.CouchbaseClient;\r\nimport org.json.JSONException;\r\nimport org.json.JSONObject;\r\nimport twitter4j.*;\r\nimport twitter4j.json.DataObjectFactory;\r\n\r\nimport java.io.InputStream;\r\nimport java.net.URI;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\nimport java.util.Properties;\r\n\r\npublic class TwitterInjector {\r\n\r\n    public final static String COUCHBASE_URIS = \"couchbase.uri.list\";\r\n    public final static String COUCHBASE_BUCKET = \"couchbase.bucket\";\r\n    public final static String COUCHBASE_PASSWORD = \"couchbase.password\";\r\n\r\n    private List&lt;URI&gt; couchbaseServerUris = new ArrayList&lt;URI&gt;();\r\n    private String couchbaseBucket = \"default\";\r\n    private String couchbasePassword = \"\";\r\n\r\n    public static void main(String[] args) {\r\n        TwitterInjector twitterInjector = new TwitterInjector();\r\n        twitterInjector.setUp();\r\n        twitterInjector.injectTweets();\r\n    }\r\n\r\n    private void setUp() {\r\n        try {\r\n            Properties prop = new Properties();\r\n            InputStream in = TwitterInjector.class.getClassLoader().getResourceAsStream(\"twitter4j.properties\");\r\n            if (in == null) {\r\n                throw new Exception(\"File twitter4j.properties not found\");\r\n            }\r\n            prop.load(in);\r\n            in.close();\r\n\r\n            if (prop.containsKey(COUCHBASE_URIS)) {\r\n                String[] uriStrings =  prop.getProperty(COUCHBASE_URIS).split(\",\");\r\n                for (int i=0; i&lt;uriStrings.length; i++) {\r\n                    couchbaseServerUris.add( new URI( uriStrings[i] ) );\r\n                }\r\n\r\n            } else {\r\n                couchbaseServerUris.add( new URI(\"http:\/\/127.0.0.1:8091\/pools\") );\r\n            }\r\n\r\n            if (prop.containsKey(COUCHBASE_BUCKET)) {\r\n                couchbaseBucket = prop.getProperty(COUCHBASE_BUCKET);\r\n            }\r\n\r\n            if (prop.containsKey(COUCHBASE_PASSWORD)) {\r\n                couchbasePassword = prop.getProperty(COUCHBASE_PASSWORD);\r\n\r\n            }\r\n\r\n        } catch (Exception e) {\r\n            System.out.println( e.getMessage() );\r\n            System.exit(0);\r\n        }\r\n\r\n    }\r\n\r\n    private void injectTweets() {\r\n        TwitterStream twitterStream = new TwitterStreamFactory().getInstance();\r\n        try {\r\n            final CouchbaseClient cbClient = new CouchbaseClient( couchbaseServerUris , couchbaseBucket , couchbasePassword );\r\n            System.out.println(\"Send data to : \"+  couchbaseServerUris +\"\/\"+ couchbaseBucket );\r\n            StatusListener listener = new StatusListener() {\r\n\r\n                @Override\r\n                public void onStatus(Status status) {\r\n                    String twitterMessage = DataObjectFactory.getRawJSON(status);\r\n\r\n                    \/\/ extract the id_str from the JSON document\r\n                    \/\/ see : https:\/\/dev.twitter.com\/docs\/twitter-ids-json-and-snowflake\r\n                    try {\r\n                        JSONObject statusAsJson = new JSONObject(twitterMessage);\r\n                        String idStr = statusAsJson.getString(\"id_str\");\r\n                        cbClient.add( idStr ,0, twitterMessage  );\r\n                        System.out.print(\".\");\r\n                    } catch (JSONException e) {\r\n                        e.printStackTrace(); \r\n                    }\r\n                }\r\n\r\n                @Override\r\n                public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {\r\n                }\r\n\r\n                @Override\r\n                public void onTrackLimitationNotice(int numberOfLimitedStatuses) {\r\n                }\r\n\r\n                @Override\r\n                public void onScrubGeo(long userId, long upToStatusId) {\r\n                }\r\n\r\n                @Override\r\n                public void onException(Exception ex) {\r\n                    ex.printStackTrace();\r\n                }\r\n            };\r\n\r\n        twitterStream.addListener(listener);\r\n        twitterStream.sample();\r\n\r\n        } catch (Exception e) {\r\n            e.printStackTrace();  \r\n        }\r\n    }\r\n\r\n}<\/pre>\n<p>Some basic explanation:<\/p>\n<ul>\n<li>The<code> setUp()<\/code> method simply reads the <code>twitter4j.properties<\/code> file from the classpath to build the Couchbase connection string.<\/li>\n<li>The injectTweets opens the Couchbase connection -line 76- and calls the TwitterStream API.<\/li>\n<li>A <code>Listener <\/code>is created and will receive all the <code>onStatus<\/code>(Status status) from Twitter. The most important method is onStatus() that receive the message and save it into Couchbase.<\/li>\n<li>One interesting thing : since <code>Couchbase <\/code>is a JSON Document database it allows your to just take the JSON String and save it directly.<br \/>\n<code>cbClient.add(idStr,0 ,twitterMessage);<\/code><\/li>\n<\/ul>\n<p>&nbsp;<br \/>\n<strong>Packaging<\/strong><\/p>\n<p>To be able to execute the application directly from the Jar file, I am using the assembly plugin with the following informations from the<br \/>\npom.xml :<\/p>\n<pre class=\" brush:xml\">... \r\n&lt;archive&gt;\r\n  &lt;manifest&gt;\r\n   &lt;mainclass&gt;com.couchbase.demo.TwitterInjector&lt;\/mainclass&gt;\r\n  &lt;\/manifest&gt;\r\n  &lt;manifestentries&gt;\r\n   &lt;class-path&gt;.&lt;\/class-path&gt;\r\n  &lt;\/manifestentries&gt;\r\n&lt;\/archive&gt;\r\n...<\/pre>\n<p>Some information:<\/p>\n<ul>\n<li>The mainClass entry allows you to set which class to execute when running java -jar command.<\/li>\n<li>The Class-Path entry allows you to set the current directory as part of the classpath where the program will search for the twitter4j.properties file.<\/li>\n<li>The assembly file is also configure to include all the dependencies (Twitter4J, Couchbase client SDK, &#8230;)<\/li>\n<\/ul>\n<p>If you do want to build it from the sources, simply run :<\/p>\n<pre class=\" brush:bash\">mvn clean package<\/pre>\n<p>This will create the following Jar file .<code> \/target\/CouchbaseTwitterInjector.jar<\/code><\/p>\n<p><strong>Run the Java Application<br \/>\n<\/strong><br \/>\nBefore running the application you must create a twitter4j.properties file with the following information :<\/p>\n<pre class=\" brush:java\">twitter4j.jsonStoreEnabled=true\r\n\r\noauth.consumerKey=[YOUR CONSUMER KEY]\r\noauth.consumerSecret=[YOUR CONSUMER SECRET KEY]\r\noauth.accessToken=[YOUR ACCESS TOKEN]\r\noauth.accessTokenSecret=[YOUR ACCESS TOKEN SECRET]\r\n\r\ncouchbase.uri.list=http:\/\/127.0.0.1:8091\/pools\r\ncouchbase.bucket=default\r\ncouchbase.password=<\/pre>\n<p>Save the properties file and from the same location run:<\/p>\n<pre class=\" brush:bash\">jar -jar [path-to-jar]\/CouchbaseTwitterInjector.jar<\/pre>\n<p>This will inject Tweets into your Couchbase Server. Enjoy !<br \/>\n&nbsp;<\/p>\n<p><strong><em>Reference: <\/em><\/strong><a href=\"http:\/\/tugdualgrall.blogspot.com\/2012\/11\/couchbase-create-large-dataset-using.html\">Couchbase : Create a large dataset using Twitter and Java<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Tugdual Grall at the <a href=\"http:\/\/tugdualgrall.blogspot.com\/\">Tug&#8217;s Blog<\/a> blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An easy way to create large dataset when playing\/demonstrating Couchbase -or any other NoSQL engine- is to inject Twitter feed into your database. For this small application I am using: Couchbase Server 2.0 Server Couchbase Java SDK (will be installed by Maven) Twitter4J (will be installed by Maven) Twitter Streaming API called using Twitter4J In &hellip;<\/p>\n","protected":false},"author":211,"featured_media":98,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[584,384,304],"class_list":["post-2960","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-couchbase","tag-twitter","tag-twitter4j"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Couchbase : Create a large dataset using Twitter and Java<\/title>\n<meta name=\"description\" content=\"An easy way to create large dataset when playing\/demonstrating Couchbase -or any other NoSQL engine- is to inject Twitter feed into your database. For\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Couchbase : Create a large dataset using Twitter and Java\" \/>\n<meta property=\"og:description\" content=\"An easy way to create large dataset when playing\/demonstrating Couchbase -or any other NoSQL engine- is to inject Twitter feed into your database. For\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/tgrall\" \/>\n<meta property=\"article:published_time\" content=\"2012-11-07T08:00:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-11-07T09:06:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/couchbase-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tugdual Grall\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/tgrall\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tugdual Grall\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html\"},\"author\":{\"name\":\"Tugdual Grall\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/b52921fffd460d1dd6c706aab3408681\"},\"headline\":\"Couchbase : Create a large dataset using Twitter and Java\",\"datePublished\":\"2012-11-07T08:00:28+00:00\",\"dateModified\":\"2012-11-07T09:06:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html\"},\"wordCount\":552,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/couchbase-logo.jpg\",\"keywords\":[\"Couchbase\",\"Twitter\",\"Twitter4j\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html\",\"name\":\"Couchbase : Create a large dataset using Twitter and Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/couchbase-logo.jpg\",\"datePublished\":\"2012-11-07T08:00:28+00:00\",\"dateModified\":\"2012-11-07T09:06:54+00:00\",\"description\":\"An easy way to create large dataset when playing\\\/demonstrating Couchbase -or any other NoSQL engine- is to inject Twitter feed into your database. For\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/couchbase-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/couchbase-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/11\\\/couchbase-create-a-large-dataset-using-twitter-and-java.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Couchbase : Create a large dataset using Twitter and Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/b52921fffd460d1dd6c706aab3408681\",\"name\":\"Tugdual Grall\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/af1b68cee45f3bf495c2cd03b3a14abbb56b53dcad9ef92afc7d387842ef9d72?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/af1b68cee45f3bf495c2cd03b3a14abbb56b53dcad9ef92afc7d387842ef9d72?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/af1b68cee45f3bf495c2cd03b3a14abbb56b53dcad9ef92afc7d387842ef9d72?s=96&d=mm&r=g\",\"caption\":\"Tugdual Grall\"},\"description\":\"Tugdual Grall, an open source advocate and a passionate developer, is a Chief Technical Evangelist EMEA at MapR. He currently works with the European developer communities to ease MapR, Hadoop, and NoSQL adoption. Before joining MapR, Tug was Technical Evangelist at MongoDB and Couchbase. Tug has also worked as CTO at eXo Platform and JavaEE product manager, and software engineer at Oracle. Tugdual is Co-Founder of the Nantes JUG (Java User Group) that holds since 2008 monthly meeting about Java ecosystem. Tugdual also writes a blog available at http:\\\/\\\/tgrall.github.io\\\/\",\"sameAs\":[\"http:\\\/\\\/tgrall.github.io\\\/\",\"https:\\\/\\\/www.facebook.com\\\/tgrall\",\"http:\\\/\\\/www.linkedin.com\\\/in\\\/tugdualgrall\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/tgrall\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/tugdual-grall\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Couchbase : Create a large dataset using Twitter and Java","description":"An easy way to create large dataset when playing\/demonstrating Couchbase -or any other NoSQL engine- is to inject Twitter feed into your database. For","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html","og_locale":"en_US","og_type":"article","og_title":"Couchbase : Create a large dataset using Twitter and Java","og_description":"An easy way to create large dataset when playing\/demonstrating Couchbase -or any other NoSQL engine- is to inject Twitter feed into your database. For","og_url":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/www.facebook.com\/tgrall","article_published_time":"2012-11-07T08:00:28+00:00","article_modified_time":"2012-11-07T09:06:54+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/couchbase-logo.jpg","type":"image\/jpeg"}],"author":"Tugdual Grall","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/tgrall","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Tugdual Grall","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html"},"author":{"name":"Tugdual Grall","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/b52921fffd460d1dd6c706aab3408681"},"headline":"Couchbase : Create a large dataset using Twitter and Java","datePublished":"2012-11-07T08:00:28+00:00","dateModified":"2012-11-07T09:06:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html"},"wordCount":552,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/couchbase-logo.jpg","keywords":["Couchbase","Twitter","Twitter4j"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html","url":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html","name":"Couchbase : Create a large dataset using Twitter and Java","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/couchbase-logo.jpg","datePublished":"2012-11-07T08:00:28+00:00","dateModified":"2012-11-07T09:06:54+00:00","description":"An easy way to create large dataset when playing\/demonstrating Couchbase -or any other NoSQL engine- is to inject Twitter feed into your database. For","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/couchbase-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/couchbase-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/11\/couchbase-create-a-large-dataset-using-twitter-and-java.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Couchbase : Create a large dataset using Twitter and Java"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/b52921fffd460d1dd6c706aab3408681","name":"Tugdual Grall","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/af1b68cee45f3bf495c2cd03b3a14abbb56b53dcad9ef92afc7d387842ef9d72?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/af1b68cee45f3bf495c2cd03b3a14abbb56b53dcad9ef92afc7d387842ef9d72?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/af1b68cee45f3bf495c2cd03b3a14abbb56b53dcad9ef92afc7d387842ef9d72?s=96&d=mm&r=g","caption":"Tugdual Grall"},"description":"Tugdual Grall, an open source advocate and a passionate developer, is a Chief Technical Evangelist EMEA at MapR. He currently works with the European developer communities to ease MapR, Hadoop, and NoSQL adoption. Before joining MapR, Tug was Technical Evangelist at MongoDB and Couchbase. Tug has also worked as CTO at eXo Platform and JavaEE product manager, and software engineer at Oracle. Tugdual is Co-Founder of the Nantes JUG (Java User Group) that holds since 2008 monthly meeting about Java ecosystem. Tugdual also writes a blog available at http:\/\/tgrall.github.io\/","sameAs":["http:\/\/tgrall.github.io\/","https:\/\/www.facebook.com\/tgrall","http:\/\/www.linkedin.com\/in\/tugdualgrall","https:\/\/x.com\/http:\/\/twitter.com\/tgrall"],"url":"https:\/\/www.javacodegeeks.com\/author\/tugdual-grall"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/2960","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/211"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=2960"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/2960\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/98"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=2960"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=2960"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=2960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}