Tuesday, November 16, 2010

Devoxx 2010 daily notes: day two

Dive into Android

Layout are not pluggable in Android SDK, i.e. layout classes are containers. It is strongly recommended to use dip unit (device independent pixel).To set a component to use all place let by the parent, set the attribute: MATCH_PARENT. As big as the content, set attribute WRAP_CONTENT.

AbsolutLayout should not be used anymore.

With linear layout:

  • weights redistribute empty space
  • size should be 0 dip. When building UI, SDK evaluate size in first place.

Don't forgot to use tools such TraceView and HierarchyViewer for debugging.

JBoss tools the deployment Ninja

JBoss Tools provides tools for code generation and edition. The challenge is, Eclipse has only one way to produce things. JBoss Tools add different facilities:

  • project archieves to hot deploy projects on servers (can be explored in editors)
  • single files and directories (very usefull with maven) deployment
  • not dependent of JBoss AS usage

It is possible to deploy application by simply drag and drop it on server instance. Instance can also be in remote, and keep its hot deployment capabilities.

Introduction to HBase

HBase is modeled after Google BigTable.It is build on top of Hadoop and is dedicated to store several 100Gb and more.

Its characterics are:

  • transaction only on single row
  • indexes on row key
  • several millions read/write operation per second
  • brings random read/write to HDFS
  • every row has a row key and a timestamp
  • it is a distributed sorted map
  • Value = Row Key + Column Key + Timestamp

HBase shell

Hbase brings a shell to execute command against it, for monitoring or content managment:

  • status: cluster status
  • list: list all user table
  • get: request on one row
  • put: insert
  • scan: request some rows
  • count: row count
  • delete: delete column or row
  • remove: delete table
  • add/remove column family

Architecture

A region is a table row subset, a region server serves region data. A master is responsible of coordinate region servers.

For management of all this information, HBase comes with ZooKeeper.

Data is written to the region memstore (in memory storage). It is flushed at a certain size. Compaction is the operation to compact data into HDFS managed files. There is two kind of compaction:

  • minor: each time memstore is flushed
  • major: by default daily operation. Files are compact to several Gb files.

Region server should not be located with data, and they can split region. In this case, master know that a region has been splitted, and then, affect a new region server to it.

API

API provides configuration capabilities:

Configuration conf = HBaseConfiguration.create();
conf.set("hbase.zookeeper.quorum", "localhost");

API for cluster administration is also available:

  • HTableDescriptor: table and column family
  • HColumnDescriptor: describes a column family

HTable allows to access to an existing table.Put/Get/Scan objects allows to insert/get/select row(s).

HTable files can be managed by MapReduce. API provides TableInputFormat and TableOuputFormat for processing:

  • TableInputFormat: splits HBase tables and use scanner to read split
  • TableOutputFormat: write in HFile format (HDFS file format)

Advanced API

  • Add a row if it does not not already exists: table.checkAndPut.
  • Scanner can be refined by using Filters.
  • The write-ahead log can be disabled: put.setWriteToWAL(boolean)
  • Proxy server is also available to be accessed from other technologies.
  • A REST API is also available (Stargate)
  • Services can be exposed via "Thirst"

Deployment

HBase comes with a pre installed ZooKeeper, but programmer can replace it.

Monitoring can be done with tool like Ganglia or by using JMX interfaces.

Backup can be hold by a MapReduce job to import/export data.

To improve performance, scanner caching can be enabled, but use more memory, and compression method can be set to LZO. For data greater than 12Gb, use filesystem cache.

Groovy/Grails Development in Eclipse

They are available as Spring Tool Suite extension. But, for the moment, Groovy DSL can be added, but, to be recognized in Eclipse, an Eclipse extension point should be added.

Groovy Eclipse integration is actually better than classic compiler, as compiler gives only the first compilation error, but, STS gives all errors. Soon, Groovy++, maven and Gradle will be supported and DSL will be used without added an axtension to Eclipse.

STS brings following facilities to Grails:

  • a new perspective
  • command wizard
  • plugin manager
  • drag & drop into tc Server (agent based reloading)
  • STS grails edition coming soon

Scalable and RESTful web applications: at the crossroads of Kauri and Lily

Kauri is a resource oriented web platform, which core concepts are: models, ptototyping, RIA, routing, pages. There is no web servlet container, but it is replaced by a Spring based application container that load modules in place deploying war files. It uses Groovy for routing and Jax-RS for service.

But from front end is scalable by using Rest services, the bottleneck is relocated to the database server which is no more scalable than before.

To fix this problem, Lily is a scalable store and search engine based on HBase for storage and SOLR for search, and it support model versioning.

No comments:

Post a Comment