<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>README.textile</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,16 +1,16 @@
 Gem::Specification.new do |s|
   s.name = %q{hbase-ruby}
-  s.version = &quot;0.5.0&quot;
+  s.version = &quot;1.0&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Ye Dingding&quot;]
-  s.date = %q{2008-08-09}
+  s.date = %q{2009-03-08}
   s.description = %q{hbase-ruby is a pure ruby client for hbase and enable the ruby app enjoy the power of HBase}
   s.email = %q{yedingding@gmail.com}
   s.extra_rdoc_files = [&quot;History.txt&quot;, &quot;Manifest.txt&quot;, &quot;README.txt&quot;]
   s.files = [&quot;History.txt&quot;, &quot;MIT-LICENSE&quot;, &quot;Manifest.txt&quot;, &quot;README.txt&quot;, &quot;Rakefile&quot;, &quot;hbase-ruby.gemspec&quot;, &quot;lib/hbase.rb&quot;, &quot;lib/hbase/client.rb&quot;, &quot;lib/hbase/exception.rb&quot;, &quot;lib/hbase/model.rb&quot;, &quot;lib/hbase/model/column.rb&quot;, &quot;lib/hbase/model/column_descriptor.rb&quot;, &quot;lib/hbase/model/region_descriptor.rb&quot;, &quot;lib/hbase/model/row.rb&quot;, &quot;lib/hbase/model/table_descriptor.rb&quot;, &quot;lib/hbase/model/scanner.rb&quot;, &quot;lib/hbase/operation/meta_operation.rb&quot;, &quot;lib/hbase/operation/row_operation.rb&quot;, &quot;lib/hbase/operation/scanner_operation.rb&quot;, &quot;lib/hbase/operation/table_operation.rb&quot;, &quot;lib/hbase/request.rb&quot;, &quot;lib/hbase/request/basic_request.rb&quot;, &quot;lib/hbase/request/meta_request.rb&quot;, &quot;lib/hbase/request/row_request.rb&quot;, &quot;lib/hbase/request/scanner_request.rb&quot;, &quot;lib/hbase/request/table_request.rb&quot;, &quot;lib/hbase/response.rb&quot;, &quot;lib/hbase/response/basic_response.rb&quot;, &quot;lib/hbase/response/meta_response.rb&quot;, &quot;lib/hbase/response/row_response.rb&quot;, &quot;lib/hbase/response/table_response.rb&quot;, &quot;lib/hbase/response/scanner_response.rb&quot;]
   s.has_rdoc = true
