<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4983352056744928816</id><updated>2012-02-05T12:30:56.666-08:00</updated><category term='scalable database'/><category term='Aptana'/><category term='RDT'/><category term='hypertable'/><category term='apache solr'/><category term='jdbc'/><category term='JMX'/><category term='java'/><category term='Ruby'/><category term='jetty'/><category term='Eclipse'/><category term='search engine'/><category term='lucene'/><category term='ranking'/><category term='RadRails'/><title type='text'>Amit Nithian's Random Writings</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hokiesuns.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hokiesuns.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>ANithian</name><uri>http://www.blogger.com/profile/10849464759970164666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4983352056744928816.post-6704526802957958430</id><published>2011-09-26T21:49:00.000-07:00</published><updated>2011-09-27T21:08:42.021-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lucene'/><category scheme='http://www.blogger.com/atom/ns#' term='apache solr'/><category scheme='http://www.blogger.com/atom/ns#' term='JMX'/><category scheme='http://www.blogger.com/atom/ns#' term='ranking'/><title type='text'>Using JMX to modify the parameters of a running Solr instance</title><content type='html'>Apache's Solr is a great software package to build your company's search engine around because of it's active community, great contributions, and solid foundations with Lucene at its core. If you are new to this package, then check out my earlier post on setting up Solr with Eclipse &lt;a href="http://hokiesuns.blogspot.com/2010/01/setting-up-apache-solr-in-eclipse.html"&gt;http://hokiesuns.blogspot.com/2010/01/setting-up-apache-solr-in-eclipse.html&lt;/a&gt; .&lt;div&gt;&lt;br /&gt;&lt;div&gt;Normally, a company using Solr to power it's search engine will have a front end written in a web framework such as Ruby on Rails that makes calls to Solr through it's REST interface. One example is Zvents.com (my employer), where our front end is RoR that makes multiple calls to Solr to power various portions of the site. One common problem we encountered at Zvents was that a particular search would yield weird results and we'd execute the query passing the "&amp;amp;debugQuery=true" flag to study why that result appeared where it did. Afterwards; however, came the hard part.. tuning the ranking functions and refreshing the page to see if the results look better. There are two ways to do this:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Pass the modified set of ranking function parameters (bf, pf and/or qf) to Solr via the URL string&lt;/li&gt;&lt;li&gt;Modify solrconfig.xml and restart Solr to see what the results look like.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;While #1 is certainly better than #2, both have their problems for the following reasons:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Restarting Solr can be slow and is not scalable. Each change requires a restart and this may take several minutes &lt;i&gt;just&lt;/i&gt; to see the changes. Also it forces the person doing the tuning (say the search scientist/expert) to be able to understand the operational side (i.e. where Solr resides, how to restart it etc). This may be problematic for some people who are a averse to dealing with such operational details.&lt;/li&gt;&lt;li&gt;While passing the ranking function parameters via the URL works, it makes the URL significantly longer (which is a personal annoyance that most browsers have single line URL boxes) and this doesn't allow you to see the results of your change in the UI built by your front end team (without a special interface or requiring someone from that team to make changes to the UI code).&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;At Zvents, our initial solution to this involved building a special UI hosted within the Solr web application context, a JSP page + corresponding servlet with text boxes for each major ranking function parameter (qf, pf, bf) per handler. Our search experts would access this page and make the necessary changes which, upon submission of the form, would update the respective Solr handler's in-memory configuration map and thus the changes could be viewed in the UI built by our front end team. This was a great solution and certainly works; however, when Solr introduced JMX, it made more sense that such functionality live inside an MBean that exposed the ability to change these parameters using JConsole or any other UI with similar functionality.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size:29px;"&gt;Solr 2306- Modify default solrconfig parameters via JMX&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;When Solr added JMX support, it was a great way for administrators to be able to use a well known set of tools to understand what is going on inside of the JVM running Solr. Not only can you use JConsole to understand what the VM is doing but also what is going on inside of Solr.&lt;br /&gt;&lt;br /&gt;This patch extends the built-in JMX support to also allow the default parameters (exposed via the &amp;lt;lst name="defaults"&amp;gt;) to be exposed as modifiable attributes. When these parameters are modified, the changes are immediately noticed upon the issued search query &lt;i&gt;without&lt;/i&gt; requiring any core reloads. To use this patch, follow the steps below and post any questions/comments on this JIRA issue &lt;a href="https://issues.apache.org/jira/browse/SOLR-2306"&gt;https://issues.apache.org/jira/browse/SOLR-2306&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size:20px;font-weight:bold;"&gt;Step One: Checkout Solr, apply patch and build&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;svn co http://svn.apache.org/repos/asf/lucene/dev/trunk solr_trunk&lt;br /&gt;cd solr_trunk&lt;br /&gt;patch -p0 &amp;lt; &amp;lt;PATH_TO_PATH&amp;gt;&lt;patch_location&gt;/tuning_patch2.patch&lt;/patch_location&gt;&lt;/pre&gt;&lt;pre&gt;&lt;patch_location&gt;cd solr&lt;br /&gt;ant dist&lt;/patch_location&gt;&lt;/pre&gt;&lt;span style="font-size:20px;font-weight:bold;"&gt;Step Two: Setup and run example Solr instance&lt;/span&gt;&lt;pre&gt;cd example&lt;br /&gt;cp ../dist/apache-solr-4.0-SNAPSHOT.war webapps/solr.war&lt;br /&gt;java -jar start.jar&lt;/pre&gt;&lt;span style="font-size:20px;font-weight:bold;"&gt;Step Three: Load sample data&lt;/span&gt;&lt;pre&gt;cd exampledocs&lt;br /&gt;./post.sh *.xml&lt;/pre&gt;&lt;span style="font-size:20px;font-weight:bold;"&gt;Step Four: Launch jconsole!&lt;/span&gt;&lt;pre&gt;jconsole&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif; font-size: 16px; white-space: normal; "&gt;&lt;a href="http://3.bp.blogspot.com/-tAroihQvBwE/ToFnnjqpigI/AAAAAAAAAMg/n3uIeaxtRMQ/s1600/initial_jmx.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img src="http://3.bp.blogspot.com/-tAroihQvBwE/ToFnnjqpigI/AAAAAAAAAMg/n3uIeaxtRMQ/s400/initial_jmx.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5656916536240736770" style="cursor: pointer; width: 400px; height: 213px; " /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In JConsole, choose the "MBeans" tab and along the left side, expand "/solr", "browse/", "org.apache.solr.component.SearchHandler", "Attributes". From here, you can select an attribute and change it's value.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif; font-size: 16px; white-space: normal; "&gt;&lt;span style="font-size: 20px; font-weight: bold; "&gt;Step Five:  Modify parameters&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;For purposes of demoing the functionality of this patch, let's modify the "fl" parameter which describes the default set of field values to return. This can be overridden by passing &amp;amp;fl= on the URL; however, let's modify this parameter via JConsole to see it's effect. First though, let's look at some data by accessing &lt;b&gt;http://localhost:8983/solr/browse&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-ZRQmM09bmrk/ToIWkjpUHsI/AAAAAAAAAMo/VUGZFcsFn8w/s1600/initial_solr_browse.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 296px;" src="http://3.bp.blogspot.com/-ZRQmM09bmrk/ToIWkjpUHsI/AAAAAAAAAMo/VUGZFcsFn8w/s400/initial_solr_browse.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5657108899230392002" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Notice that there is at least a name, price, and in-stock fields displayed. Using JConsole (make sure you followed the previous step), select the "fl" attribute and change it's value to only show "score,name"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/-iK9sOilostE/ToKR7nWoXNI/AAAAAAAAAMw/f_QVuHAekYw/s1600/jmx_name_score.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img src="http://3.bp.blogspot.com/-iK9sOilostE/ToKR7nWoXNI/AAAAAAAAAMw/f_QVuHAekYw/s400/jmx_name_score.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5657244535292976338" style="cursor: pointer; width: 400px; height: 213px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;and refresh your web browser pointing at the browse handler.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/-JPbhg0B1y64/ToKSV-DJhxI/AAAAAAAAANA/k_LIXcGL_pM/s1600/name_solr_browse.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img src="http://1.bp.blogspot.com/-JPbhg0B1y64/ToKSV-DJhxI/AAAAAAAAANA/k_LIXcGL_pM/s400/name_solr_browse.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5657244988061878034" style="cursor: pointer; width: 400px; height: 296px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Notice that only the name is displayed along the top with the other fields that were initially present no longer there! Try this for other parameters and if you have JConsole pointing at your own search engine, try modifying the qf, pf, and bf parameters to see their effects. Of course keep in mind that to persist the parameter changes, make the appropriate changes in your solrconfig.xml file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 29px; "&gt;Conclusion&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Through a fairly simple, contrived demo using the examples provided in the standard Solr distribution, you were able to change some default handler parameters for a particular search handler and immediately see its effects. Solr's JMX extensions provide a great way to peek inside of a running Solr instance without any major performance impacts. This patch takes this one step further and allows for real-time tuning of a running Solr instance. If you like this patch, and have login credentials on Apache's JIRA, please vote this up to help ensure that it gets rolled into a future release of Solr!&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4983352056744928816-6704526802957958430?l=hokiesuns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hokiesuns.blogspot.com/feeds/6704526802957958430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hokiesuns.blogspot.com/2011/09/using-jmx-to-modify-parameters-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/6704526802957958430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/6704526802957958430'/><link rel='alternate' type='text/html' href='http://hokiesuns.blogspot.com/2011/09/using-jmx-to-modify-parameters-of.html' title='Using JMX to modify the parameters of a running Solr instance'/><author><name>ANithian</name><uri>http://www.blogger.com/profile/10849464759970164666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-tAroihQvBwE/ToFnnjqpigI/AAAAAAAAAMg/n3uIeaxtRMQ/s72-c/initial_jmx.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4983352056744928816.post-3970417462320033218</id><published>2011-07-10T20:34:00.000-07:00</published><updated>2011-07-10T21:25:22.276-07:00</updated><title type='text'>Using Hudson as a cron/workflow manager</title><content type='html'>Every organization has scheduled jobs, whether it be daily database backups or hourly execution of log processing. Managing and running scheduled jobs is always a pain and the de-facto standard for scheduling such jobs is cron/anacron because it's easy and available on any Unix/Linux system. I'm sure many of you are familiar with the problems of using cron (lack of any job-flow control, logging, failure reporting etc) and having dealt with such problems at Zvents where I am a lead search/analytics engineer, I installed Hudson specifically as a cron server to solve these problems. For months prior, I used Hudson as a build server and it worked very well; however, it never crossed my mind to use Hudson as a cron server until I talked to someone else about this problem. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;David Strauss wrote an interesting blog post (&lt;a href="http://fourkitchens.com/blog/2010/05/09/drop-cron-use-hudson-instead"&gt;http://fourkitchens.com/blog/2010/05/09/drop-cron-use-hudson-instead&lt;/a&gt;) that I stumbled across when looking for materials for this post and it sums up what I was going to say beautifully so I won't repeat the major points here; however, there are a few other advantages to using Hudson as a cron which segues into the second part of my title, "workflow manager".  To me, Hudson is a "framework" within which I can simply execute jobs and use the pre-built components necessary for things like archiving, notification on failure, concurrent execution etc. One feature that I don't think is talked about very much is the "workflow" like abilities you get by having jobs invoked when another job is complete. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a user of Hadoop for processing large quantities of data, the community has been abuzz with workflow management tools and this has been a topic at various Hadoop meetups I have attended. People have often asked who uses the various workflow tools (Oozie vs Azkaban vs Cascading etc)  and my somewhat abnormal suggestion has been to use Hudson to invoke scripts that wrap the invocation of Hadoop jobs. Hudson allows you to construct a simple workflow by invoking builds upon the completion of other builds. If you are looking for a non-transactional workflow manager to run your scheduled jobs, then consider using Hudson as it's battle tested and complete with features and a robust plugin architecture to develop your own add-ons in case one doesn't exist for your needs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;At Zvents, I have Hudson kick off an hourly log processing job for revenue recognition purposes which takes about 10-15 minutes to run. Upon completion, it kicks off a few other "builds" that operates on the results to produce some reports that aren't as critical should they take longer than an hour to complete. This allows the core revenue recognition jobs to always start and end within the hour and queue up the downstream jobs to complete when they do. While using Hudson as a workflow manager isn't as simple as say Azkaban, which uses configuration files to represent the dependencies between various jobs, it does the job fairly well for simple workflows. Also given that it's a build server, the integration with version control systems (SVN, GIT etc) makes it possible to be able to version important and have Hudson download from SVN the latest stuff before starting a build.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In short, Hudson is more than just a build system; it's a complete cron system with the abilities to setup simple workflows.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4983352056744928816-3970417462320033218?l=hokiesuns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hokiesuns.blogspot.com/feeds/3970417462320033218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hokiesuns.blogspot.com/2011/07/using-hudson-as-cronworkflow-manager.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/3970417462320033218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/3970417462320033218'/><link rel='alternate' type='text/html' href='http://hokiesuns.blogspot.com/2011/07/using-hudson-as-cronworkflow-manager.html' title='Using Hudson as a cron/workflow manager'/><author><name>ANithian</name><uri>http://www.blogger.com/profile/10849464759970164666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4983352056744928816.post-6205494617978667636</id><published>2010-08-29T00:10:00.001-07:00</published><updated>2010-08-29T01:04:48.710-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='hypertable'/><category scheme='http://www.blogger.com/atom/ns#' term='scalable database'/><category scheme='http://www.blogger.com/atom/ns#' term='jdbc'/><title type='text'>JDBC Connectivity to Hypertable!</title><content type='html'>Hypertable (&lt;a href="http://www.hypertable.org/"&gt;http://www.hypertable.org&lt;/a&gt;) is an implementation of the Google's BigTable which in short is a scalable, distributed sorted hashtable allowing for the storage of massive amounts of data across a cluster of commodity hardware. Hypertable has a rich query language (HQL) and a command line client akin to MySql's command line client; however, this can be limiting.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This article will cover two things:&lt;/div&gt;&lt;div&gt;1) JDBC Connectivity to Hypertable&lt;/div&gt;&lt;div&gt;2) Usage of this driver to graphically browse and modify a Hypertable instance&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;JDBC Driver&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Hypertable uses the Thrift protocol to remotely connect and query an instance. This is a very useful method of reading/writing data but it's not standard and can be difficult to develop applications using Hypertable. For Ruby developers, there is a package called HyperRecord which provides an ActiveRecord like interface to Hypertable which makes integrating Hypertable into a Ruby (on Rails) application much easier. For Java, I recently released a JDBC driver that communicates through Thrift to Hypertable which now allows you to integrate Hypertable into a Java application via JDBC. One such application is integration with a graphical browser which was the motivation behind writing this driver.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;b&gt;Driver Limitations:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-size:medium;"&gt;Only the latest timestamped version data is returned.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-size:medium;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-size:medium;"&gt;When retrieving metadata objects (ResultSet or Database), only the column families defined in the schema will be returned. In other words, column family qualifiers aren't going to be shown in the metadata objects although their value can be retrieved in code. &lt;b&gt;Example:&lt;/b&gt; In code, you can do rs.getString("address:home") and rs.getString("address:work") while the metadata will only show "address" as a valid column name with no value unless 'address' explicitly has a value in the given table.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;You can download the driver at &lt;a href="http://github.com/downloads/ANithian/hyperjdbc/hypertable-jdbc_0.1.tar"&gt;http://github.com/downloads/ANithian/hyperjdbc/hypertable-jdbc_0.1.tar&lt;/a&gt;. Simply add all the jars to your classpath and use the driver "org.hokiesuns.hypertable.jdbc.HTDriver". An example URL is "jdbc:hypertable://192.168.116.128:38080" with no username, password or schema. An example application can be found by executing org.hokiesuns.hypertable.HypertableJDBCTester passing in the ThriftBroker hostname/ip as the command line argument.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style=" ;font-size:x-large;"&gt;Graphical Browser&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;The motivation behind writing this driver was to be able to view data in Hypertable using a graphical browser instead of the command line. There are numerous java based graphical browsers and the one that I tested with was SQLWorkBench/J (&lt;/span&gt;&lt;a href="http://www.sql-workbench.net/"&gt;http://www.sql-workbench.net/&lt;/a&gt;). Rather than providing screenshots with explanations, I have created a video that should help show this driver in action and how easy it is to start talking to Hypertable using a third party graphical interface!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/asQZ2l0KMLw?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/asQZ2l0KMLw?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;Conclusion&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Along with integration for graphical browsing of Hypertable data, I believe that releasing a JDBC driver to Hypertable will help make its use more widespread and make it easier to plug this great technology into the vast Java application landscape. If you see any bugs, please file a bug report along with all the necessary information at &lt;/span&gt;&lt;a href="http://github.com/anithian/hyperjdbc/issues"&gt;http://github.com/anithian/hyperjdbc/issues&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4983352056744928816-6205494617978667636?l=hokiesuns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hokiesuns.blogspot.com/feeds/6205494617978667636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hokiesuns.blogspot.com/2010/08/jdbc-connectivity-to-hypertable.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/6205494617978667636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/6205494617978667636'/><link rel='alternate' type='text/html' href='http://hokiesuns.blogspot.com/2010/08/jdbc-connectivity-to-hypertable.html' title='JDBC Connectivity to Hypertable!'/><author><name>ANithian</name><uri>http://www.blogger.com/profile/10849464759970164666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4983352056744928816.post-4615120529812279609</id><published>2010-01-02T20:25:00.000-08:00</published><updated>2010-01-02T23:13:10.026-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jetty'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='apache solr'/><category scheme='http://www.blogger.com/atom/ns#' term='search engine'/><title type='text'>Setting up Apache Solr in Eclipse</title><content type='html'>Apache's Solr is a powerful software package that allows you to develop your own search engine in no time. It's purely written in Java using Lucene at its core and can run inside any servlet container such as Tomcat (or Jetty). Eclipse is an IDE that makes developing Java applications incredibly easy because of its wealth of features such as code completion and refactoring capabilities not to mention the number of free plugins available to further make development easier. I find it much easier to keep everything contained in one place and being able to code, debug, and test inside of Eclipse makes developing my search engine much easier. This simple tutorial will show you how to setup Apache Solr to run inside Eclipse using a free third-party  plugin that runs Jetty inside Eclipse.&lt;br /&gt;&lt;br /&gt;You will need:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Eclipse (&lt;a href="http://www.eclipse.org/"&gt;http://www.eclipse.org&lt;/a&gt;). I am using Eclipse 3.4 but this should also work just fine in Eclipse 3.5.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;RunJettyRun plugin (&lt;a href="http://code.google.com/p/run-jetty-run/wiki/GettingStarted"&gt;http://code.google.com/p/run-jetty-run/wiki/GettingStarted&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;&lt;a href="http://lucene.apache.org/solr/"&gt;Apache Solr&lt;/a&gt; (Any version should suffice. I am using 1.4.)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:180%;"&gt;Step One: Basic Setup&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Download and extract both Eclipse and Apache Solr tar files somewhere on your disk. Since Solr has some XML configuration files, I would also suggest installing the Eclipse WTP (Web Toolkit Platform) that gives you some good built-in XML editors.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__62NiuX6RR0/S0AlJa3ruNI/AAAAAAAAAFw/NjX7e9B2f4U/s1600-h/Image1.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 294px;" src="http://3.bp.blogspot.com/__62NiuX6RR0/S0AlJa3ruNI/AAAAAAAAAFw/NjX7e9B2f4U/s320/Image1.jpg" alt="" id="BLOGGER_PHOTO_ID_5422374795116001490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Follow the Getting Started guide in the RunJettyRun wiki to install the plugin. It should be pretty fast and easy.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Step Two: Create your Java project&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create a standard Java project in Eclipse (File..New..Java Project). Call it what you wish (I called it "TestSolr"). The default options should be fine and click through the wizard to see all the options or click Finish at your first chance to get done faster.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__62NiuX6RR0/S0Ar2Z-mHmI/AAAAAAAAAF4/6p8FnLRu6Yg/s1600-h/Image1.jpg"&gt;&lt;img style="cursor: pointer; width: 251px; height: 320px;" src="http://2.bp.blogspot.com/__62NiuX6RR0/S0Ar2Z-mHmI/AAAAAAAAAF4/6p8FnLRu6Yg/s320/Image1.jpg" alt="" id="BLOGGER_PHOTO_ID_5422382165040438882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here you should see your TestProject in your workspace with a blank src folder.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Step Three: Setup the Solr webapp in your Eclipse project.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is where the RunJettyRun plugin installed earlier gets used. This plugin allows you to develop, run and debug web applications inside Eclipse allowing you to take advantage of Eclipse's powerful code editing and debugging capabilities. It's also one of the simpler web application development plugins available. Eclipse supports full blown web development but for the purposes of this tutorial and developing needs, this plugin is more than enough.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Inside the TestSolr directory, create a folder called "webapp". Do this by right clicking on the "TestSolr" in the workspace, select "New" and then "Folder".&lt;/li&gt;&lt;li&gt;At a command prompt, unjar the apache-solr-1.4.0.war in this webapp folder.  In Windows, this would be done by the following command:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;jar -xvf c:\applications\apache-solr-1.4.0\dist\apache-solr-1.4.0.war&lt;/span&gt;&lt;br /&gt;The contents of the war file should be in the webapp folder. To confirm, right click on the "TestSolr" folder in the Eclipse workspace and select "Refresh." &lt;/li&gt;&lt;li&gt;Add all the jar files in the webapp/WEB-INF/lib to the Build Path. This is done by selecting all the jars and right click on any of the jars (while all are selected), select the "Build Path" sub-menu and select "Add to Build Path"&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/__62NiuX6RR0/S0AzRF-ekLI/AAAAAAAAAGA/Fta7xVf0TAA/s1600-h/Image1.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 305px;" src="http://1.bp.blogspot.com/__62NiuX6RR0/S0AzRF-ekLI/AAAAAAAAAGA/Fta7xVf0TAA/s320/Image1.jpg" alt="" id="BLOGGER_PHOTO_ID_5422390320109097138" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Setup a solr home folder inside your project. For purposes of this tutorial, copy the "solr" folder from the "example/" folder in the directory containing solr into the "TestSolr" folder in your Eclipse workspace. By now, your "TestSolr" project layout should look something like this.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__62NiuX6RR0/S0A2GfG6PjI/AAAAAAAAAGI/SNcFvXygCmI/s1600-h/Image1.jpg"&gt;&lt;img style="cursor: pointer; width: 148px; height: 320px;" src="http://2.bp.blogspot.com/__62NiuX6RR0/S0A2GfG6PjI/AAAAAAAAAGI/SNcFvXygCmI/s320/Image1.jpg" alt="" id="BLOGGER_PHOTO_ID_5422393436411674162" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:180%;"&gt;Step Four: Let's run this thing!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now that you have setup your project,  it's time to create a run configuration for Jetty and run this!&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In Eclipse, go to the Run menu and select "Run Configurations...".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;On the left rail, you should see "Jetty Webapp" as one of the run configuration types. Right click on this and select "New". The project should be "TestSolr" (if not, type in TestSolr in the text box labeled with "Project"). The name of the run configuration is populated with "TestSolr" and can be whatever you wish.&lt;/li&gt;&lt;li&gt;The default HTTP port is 8080 and can be left alone if you wish. To conform to Solr tutorials (making copying/pasting links easier, change this to 8983). &lt;span style="font-weight: bold;"&gt;Delete&lt;/span&gt; the HTTPs port 8443 since we aren't doing any SSL access. This will disable the SSL specific fields such as the keystore/password fields.&lt;/li&gt;&lt;li&gt;Change the "context" to "/solr" from "/". This is more for conformity with the solr tutorials in that all links in the wiki you to something like http://localhost:8983/solr/.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Type in "webapp" in the "WebApp dir" text box. This is the root of the web application and is the directory above the WEB-INF folder. This is where the solr war file was extracted and hence is the equivalent of deploying the solr war in your servlet container.&lt;/li&gt;&lt;/ul&gt;Your launch configuration should look like the following:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__62NiuX6RR0/S0BAdecHSNI/AAAAAAAAAGg/znjUQYZV950/s1600-h/Image1.jpg"&gt;&lt;img style="cursor: pointer; width: 400px; height: 320px;" src="http://3.bp.blogspot.com/__62NiuX6RR0/S0BAdecHSNI/AAAAAAAAAGg/znjUQYZV950/s400/Image1.jpg" alt="" id="BLOGGER_PHOTO_ID_5422404826485442770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now click the "Run" button which will save the changes and the console will hopefully start spewing out logs produced by both Jetty and Solr. Open a browser to &lt;a href="http://localhost:8080/solr/admin/"&gt;http://localhost:8080/solr/admin/&lt;/a&gt; and voila! you should see the Solr admin page. In scrolling through the console, you shouldn't see any exceptions thrown.&lt;br /&gt;&lt;br /&gt;This simple tutorial just shows the basics of setting up a simple solr installation inside Eclipse using Jetty and running inside Eclipse. Notice that we don't have any of our own code running that may do some extra things (say custom analyisis, tokenizing etc). If we did have such code, then it would naturally lie in the "src/" folder; however, we need to instruct Eclipse to compile the code so that it goes in the WEB-INF/classes folder so it will run inside Jetty. To do this:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Right click on the TestSolr project and select "Properties".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Click on the "Java Build Path" on the left rail&lt;/li&gt;&lt;li&gt;Click on the "Source" tab and towards the bottom, change the default output folder to be "TestSolr/webapp/WEB-INF/classes".&lt;/li&gt;&lt;/ul&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__62NiuX6RR0/S0A7jxEYmPI/AAAAAAAAAGY/1bGmMVmPDYg/s1600-h/Image1.jpg"&gt;&lt;img style="cursor: pointer; width: 400px; height: 319px;" src="http://2.bp.blogspot.com/__62NiuX6RR0/S0A7jxEYmPI/AAAAAAAAAGY/1bGmMVmPDYg/s400/Image1.jpg" alt="" id="BLOGGER_PHOTO_ID_5422399437007263986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now you can develop your custom solr plugins directly in Eclipse and debug them immediately. Instead of running the TestSolr jetty instance, you can launch it in debug mode by going to the Run Menu and opening the "Debug Configurations.." sub-menu, selecting the Jetty configuration created earlier and click the "Debug" button. I would encourage familiarizing yourself with Eclipse's debugging capabilities for they are vast and amazing.&lt;br /&gt;&lt;br /&gt;If you have any questions or comments, please post them and I'll do my best to answer them as quickly as possible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4983352056744928816-4615120529812279609?l=hokiesuns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hokiesuns.blogspot.com/feeds/4615120529812279609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hokiesuns.blogspot.com/2010/01/setting-up-apache-solr-in-eclipse.html#comment-form' title='25 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/4615120529812279609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/4615120529812279609'/><link rel='alternate' type='text/html' href='http://hokiesuns.blogspot.com/2010/01/setting-up-apache-solr-in-eclipse.html' title='Setting up Apache Solr in Eclipse'/><author><name>ANithian</name><uri>http://www.blogger.com/profile/10849464759970164666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/__62NiuX6RR0/S0AlJa3ruNI/AAAAAAAAAFw/NjX7e9B2f4U/s72-c/Image1.jpg' height='72' width='72'/><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4983352056744928816.post-4842581169845729976</id><published>2009-10-24T01:21:00.000-07:00</published><updated>2009-10-24T01:34:52.697-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RadRails'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Aptana'/><category scheme='http://www.blogger.com/atom/ns#' term='RDT'/><title type='text'>Thinning down Aptana's RadRails to use with Eclipse</title><content type='html'>I believe that Eclipse is the best damn IDE ever developed. The modular design (OSGI) coupled with its open plugin development environment and reasonable publication coverage makes it an ideal development environment. Companies have built development solutions on Eclipse technology and one such company is Aptana, the developer of RadRails, the development solution for web developers/Ruby on Rails developers.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A while ago, there was an Eclipse plugin called RDT (Ruby Development Toolkit) that provided "simple" Ruby support (a nice editor, some code completion etc.). Development of this plugin was discontinued and instead rolled into Aptana's large RadRails suite since RDT's developer was hired by Aptana. This obviously was great news for him but sad for me because I didn't want the heavy RadRails environment with its hundreds of plugin jars doing everything from HTML to Cloud Computing deployment. Given Eclipse's pluggable nature, I figured that I should be able to take a RadRails install and only extract the portions I wanted to give me my basic RDT back except now it's the latest and greatest.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Below is a directory listing showing the directories and jars to extract from the RadRails install to make your eclipse have Ruby development capabilities. I found this through trial and error and they seem to work just fine but if you find errors, post comments for others to see.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;./eclipse/features&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/features/org.rubypeople.rdt_1.4.0.1254334821-7H7X7c7jrMElGv94Q&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/com.aptana.rdt.libraries.win32_1.0.1.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/com.aptana.rdt.libraries_1.0.7.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/com.aptana.rdt.rake_1.3.2.1254241359.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/com.aptana.rdt.ui_1.3.2.1254332735.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/com.aptana.rdt_1.3.1.1254334821.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.epic.regexp_rdt_0.1.6.1252597203.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.jruby_1.2.0.9419p2&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.kxml2_2.1.5.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.rubypeople.rdt.branding_1.3.0.1254241359.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.rubypeople.rdt.core_1.3.2.1254332672.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.rubypeople.rdt.debug.core_1.3.2.1254241359.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.rubypeople.rdt.debug.ui_1.3.2.1254334821.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.rubypeople.rdt.launching_1.3.0.1254241359.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.rubypeople.rdt.refactoring_1.2.2.1252686004.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.rubypeople.rdt.testunit_1.2.4.1254241359.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;./eclipse/plugins/org.rubypeople.rdt.ui_1.2.4.1254254467.jar&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I highly recommend creating a separate extension location to store these plugins so future upgrades become easier since you know the features and plugins in this extension location are solely dedicated to RDT. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am not a serious web developer requiring me to install the full Aptana suite, which significantly slowed down my other development in Eclipse, so this little trick has worked well for me. Now I have my RDT back without all the unnecessary plugins!&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4983352056744928816-4842581169845729976?l=hokiesuns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hokiesuns.blogspot.com/feeds/4842581169845729976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hokiesuns.blogspot.com/2009/10/thinning-down-aptanas-radrails-to-use.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/4842581169845729976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/4842581169845729976'/><link rel='alternate' type='text/html' href='http://hokiesuns.blogspot.com/2009/10/thinning-down-aptanas-radrails-to-use.html' title='Thinning down Aptana&apos;s RadRails to use with Eclipse'/><author><name>ANithian</name><uri>http://www.blogger.com/profile/10849464759970164666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4983352056744928816.post-8456760049687624517</id><published>2009-08-05T20:41:00.000-07:00</published><updated>2009-08-05T21:06:04.003-07:00</updated><title type='text'>JRuby + Merb + Google AppEngine MemCache</title><content type='html'>Searching far and wide for a cheap Java based web hosting provider, I became interested in learning about Google's AppEngine, which offers free space for web applications within reasonable access limits. I also thought that this would be a good opportunity to learn some Ruby (JRuby) to write a web application. In short, this post is about how to configure MERB running on JRuby/Google AppEngine to use Google's MemCache store to store session data via memcache instead of cookies.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I wanted to do this because I didn't want my web application data stored in a browser's cookie and so either I could use MemCache or the DataStore and I chose memcache. I assume that you have an AppEngine project setup with MERB as your web framework of choice.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All the changes described are located in &lt;your_project&gt;/war/WEB-INF/config/init.rb&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Load the APIs (place these near the top of init.rb)&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;# Load the apis&lt;br /&gt;ENV['APPLICATION_ROOT'] = File.join(File.dirname(__FILE__), '..')&lt;br /&gt;require 'appengine-apis/local_boot'&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Change the session store from cookie to memcache&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;c[:session_store] = 'memcache'&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Add the following to the &lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Merb::BootLoader.after_app_loads&lt;/span&gt; section&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; # This will get executed after your app's classes have been loaded.&lt;br /&gt;Merb::MemcacheSession.store = AppEngine::Memcache.new&lt;br /&gt;module AppEngine&lt;br /&gt;   # For the memcache-client gem.&lt;br /&gt;   class Memcache&lt;br /&gt;       include Merb::MemcacheStore&lt;br /&gt;   end&lt;br /&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;The first two and a good portion of the third step are standard Merb as far as I understand (although it took me some digging through the Merb code to find this). The second part of the third step is what I discovered when looking at the source code to see how the standard Memcache gem is integrated into the memcache store. Once I added this mixin AppEngine module, I had session data stored in memcache! Post comments if this works or doesn't work for you and/or if you have any other suggestions, please post so that others can find it!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4983352056744928816-8456760049687624517?l=hokiesuns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hokiesuns.blogspot.com/feeds/8456760049687624517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hokiesuns.blogspot.com/2009/08/jruby-merb-google-appengine-memcache.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/8456760049687624517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4983352056744928816/posts/default/8456760049687624517'/><link rel='alternate' type='text/html' href='http://hokiesuns.blogspot.com/2009/08/jruby-merb-google-appengine-memcache.html' title='JRuby + Merb + Google AppEngine MemCache'/><author><name>ANithian</name><uri>http://www.blogger.com/profile/10849464759970164666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
