<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Big Data on Bharath's Blog</title><link>https://bharathbhushan1.github.io/blog/tags/big-data/</link><description>Recent content in Big Data on Bharath's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 10 Dec 2016 10:00:00 +0000</lastBuildDate><atom:link href="https://bharathbhushan1.github.io/blog/tags/big-data/index.xml" rel="self" type="application/rss+xml"/><item><title>Spark memory management</title><link>https://bharathbhushan1.github.io/blog/posts/2016-12-10-spark-memory-management/</link><pubDate>Sat, 10 Dec 2016 10:00:00 +0000</pubDate><guid>https://bharathbhushan1.github.io/blog/posts/2016-12-10-spark-memory-management/</guid><description>&lt;p&gt;MemoryManager is the place where I started looking at spark’s memory management architecture. This class handles the split of the overall memory into four dynamic portions — onHeapStorage, onHeapExecution, offHeapStorage, offHeapExecution. Execution memory is transient (shuffle, join, aggregates, sorting) and storage memory is longer lived (cache, broadcast variables). MemoryManager depends on MemoryStore to actually allocate and free memory.&lt;/p&gt;
&lt;p&gt;There are two kinds of MemoryManagers — StaticMemoryManager and UnifiedMemoryManager. Unified allows execution and storage to borrow memory from each other while Static does not allow this.&lt;/p&gt;</description></item><item><title>Spark - QueryExecution</title><link>https://bharathbhushan1.github.io/blog/posts/2016-11-20-spark-queryexecution/</link><pubDate>Sun, 20 Nov 2016 10:00:00 +0000</pubDate><guid>https://bharathbhushan1.github.io/blog/posts/2016-11-20-spark-queryexecution/</guid><description>&lt;p&gt;Today I am going to talk about the &lt;strong&gt;QueryExecution&lt;/strong&gt; class in Spark. This class takes care of providing fine grained access to different stages of running a SparkSQL query. Basically the parsing, analysis, optimization and physical planning are all accessible via this class. It also handles inserting extra operations like extracting python UDFs, inserting shuffle stages, internal row format conversions etc.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IncrementalExecution&lt;/strong&gt; is a derived class which allows the same query to be run repeatedly in an incremental fashion, with possible state save in between executions. This is used in Structured Streaming. It is also used to allow users to run their own optimization strategies which is very cool.&lt;/p&gt;</description></item><item><title>Bigtable</title><link>https://bharathbhushan1.github.io/blog/posts/2014-07-01-bigtable/</link><pubDate>Tue, 01 Jul 2014 10:00:00 +0000</pubDate><guid>https://bharathbhushan1.github.io/blog/posts/2014-07-01-bigtable/</guid><description>&lt;p&gt;I am reading Google&amp;rsquo;s &lt;a href="http://research.google.com/archive/bigtable-osdi06.pdf"&gt;Bigtable&lt;/a&gt; paper. Here are some notes.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Can handle petabytes of data spread over thousands of machines&lt;/li&gt;
&lt;li&gt;Clients can dynamically control data format, placement, memory/disk&lt;/li&gt;
&lt;li&gt;Data model is unique, two-level&lt;/li&gt;
&lt;li&gt;Large variations in size and serving latency can be handled&lt;/li&gt;
&lt;li&gt;sparse, distributed, multi-dimensional, sorted map&lt;/li&gt;
&lt;li&gt;row ranges (called tablets) are the unit of distribution and load balancing&lt;/li&gt;
&lt;li&gt;tablets are dynamically sized&lt;/li&gt;
&lt;li&gt;efficiency can be gained by taking advantage of sorting on row keys and
locality in a tablet&lt;/li&gt;
&lt;li&gt;column family is a set of columns&lt;/li&gt;
&lt;li&gt;column family is the unit of access control and accounting&lt;/li&gt;
&lt;li&gt;any number of columns but limited number of column families (100s)&lt;/li&gt;
&lt;li&gt;keep last n versions of data or keep last n seconds of data (garbage
collection)&lt;/li&gt;
&lt;li&gt;API has RowMutation and Scanner as primary abstractions&lt;/li&gt;
&lt;li&gt;uses GFS, cluster management system, sstable, chubby&lt;/li&gt;
&lt;li&gt;sstable is a persistent, ordered, immutable map&lt;/li&gt;
&lt;li&gt;operations for key lookup and key range iteration are supported&lt;/li&gt;
&lt;li&gt;it is split into 64k blocks and there is a block index at the end of the
sstable&lt;/li&gt;
&lt;li&gt;block index allows accessing any key-value in one disk seek&lt;/li&gt;
&lt;li&gt;sstable can also be memory mapped&lt;/li&gt;
&lt;li&gt;chubby is used for&lt;/li&gt;
&lt;li&gt;bigtable master election&lt;/li&gt;
&lt;li&gt;store bootstrap location of bigtable data&lt;/li&gt;
&lt;li&gt;to discover tablet servers&lt;/li&gt;
&lt;li&gt;finalize tablet server deaths&lt;/li&gt;
&lt;li&gt;store bigtable schema info (column family info)&lt;/li&gt;
&lt;li&gt;store acls&lt;/li&gt;
&lt;li&gt;implementation consists of client library, master server and tablet server&lt;/li&gt;
&lt;li&gt;METADATA is a special table in bigtable&lt;/li&gt;
&lt;li&gt;This table is split into multiple tablets&lt;/li&gt;
&lt;li&gt;Each tablet can be present on different tablet servers&lt;/li&gt;
&lt;li&gt;The first tablet is special and is called &lt;em&gt;root tablet&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Root tablet is never split (to keep lookup hierarchy for a tablet to
a max of 3)&lt;/li&gt;
&lt;li&gt;root tablet location is in chubby&lt;/li&gt;
&lt;li&gt;root tablet tracks all the other tablets of the METADATA table&lt;/li&gt;
&lt;li&gt;these other tablets of the METADATA table can be split&lt;/li&gt;
&lt;li&gt;Each row in the METADATA table tracks one user tablet. So each
METADATA tablet tracks one set of user tablets.&lt;/li&gt;
&lt;li&gt;each METADATA table row is hash(table id, end row key) -&amp;gt; location&lt;/li&gt;
&lt;li&gt;With 1KB per row and 128MB METADATA tablet size, trackable number of
tablets is 2^17 * 2^17 = 2^34&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>