-  s.homepage = %q{http://sishen.lifegoo.com}
+  s.homepage = %q{http://github.com/sishen}
   s.rdoc_options = [&quot;--main&quot;, &quot;README.txt&quot;]
   s.require_paths = [&quot;lib&quot;]
   s.rubygems_version = %q{1.2.0}</diff>
      <filename>hbase-ruby.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -51,12 +51,13 @@ module HBase
       rescue Errno::ECONNREFUSED
         raise ConnectionNotEstablishedError, &quot;can't connect to #{@url}&quot;
       rescue Timeout::Error =&gt; e
+        puts e.backtrace.join(&quot;\n&quot;)
         raise ConnectionTimeoutError, &quot;execution expired. Maybe query disabled tables&quot;
       end
 
       case response
       when Net::HTTPSuccess
-        response.body.blank? ? response.header : response.body
+        response.body
       else
         response.error!
       end</diff>
      <filename>lib/hbase/client.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ module HBase
       NONE = &quot;NONE&quot;
       RECORD = &quot;RECORD&quot;
       BLOCK = &quot;BLOCK&quot;
-      
+
       CTYPES = [NONE, RECORD, BLOCK]
 
       def to_compression_type(type_string)</diff>
      <filename>lib/hbase/model/column_descriptor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,6 @@ module HBase
           request = Request::RowRequest.new(table_name, name, timestamp)
           row = Response::RowResponse.new(get(request.show(columns, options))).parse
           row.table_name = table_name
-          row.name = name
           row.timestamp = timestamp
           row
         rescue Net::ProtocolError =&gt; e
@@ -34,12 +33,14 @@ module HBase
         begin
           request = Request::RowRequest.new(table_name, name, timestamp)
           data = []
-          if columns.instance_of? Array
-            data = columns
-          elsif columns.instance_of? Hash
-            data = [columns]
-          else
-            raise StandardError, &quot;Only Array or Hash data accepted&quot;
+          if columns
+            if columns.instance_of? Array
+              data = columns
+            elsif columns.instance_of? Hash
+              data = [columns]
+            else
+              raise StandardError, &quot;Only Array or Hash data accepted&quot;
+            end
           end
           xml_data =&quot;&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;columns&gt;&quot;
           data.each do |d|
@@ -49,7 +50,7 @@ module HBase
           end
           xml_data &lt;&lt; &quot;&lt;/columns&gt;&quot;
 
-          Response::RowResponse.new(post(request.create, xml_data))
+          post(request.create, xml_data)
         rescue Net::ProtocolError =&gt; e
           if e.to_s.include?(&quot;Table&quot;)
             raise TableNotFoundError, &quot;Table '#{table_name}' Not Found&quot;</diff>
      <filename>lib/hbase/operation/row_operation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,12 @@
 module HBase
   module Operation
     module ScannerOperation
-      def open_scanner(table_name, columns, start_row = nil, end_row = nil, timestamp = nil)
+      def open_scanner(table_name, columns, start_row = nil, stop_row = nil, timestamp = nil)
         begin
           request = Request::ScannerRequest.new(table_name)
-          scanner_id = Response::ScannerResponse.new(post(request.open(columns, start_row, end_row, timestamp))).get_scanner_id
+          scanner = Response::ScannerResponse.new(post(request.open(columns, start_row, stop_row, timestamp))).parse
+          scanner.table_name = table_name
+          scanner
         rescue Net::ProtocolError =&gt; e
           if e.to_s.include?(&quot;TableNotFoundException&quot;)
             raise TableNotFoundError, &quot;Table #{table_name} Not Found!&quot;</diff>
      <filename>lib/hbase/operation/scanner_operation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -73,6 +73,11 @@ module HBase
         end
       end
 
+      def destroy_table(name, columns = nil)
+        disable_table(name)
+        delete_table(name, columns)
+      end
+
       def enable_table(name)
         begin
           request = Request::TableRequest.new(name)</diff>
      <filename>lib/hbase/operation/table_operation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,11 +9,11 @@ module HBase
         super(path)
       end
 
-      def open(columns, start_row = nil, end_row = nil, timestamp = nil)
+      def open(columns, start_row = nil, stop_row = nil, timestamp = nil)
         search = []
         search &lt;&lt; pack_params(columns)
         search &lt;&lt; &quot;start_row=#{CGI.escape(start_row)}&quot; if start_row
-        search &lt;&lt; &quot;end_row=#{CGI.escape(end_row)}&quot; if end_row
+        search &lt;&lt; &quot;stop_row=#{CGI.escape(end_row)}&quot; if stop_row
         search &lt;&lt; &quot;timestamp=#{CGI.escape(timestamp)}&quot; if timestamp
 
         @path &lt;&lt; &quot;?&quot; &lt;&lt; search.join('&amp;')</diff>
      <filename>lib/hbase/request/scanner_request.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,8 @@ module HBase
           entry = doc.elements[&quot;tables&quot;]
           tables = []
           entry.elements.each(&quot;table&quot;) do |table|
-            t = Model::TableDescriptor.new(:name =&gt; table.text.strip)
+            name = table.elements[&quot;name&quot;].text.strip rescue nil
+            t = Model::TableDescriptor.new(:name =&gt; name)
             tables &lt;&lt; t
           end
           tables</diff>
      <filename>lib/hbase/response/meta_response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,9 +4,11 @@ module HBase
       def parse_content(raw_data)
         doc = REXML::Document.new(raw_data)
         row = doc.elements[&quot;row&quot;]
+        rname = row.elements[&quot;name&quot;].text.strip.unpack(&quot;m&quot;).first
         columns = []
+        # Need fix in the server side
         count = row.elements[&quot;count&quot;].text.strip.to_i rescue 0
-        row.elements.each(&quot;column&quot;) do |col|
+        row.elements[&quot;columns&quot;].elements.each(&quot;column&quot;) do |col|
           name = col.elements[&quot;name&quot;].text.strip.unpack(&quot;m&quot;).first
           value = col.elements[&quot;value&quot;].text.strip.unpack(&quot;m&quot;).first rescue nil
           timestamp = col.elements[&quot;timestamp&quot;].text.strip.to_i
@@ -14,7 +16,7 @@ module HBase
                                        :value =&gt; value,
                                        :timestamp =&gt; timestamp)
         end
-        Model::Row.new(:total_count =&gt; count, :columns =&gt; columns)
+        Model::Row.new(:name =&gt; rname, :total_count =&gt; count, :columns =&gt; columns)
       end
     end
   end</diff>
      <filename>lib/hbase/response/row_response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,30 +2,33 @@ module HBase
   module Response
     class ScannerResponse &lt; BasicResponse
       def parse_content(raw_data)
+        puts raw_data
+
         doc = REXML::Document.new(raw_data)
-        doc = doc.elements[&quot;rows&quot;] if doc.elements[&quot;rows&quot;] &amp;&amp; doc.elements[&quot;rows&quot;].has_elements?
 
-        rows = []
-        doc.elements.each(&quot;row&quot;) do |row|
-          row_name = row.elements[&quot;name&quot;].text.strip.unpack(&quot;m&quot;).first
-          columns = []
-          row.elements.each(&quot;column&quot;) do |col|
-            name = col.elements[&quot;name&quot;].text.strip.unpack(&quot;m&quot;).first
-            value = col.elements[&quot;value&quot;].text.strip.unpack(&quot;m&quot;).first rescue nil
-            timestamp = col.elements[&quot;timestamp&quot;].text.strip.to_i
-            columns &lt;&lt; Model::Column.new(:name =&gt; name,
-                                         :value =&gt; value,
-                                         :timestamp =&gt; timestamp)
+        if doc.elements[&quot;/scanner&quot;] &amp;&amp; doc.elements[&quot;/scanner&quot;].has_elements?
+          scanner = doc.elements[&quot;scanner&quot;]
+          id = scanner.elements[&quot;id&quot;].text.strip.to_i
+          Model::Scanner.new(:scanner_id =&gt; id)
+
+        elsif doc.elements[&quot;rows&quot;] &amp;&amp; doc.elements[&quot;rows&quot;].has_elements?
+          doc = doc.elements[&quot;rows&quot;]
+          rows = []
+          doc.elements.each(&quot;row&quot;) do |row|
+            row_name = row.elements[&quot;name&quot;].text.strip.unpack(&quot;m&quot;).first
+            columns = []
+            row.elements.each(&quot;column&quot;) do |col|
+              name = col.elements[&quot;name&quot;].text.strip.unpack(&quot;m&quot;).first
+              value = col.elements[&quot;value&quot;].text.strip.unpack(&quot;m&quot;).first rescue nil
+              timestamp = col.elements[&quot;timestamp&quot;].text.strip.to_i
+              columns &lt;&lt; Model::Column.new(:name =&gt; name,
+                                           :value =&gt; value,
+                                           :timestamp =&gt; timestamp)
+            end
+            rows &lt;&lt; Model::Row.new(:name =&gt; row_name, :columns =&gt; columns)
           end
-          rows &lt;&lt; Model::Row.new(:name =&gt; row_name, :columns =&gt; columns)
+          rows
         end
-        rows
-      end
-
-      def get_scanner_id
-        location = @raw_data['location']
-        paths = location.split('/')
-        Model::Scanner.new(:table_name =&gt; paths[2], :scanner_id =&gt; paths[4])
       end
     end
   end</diff>
      <filename>lib/hbase/response/scanner_response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,7 @@ module HBase
           compression = columnfamily.elements[&quot;compression&quot;].text.strip
           bloomfilter = columnfamily.elements[&quot;bloomfilter&quot;].text.strip.to_b
           max_versions = columnfamily.elements[&quot;max-versions&quot;].text.strip.to_i
-          maximum_cell_size = columnfamily.elements[&quot;maximum-cell-size&quot;].text.strip.to_i
+          maximum_cell_size = columnfamily.elements[&quot;max-length&quot;].text.strip.to_i
 
           column_descriptor = Model::ColumnDescriptor.new(:name =&gt; colname,
                                                           :compression =&gt; Model::CompressionType.to_compression_type(compression),</diff>
      <filename>lib/hbase/response/table_response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,4 +2,17 @@ require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
 
 describe HBase::Operation::MetaOperation do
 
+  before do
+    url = ENV[&quot;HBASE_URL&quot;].nil? ? &quot;http://localhost:60050/api&quot; : ENV[&quot;HBASE_URL&quot;]
+    @client = HBase::Client.new(url)
+  end
+
+  it &quot;should return tables&quot; do
+    tables = @client.list_tables
+    tables.should respond_to(:size)
+    tables.each do |table|
+      table.should.is_a? HBase::Model::TableDescriptor
+    end
+  end
+
 end</diff>
      <filename>spec/hbase/operation/meta_operation_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,39 @@
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
 
 describe HBase::Operation::RowOperation do
+  before :all do
+    url = ENV[&quot;HBASE_URL&quot;].nil? ? &quot;http://localhost:60050/api&quot; : ENV[&quot;HBASE_URL&quot;]
+    @client = HBase::Client.new(url)
 
+    table = @client.create_table(&quot;test-hbase-ruby&quot;, &quot;col1&quot;)
+  end
+
+  it &quot;should create two rows called 'row1'&quot; do
+    lambda {
+      row2 = @client.create_row(&quot;test-hbase-ruby&quot;, &quot;row1&quot;, nil, { :name =&gt; &quot;col1:&quot;, :value =&gt; &quot;row1-col1&quot; })
+    }.should_not raise_error
+  end
+
+  it &quot;should show the rows 'row1'&quot; do
+    row = @client.show_row(&quot;test-hbase-ruby&quot;, &quot;row1&quot;)
+    row.should.is_a? HBase::Model::Row
+    row.table_name.should == &quot;test-hbase-ruby&quot;
+    row.name.should == &quot;row1&quot;
+    row.columns.size.should == 1
+    row.columns.each do |col|
+      col.should.is_a? HBase::Model::Column
+      col.name.should == &quot;col1:&quot;
+      col.value.should == &quot;row1-col1&quot;
+    end
+  end
+
+  it &quot;should delete the rows 'row1'&quot; do
+    lambda {
+      row1 = @client.delete_row('test-hbase-ruby', 'row1')
+    }.should_not raise_error
+  end
+
+  after :all do
+    table = @client.destroy_table(&quot;test-hbase-ruby&quot;)
+  end
 end</diff>
      <filename>spec/hbase/operation/row_operation_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,29 @@
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
 
 describe HBase::Operation::ScannerOperation do
+  before :all do
+    url = ENV[&quot;HBASE_URL&quot;].nil? ? &quot;http://localhost:60050/api&quot; : ENV[&quot;HBASE_URL&quot;]
+    @client = HBase::Client.new(url)
 
+    table = @client.create_table(&quot;test-hbase-ruby&quot;, &quot;col1&quot;)
+    @client.create_row('test-hbase-ruby', 'row1', {:name =&gt; 'col1:', :value =&gt; &quot;row1-col1&quot;})
+    @client.create_row('test-hbase-ruby', 'row2', {:name =&gt; 'col1:', :value =&gt; &quot;row2-col1&quot;})
+    @client.create_row('test-hbase-ruby', 'row3', {:name =&gt; 'col1:', :value =&gt; &quot;row3-col1&quot;})
+  end
+
+  it &quot;should obtain a scanner&quot; do
+    # The test will pass but will make table_disable fail. Seems the problem of server side
+
+#     scanner = @client.open_scanner(&quot;test-hbase-ruby&quot;, 'col1:')
+#     scanner.should.is_a? HBase::Model::Scanner
+#     scanner.scanner_id.should.is_a? Integer
+
+#     lambda {
+#       @client.close_scanner(scanner)
+#     }.should_not raise_error
+  end
+
+  after :all do
+    @client.destroy_table(&quot;test-hbase-ruby&quot;)
+  end
 end</diff>
      <filename>spec/hbase/operation/scanner_operation_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,56 @@
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
 
 describe HBase::Operation::TableOperation do
+  before :all do
+    url = ENV[&quot;HBASE_URL&quot;].nil? ? &quot;http://localhost:60050/api&quot; : ENV[&quot;HBASE_URL&quot;]
+    @client = HBase::Client.new(url)
+  end
 
+  it &quot;should create a table called test-hbase-ruby&quot; do
+    table = @client.create_table('test-hbase-ruby', { :name =&gt; 'habbit',
+                                   :max_version =&gt; 3,
+                                   :compression =&gt; HBase::Model::CompressionType::NONE,
+                                   :in_memory =&gt; false,
+                                   :block_cache =&gt; false,
+                                   :ttl =&gt; -1,
+                                   :max_cell_size =&gt; 2147483647,
+                                   :bloomfilter =&gt; false
+                                 })
+    table.should.is_a? HBase::Model::TableDescriptor
+  end
+
+  it &quot;should show the table info of 'test-hbase-ruby'&quot; do
+    table = @client.show_table('test-hbase-ruby')
+    table.should.is_a? HBase::Model::TableDescriptor
+    table.name.should == &quot;test-hbase-ruby&quot;
+    table.column_families.should respond_to(:each)
+    table.column_families.each do |cf|
+      cf.should.is_a? HBase::Model::ColumnDescriptor
+    end
+  end
+
+  it &quot;should disable table 'test-hbase-ruby'&quot; do
+    lambda {
+      table = @client.disable_table('test-hbase-ruby')
+    }.should_not raise_error
+  end
+
+  it &quot;should enable table 'test-hbase-ruby'&quot; do
+    lambda {
+      table = @client.enable_table('test-hbase-ruby')
+    }.should_not raise_error
+  end
+
+  it &quot;should delete the table 'test-hbase-ruby'&quot; do
+    lambda {
+      table = @client.destroy_table(&quot;test-hbase-ruby&quot;)
+    }.should_not raise_error
+
+    lambda {
+      table = @client.show_table(&quot;test-hbase-ruby&quot;)
+    }.should raise_error(HBase::TableNotFoundError)
+  end
+
+  after :all do
+  end
 end</diff>
      <filename>spec/hbase/operation/table_operation_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,3 +5,8 @@ desc &quot;Run all examples&quot;
 Spec::Rake::SpecTask.new('examples') do |t|
   t.spec_files = FileList['spec/**/*_spec.rb']
 end
+
+Spec::Rake::SpecTask.new(:hbase) do |t|
+  t.spec_files = FileList['spec/hbase/**/*_spec.rb']
+  t.spec_opts = ['--color', '--format', 'specdoc']
+end</diff>
      <filename>tasks/rspec.rake</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>README.txt</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>ba430d6090f86c1ed9958ad27eca55df5b9b1cd7</id>
    </parent>
  </parents>
  <author>
    <name>Ye Dingding</name>
    <email>sishen@sishen-mac.local</email>
  </author>
  <url>http://github.com/sishen/hbase-ruby/commit/2b483ccc9137084e4ca49c414f64542e55b61d05</url>
  <id>2b483ccc9137084e4ca49c414f64542e55b61d05</id>
  <committed-date>2009-03-08T11:23:11-07:00</committed-date>
  <authored-date>2009-03-08T11:23:11-07:00</authored-date>
  <message>refactor based on hbase v0.20 dev</message>
  <tree>801a7f5cea4f5327d93cbb17d4cb516983b2e500</tree>
  <committer>
    <name>Ye Dingding</name>
    <email>sishen@sishen-mac.local</email>
  </committer>
</commit>
