<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>java rants &#187; yql</title> <atom:link href="http://www.javarants.com/tag/yql/feed/" rel="self" type="application/rss+xml" /><link>http://www.javarants.com</link> <description>Rants about Java and other internet technologies by Sam Pullara</description> <lastBuildDate>Sun, 09 Oct 2011 23:29:31 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>Making Open Data Tables even easier: YQL Storage Editor</title><link>http://www.javarants.com/2010/04/12/making-open-data-tables-even-easier-yql-storage-editor/</link> <comments>http://www.javarants.com/2010/04/12/making-open-data-tables-even-easier-yql-storage-editor/#comments</comments> <pubDate>Tue, 13 Apr 2010 01:00:22 +0000</pubDate> <dc:creator>Sam Pullara</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[yql]]></category> <guid
isPermaLink="false">http://www.javarants.com/?p=1274</guid> <description><![CDATA[One of the big benefits of YQL is that you can make your own Open Data Tables and use them. However, one of the disadvantages is that you either have to host your tables on a publicly available URL or &#8230; <a
href="http://www.javarants.com/2010/04/12/making-open-data-tables-even-easier-yql-storage-editor/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>One of the big benefits of <a
href="http://developer.yahoo.com/yql/">YQL</a> is that you can make your own <a
href="http://www.datatables.org">Open Data Tables</a> and use them. However, one of the disadvantages is that you either have to host your tables on a publicly available URL or you have to painstakingly use the yql.storage table to manage your environments and table definitions.  There has been an open feature request for the <a
href="http://developer.yahoo.com/yql/console/">YQL console</a> for a while now to integrate the ability to edit <a
href="http://developer.yahoo.com/yql/console/?_uiFocus=yql">yql.storage</a> content but it isn&#8217;t the highest priority thing for the team right now.  Since I am using YQL more and more lately I decided to build it myself, leveraging <a
href="https://bespin.mozillalabs.com/">Bespin</a>, Mozilla&#8217;s web based editor.<br
/> <span
id="more-1274"></span></p><p>Another project that was done in someone&#8217;s free time is <a
href="http://zachgrav.es/yql/tablesaw/">Zach Grave&#8217;s TableSaw</a> that helps you generate tables from URLs.  I am going to combine these two things in this post to show you how to make a new table and an environment to more easily use it.  Ultimately I could see TableSaw and the <a
href="http://www.javarants.com/yqlstorageeditor/">YQL Storage Editor</a> combined, to that end, I&#8217;ve released the source for this blog post on <a
href="http://github.com/spullara/YQL-Storage-Editor">github</a>.</p><p>I&#8217;m going to use a real example that I just recently walked through, creating an open data table for the bit.ly API. The table will be pretty simple, just allowing you to pass in a bit.ly link and it will return the long URL for that link.  First thing to do is to go to the <a
href="http://code.google.com/p/bitly-api/wiki/ApiDocumentation#/expand">bit.ly API documentation for the expand REST API</a>.  That gives us a nice example URL that we can use in Table Saw to generate a table:</p><p><code>http://api.bit.ly/expand?version=2.0.1&#038;shortUrl=http://bit.ly/31IqMl&#038;login=bitlyapidemo&#038;apiKey=R_0da49e0a9118ff35f52f629d2d71bf07</code></p><p>If you head over to  Table Saw and put that in the text field and load URL you get:</p><div
id="attachment_1284" class="wp-caption alignnone" style="width: 615px"><a
href="http://www.javarants.com/wp-content/uploads/2010/03/Screen-shot-2010-03-21-at-1.17.13-PM2.png"><img
class="size-full wp-image-1284 " title="Table Saw" src="http://www.javarants.com/wp-content/uploads/2010/03/Screen-shot-2010-03-21-at-1.17.13-PM2.png" alt="" width="605" height="819" /></a><p
class="wp-caption-text">Initial generated table for api.bit.ly/expand</p></div><p>To complete the form and update, fill in an author name and the Produces should be JSON.  One current bug with Table Saw is that it doesn&#8217;t seem to properly remember the Produces field so we will have to edit that after we grab the definition.  Highlight everything under &#8220;Your new YQL Table!&#8221; and copy it into the clipboard and then go to the YQL Storage Editor.  On that page you will see a set of execute/select/update text fields for the various urls that you need to use a yql.storage entry.  Everything is empty right now and we want to create a new one, so click the New button. That should fill in those URL fields with brand new store:// URLs.  Put focus on the Bespin editor component and paste in the table we copied.  If you then click save it should say that it updated the entry in YQL with this new information.  You&#8217;ll notice that there is a text area with the URLs listed out, if you want to keep track of yql.storage entries you need to keep these special identifiers around so you can perform the various operations on the content. I generally have a list that I keep locally of the entries that I am using.  If you paste the list into the file as a comment you can then also just remember the &#8216;select&#8217; URL in order to come back later and find the other two.  Lastly, when the execute key is changed, the two links on the right get updated. The first link goes to the YQL console with your execute key used as an environment and the second link goes to the YQL console with your execute key used as a table definition. These two links can help you quickly try out changes that you make to your environment or table without a lot of cutting and pasting.</p><p>Table Saw isn&#8217;t yet perfect, so I make a few edits: change the produces from XML to JSON, add a description, reformat the sample query, set the default version to 2.0.1 and make all the other keys required, this should leave you with a page that looks like:</p><div
id="attachment_1280" class="wp-caption alignnone" style="width: 680px"><a
href="http://www.javarants.com/wp-content/uploads/2010/03/Screen-shot-2010-03-21-at-1.31.14-PM1.png"><img
class="size-full wp-image-1280 " title="YQL Storage Editor" src="http://www.javarants.com/wp-content/uploads/2010/03/Screen-shot-2010-03-21-at-1.31.14-PM1.png" alt="" width="670" height="670" /></a><p
class="wp-caption-text">Edited version of the bit.ly table</p></div><p>When you click save it should alert you that it was saved successfully by saying that it was updated.  You can now test this table in the YQL console with the following query:</p><p><code>use 'store://8tLqFvgCm8kdOAp60lPz24' as bit.ly; select * from bit.ly where version='2.0.1' and shortUrl='http://bit.ly/31IqMl' and login='bitlyapidemo' and apiKey='R_0da49e0a9118ff35f52f629d2d71bf07'</code></p><p>I noticed at this point that I forgot the itemPath and then set it to &#8220;json.results&#8221; in order to cut out the error messages and some other things that I wasn&#8217;t interested in.  Nagesh Susarla had a great blog post on using YQL storage for secrets.  We&#8217;ll also do that by using the YQL storage editor to create a new environment for us to use that could store our secret values that bit.ly needs in order to run the API. Create another YQL Storage Editor tab, click New and then we can make an environment that uses the table, sets the login and sets the API key:</p><div
id="attachment_1279" class="wp-caption alignnone" style="width: 527px"><a
href="http://www.javarants.com/wp-content/uploads/2010/03/Screen-shot-2010-03-21-at-1.41.26-PM.png"><img
class="size-full wp-image-1279" title="bit.ly environment" src="http://www.javarants.com/wp-content/uploads/2010/03/Screen-shot-2010-03-21-at-1.41.26-PM.png" alt="The bit.ly default environment with their internal API keys" width="517" height="227" /></a><p
class="wp-caption-text">Secret bit.ly environment with their API keys</p></div><p>Now using that execute URL as your env value in your query URLs you can have very simple queries against this API.  For example, if you use this <a
href="http://developer.yahoo.com/yql/console/?env=store://TZ0z8H3V1vSOQGE2pLxDzm&#038;_uiFocus=bit">URL for the YQL Console</a> you can use this much simpler query that gets all its authentication implicitly:</p><p><code>select * from bit.ly where shortUrl='http://bit.ly/31IqMl'</code></p><p>This allows you to not embed those valuable keys directly in your client software or even in your source control system but hidden behind what amounts to a very secure random password.</p> ]]></content:encoded> <wfw:commentRss>http://www.javarants.com/2010/04/12/making-open-data-tables-even-easier-yql-storage-editor/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Drastically reducing GC pause times for YQL</title><link>http://www.javarants.com/2009/11/03/drastically-reducing-gc-pause-times-for-yql/</link> <comments>http://www.javarants.com/2009/11/03/drastically-reducing-gc-pause-times-for-yql/#comments</comments> <pubDate>Tue, 03 Nov 2009 23:31:36 +0000</pubDate> <dc:creator>Sam Pullara</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[yql]]></category> <guid
isPermaLink="false">http://www.javarants.com/?p=1241</guid> <description><![CDATA[Update 2: JRockit Real Time 3.1.2 using -XgcPrio:deterministic performed even better than this configuration in testing though it is not yet an approved VM at Yahoo! we will continue to test with it. Update: One issue we still have is &#8230; <a
href="http://www.javarants.com/2009/11/03/drastically-reducing-gc-pause-times-for-yql/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><strong>Update 2: <a
href="http://www.oracle.com/technology/software/products/jrockit/index.html">JRockit Real Time 3.1.2</a></strong><strong> using <code>-XgcPrio:deterministic</code> performed even better than this configuration in testing though it is not yet an approved VM at Yahoo! we will continue to test with it.</strong></p><p><strong>Update: One issue we still have is that after many hours of deployment with this configuration the heap fragments and we start to get concurrent mode failures.  We only saw this though during periods of peak activity.</strong></p><p>We were struggling with some long pause times due to GC for YQL that we couldn&#8217;t stomach for our internal property SLAs.  The secret turned out to be a collection of parameters for the Java 6 garbage collector:</p><pre>-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode \
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+CMSIncrementalPacing</pre><p>I have so far been blown away by the results of this combination of parameters.  Not only does it work very efficiently under moderate load, under crushing load it rises the occasion and aggressively keeps down the heap in such a way as to never cause the:</p><pre>Concurrent Mode Failure
The concurrent collector uses one or more garbage collector threads that run simultaneously with the
application threads with the goal of completing the collection of the tenured and permanent generations
before either becomes full. As described above, in normal operation, the concurrent collector does most
of its tracing and sweeping work with the application threads still running, so only brief pauses are seen
by the application threads. However, if the concurrent collector is unable to finish reclaiming the
unreachable objects before the tenured generation fills up, or if an allocation cannot be satisfied with
the available free space blocks in the tenured generation, then the application is paused and the
collection is completed with all the application threads stopped. The inability to complete a collection
concurrently is referred to as concurrent mode failure and indicates the need to adjust the concurrent
collector parameters.</pre><p>If you have any other GC secrets for the JVM, leave them here.  Just as a heads up I compared it with all the other GC&#8217;s available for Java 6 including the experimental G1 and none of them were as effective.</p> ]]></content:encoded> <wfw:commentRss>http://www.javarants.com/2009/11/03/drastically-reducing-gc-pause-times-for-yql/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>YQL opens up 3rd-party web service table definitions to developers</title><link>http://www.javarants.com/2009/02/05/yql-opens-up-3rd-party-web-service-table-definitions-to-developers/</link> <comments>http://www.javarants.com/2009/02/05/yql-opens-up-3rd-party-web-service-table-definitions-to-developers/#comments</comments> <pubDate>Thu, 05 Feb 2009 20:55:51 +0000</pubDate> <dc:creator>Sam Pullara</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[yahoo]]></category> <category><![CDATA[yql]]></category> <guid
isPermaLink="false">http://www.javarants.com/?p=1153</guid> <description><![CDATA[The Yahoo! Query Language aspires to be the last web service API that the normal developer will ever have to learn. By default we implement 50+ tables that grab data both from Yahoo! web services, some 3rd party web services &#8230; <a
href="http://www.javarants.com/2009/02/05/yql-opens-up-3rd-party-web-service-table-definitions-to-developers/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>The <a
href="http://developer.yahoo.com/yql/">Yahoo! Query Language</a> aspires to be the last web service API that the normal developer will ever have to learn.  By default we implement 50+ tables that grab data both from Yahoo! web services, some 3rd party web services and then the web at large using our dynamic tables that allow you specify a data type and a url.  However, those dynamic APIs limit the YQL user to a very flexible but ultimately hard to work with API without the benefit of the structure found in the other tables that we offer.</p><p>Today <a
href="http://www.yqlblog.net/blog/2009/02/05/open-data-tables-added-to-yql/">YQL introduced</a> a new feature that allows 3rd parties to define new tables and then share those table definitions with whomever they like for them to use.  For example, let&#8217;s say you are the New York Times or you are a developer that likes the New York Times APIs and would like to make them more accessible to someone using YQL.  Yesterday, they released the article search API, so I will use that one among others as an example, to get an api-key to execute these examples go to their <a
href="http://developer.nytimes.com">developer site</a>.  This is a pretty sophisticated API that allows you to search using a variety of parameters.  If you were to use YQL without modification, you would simply use the dynamic JSON endpoint to parse out the results from their service.  The big issue with this though is that you would be unable to easily construct the URLs required and would have to write that code that collected all the parameters and created the URL.  If you had a YQL table, those parameters would be defined and how they are expressed in the URL codified and you would be able to individually address the keys.<br
/> <span
id="more-1153"></span><br
/> So without this ability you would use something like this:</p><p><code>select * from json where url='http://api.nytimes.com/svc/search/v1/article?api-key=...<br
/> &amp;query=yahoo&amp;begin_date=19990112&amp;end_date=19993112' and<br
/> itemPath='json.results'</code></p><p>If we instead defined the API using the <a
href="http://developer.yahoo.com/yql/guide/yql-opentables-chapter.html">YQL open data tables specification</a> you would be able to do this (by the way, don&#8217;t read the headlines, you&#8217;ll just be depressed):</p><p><code>use 'http://www.javarants.com/nyt/nyt.article.search.xml' as articles;<br
/> select * from articles where apikey='...' and query='yahoo' and begin_date='19990112' and<br
/> end_date='19993112'</code></p><p>Why is this superior?  For a number of reasons.  In the second case not only does it make it easier for anyone to use it, it also brings those keys from the query into columns which allows you to do joins that you cannot do with the first abstraction.  Here is an example join:</p><p><code>select * from bs where apikey='...' and query in ('yahoo', 'google', 'microsoft') and begin_date='19990112' and end_date='20000101'</code></p><p>This will actually do 3 searches for you in parallel and then return the combined result.  By creating a YQL open table we can really off-load processing that you would normally do on your client or server to the YQL engine.  You&#8217;ll note with that query that the user-time spent is actually about half or less than the actual service-time thus drastically decreasing the latency through asynchronous processing.</p><p>One of the really nice APIs out there is <a
href="http://friendfeed.com/api/">FriendFeed&#8217;s API</a>.  It really is very well designed and easily works with straight-forward table definitions.  Here is an example of how to get the public feed:</p><p><code>use 'http://www.javarants.com/friendfeed/friendfeed.feeds.xml' as ff;<br
/> select * from ff</code><a
href="http://developer.yahoo.com/yql/console/?q=use%20'http%3A%2F%2Fwww.javarants.com%2Ffriendfeed%2Ffriendfeed.feeds.xml'%20as%20ff%3B%0Aselect%20*%20from%20ff"><small>console</small></a></p><p>By defining different endpoints with the same table definition we will automatically select the correct API based on the keys included in the query.  Using that same table we can also get my public entries from twitter:</p><p><code>select * from ff where nickname='spullara' and service='twitter'</code><a
href="http://developer.yahoo.com/yql/console/?q=use%20'http%3A%2F%2Fwww.javarants.com%2Ffriendfeed%2Ffriendfeed.feeds.xml'%20as%20ff%3B%0Aselect%20*%20from%20ff%20where%20nickname%3D'spullara'%20and%20service%3D'twitter'"><small>console</small></a></p><p>This won&#8217;t include my private entries though.  However, if you had my remotekey you could generate and pass YQL the authorization header required and it would pass it on to authenticate the API call.  Another popular example that has been on the forums is the ability to use <a
href="http://weather.com">weather.com</a>&#8216;s API to tease out international locations.  That is actually really easy and you can even use that data to join with their weather forecasts.  Here is an example where we pull the weather for all the Moscow&#8217;s of the world:</p><p><code>use 'http://www.javarants.com/weather/weather.search.xml' as ws;use 'http://www.javarants.com/weather/weather.local.xml' as wl;<br
/> select * from wl where location in (select id from ws where query='moscow')</code><a
href="http://developer.yahoo.com/yql/console/?q=use%20'http%3A%2F%2Fwww.javarants.com%2Fweather%2Fweather.search.xml'%20as%20ws%3Buse%20'http%3A%2F%2Fwww.javarants.com%2Fweather%2Fweather.local.xml'%20as%20wl%3B%0Aselect%20*%20from%20wl%20where%20location%20in%20(select%20id%20from%20ws%20where%20query%3D'moscow')"><small>console</small></a></p><p>I&#8217;ve actually started up a project on <a
href="http://github.com">github</a> called <a
href="http://github.com/spullara/yql-tables/tree/master">yql-tables</a> to store useful table definitions and will be taking submissions from the community. You can try them out by &#8216;use&#8217;ing them directly from the git repository or by pulling them onto your own server accessible from the YQL servers.</p> ]]></content:encoded> <wfw:commentRss>http://www.javarants.com/2009/02/05/yql-opens-up-3rd-party-web-service-table-definitions-to-developers/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Yahoo! Application Platform (YAP) and Yahoo! Query Language (YQL) launch today</title><link>http://www.javarants.com/2008/10/28/yahoo-application-platform-yap-and-yahoo-query-language-yql-launch-today/</link> <comments>http://www.javarants.com/2008/10/28/yahoo-application-platform-yap-and-yahoo-query-language-yql-launch-today/#comments</comments> <pubDate>Tue, 28 Oct 2008 22:40:32 +0000</pubDate> <dc:creator>Sam Pullara</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[yahoo]]></category> <category><![CDATA[yap]]></category> <category><![CDATA[yos]]></category> <category><![CDATA[yql]]></category> <guid
isPermaLink="false">http://www.javarants.com/?p=909</guid> <description><![CDATA[Since I moved into the platform group at the beginning of the year I had worked with the YAP and YQL teams to help them define their strategy and direction but without being part of the day-to-day operations. In August, &#8230; <a
href="http://www.javarants.com/2008/10/28/yahoo-application-platform-yap-and-yahoo-query-language-yql-launch-today/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Since I moved into the platform group at the beginning of the year I had worked with the <a
href="http://developers.yahoo.com/yap">YAP</a> and <a
href="http://developers.yahoo.com/yql">YQL</a> teams to help them define their strategy and direction but without being part of the day-to-day operations.  In August, the head of the Y!OS project asked me to step in to take them through their final run to launch.  It has been a great couple of months working with the teams.  They both had an amazing showing at Hack Day and now today we are launching the platforms worldwide.<br
/> <span
id="more-909"></span><br
/> Over the next few months and into 2009 YAP will be rolling across Yahoo!.  Developers will be able to embed their applications in places like My Yahoo, Frontpage, Media properties and Mail. YQL will continue to be extended to other services by Yahoo! and through a plugin API in the future.  Please check out the announcements at the <a
href="http://ycorpblog.com/2008/10/28/were-open-have-at-it/">Yodel</a>, <a
href="http://developer.yahoo.net/blog/archives/2008/10/yos_10_launch.html">YDN</a> and <a
href="http://opensocialapis.blogspot.com/2008/10/launched-yahoos-first-implementation-of.html">OpenSocial blog.</a></p> ]]></content:encoded> <wfw:commentRss>http://www.javarants.com/2008/10/28/yahoo-application-platform-yap-and-yahoo-query-language-yql-launch-today/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
