hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1406339 [11/17] - in /hbase/trunk: ./ examples/ hbase-examples/ hbase-examples/src/ hbase-examples/src/main/ hbase-examples/src/main/cpp/ hbase-examples/src/main/cpp/gen-cpp/ hbase-examples/src/main/java/ hbase-examples/src/main/java/org/ ...
Date Tue, 06 Nov 2012 21:22:30 GMT
Added: hbase/trunk/hbase-examples/src/main/perl/gen-perl/Hbase/Types.pm
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/perl/gen-perl/Hbase/Types.pm?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/perl/gen-perl/Hbase/Types.pm (added)
+++ hbase/trunk/hbase-examples/src/main/perl/gen-perl/Hbase/Types.pm Tue Nov  6 21:22:27 2012
@@ -0,0 +1,1207 @@
+#
+# Autogenerated by Thrift Compiler (0.9.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+require 5.6.0;
+use strict;
+use warnings;
+use Thrift;
+
+package Hbase::TCell;
+use base qw(Class::Accessor);
+Hbase::TCell->mk_accessors( qw( value timestamp ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{value} = undef;
+  $self->{timestamp} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{value}) {
+      $self->{value} = $vals->{value};
+    }
+    if (defined $vals->{timestamp}) {
+      $self->{timestamp} = $vals->{timestamp};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'TCell';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{value});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::I64) {
+        $xfer += $input->readI64(\$self->{timestamp});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('TCell');
+  if (defined $self->{value}) {
+    $xfer += $output->writeFieldBegin('value', TType::STRING, 1);
+    $xfer += $output->writeString($self->{value});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{timestamp}) {
+    $xfer += $output->writeFieldBegin('timestamp', TType::I64, 2);
+    $xfer += $output->writeI64($self->{timestamp});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::ColumnDescriptor;
+use base qw(Class::Accessor);
+Hbase::ColumnDescriptor->mk_accessors( qw( name maxVersions compression inMemory bloomFilterType
bloomFilterVectorSize bloomFilterNbHashes blockCacheEnabled timeToLive ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{name} = undef;
+  $self->{maxVersions} = 3;
+  $self->{compression} = "NONE";
+  $self->{inMemory} = 0;
+  $self->{bloomFilterType} = "NONE";
+  $self->{bloomFilterVectorSize} = 0;
+  $self->{bloomFilterNbHashes} = 0;
+  $self->{blockCacheEnabled} = 0;
+  $self->{timeToLive} = -1;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{name}) {
+      $self->{name} = $vals->{name};
+    }
+    if (defined $vals->{maxVersions}) {
+      $self->{maxVersions} = $vals->{maxVersions};
+    }
+    if (defined $vals->{compression}) {
+      $self->{compression} = $vals->{compression};
+    }
+    if (defined $vals->{inMemory}) {
+      $self->{inMemory} = $vals->{inMemory};
+    }
+    if (defined $vals->{bloomFilterType}) {
+      $self->{bloomFilterType} = $vals->{bloomFilterType};
+    }
+    if (defined $vals->{bloomFilterVectorSize}) {
+      $self->{bloomFilterVectorSize} = $vals->{bloomFilterVectorSize};
+    }
+    if (defined $vals->{bloomFilterNbHashes}) {
+      $self->{bloomFilterNbHashes} = $vals->{bloomFilterNbHashes};
+    }
+    if (defined $vals->{blockCacheEnabled}) {
+      $self->{blockCacheEnabled} = $vals->{blockCacheEnabled};
+    }
+    if (defined $vals->{timeToLive}) {
+      $self->{timeToLive} = $vals->{timeToLive};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'ColumnDescriptor';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{name});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{maxVersions});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{compression});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::BOOL) {
+        $xfer += $input->readBool(\$self->{inMemory});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^5$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{bloomFilterType});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^6$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{bloomFilterVectorSize});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^7$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{bloomFilterNbHashes});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^8$/ && do{      if ($ftype == TType::BOOL) {
+        $xfer += $input->readBool(\$self->{blockCacheEnabled});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^9$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{timeToLive});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('ColumnDescriptor');
+  if (defined $self->{name}) {
+    $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
+    $xfer += $output->writeString($self->{name});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{maxVersions}) {
+    $xfer += $output->writeFieldBegin('maxVersions', TType::I32, 2);
+    $xfer += $output->writeI32($self->{maxVersions});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{compression}) {
+    $xfer += $output->writeFieldBegin('compression', TType::STRING, 3);
+    $xfer += $output->writeString($self->{compression});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{inMemory}) {
+    $xfer += $output->writeFieldBegin('inMemory', TType::BOOL, 4);
+    $xfer += $output->writeBool($self->{inMemory});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{bloomFilterType}) {
+    $xfer += $output->writeFieldBegin('bloomFilterType', TType::STRING, 5);
+    $xfer += $output->writeString($self->{bloomFilterType});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{bloomFilterVectorSize}) {
+    $xfer += $output->writeFieldBegin('bloomFilterVectorSize', TType::I32, 6);
+    $xfer += $output->writeI32($self->{bloomFilterVectorSize});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{bloomFilterNbHashes}) {
+    $xfer += $output->writeFieldBegin('bloomFilterNbHashes', TType::I32, 7);
+    $xfer += $output->writeI32($self->{bloomFilterNbHashes});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{blockCacheEnabled}) {
+    $xfer += $output->writeFieldBegin('blockCacheEnabled', TType::BOOL, 8);
+    $xfer += $output->writeBool($self->{blockCacheEnabled});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{timeToLive}) {
+    $xfer += $output->writeFieldBegin('timeToLive', TType::I32, 9);
+    $xfer += $output->writeI32($self->{timeToLive});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::TRegionInfo;
+use base qw(Class::Accessor);
+Hbase::TRegionInfo->mk_accessors( qw( startKey endKey id name version serverName port
) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{startKey} = undef;
+  $self->{endKey} = undef;
+  $self->{id} = undef;
+  $self->{name} = undef;
+  $self->{version} = undef;
+  $self->{serverName} = undef;
+  $self->{port} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{startKey}) {
+      $self->{startKey} = $vals->{startKey};
+    }
+    if (defined $vals->{endKey}) {
+      $self->{endKey} = $vals->{endKey};
+    }
+    if (defined $vals->{id}) {
+      $self->{id} = $vals->{id};
+    }
+    if (defined $vals->{name}) {
+      $self->{name} = $vals->{name};
+    }
+    if (defined $vals->{version}) {
+      $self->{version} = $vals->{version};
+    }
+    if (defined $vals->{serverName}) {
+      $self->{serverName} = $vals->{serverName};
+    }
+    if (defined $vals->{port}) {
+      $self->{port} = $vals->{port};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'TRegionInfo';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{startKey});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{endKey});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::I64) {
+        $xfer += $input->readI64(\$self->{id});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{name});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^5$/ && do{      if ($ftype == TType::BYTE) {
+        $xfer += $input->readByte(\$self->{version});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^6$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{serverName});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^7$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{port});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('TRegionInfo');
+  if (defined $self->{startKey}) {
+    $xfer += $output->writeFieldBegin('startKey', TType::STRING, 1);
+    $xfer += $output->writeString($self->{startKey});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{endKey}) {
+    $xfer += $output->writeFieldBegin('endKey', TType::STRING, 2);
+    $xfer += $output->writeString($self->{endKey});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{id}) {
+    $xfer += $output->writeFieldBegin('id', TType::I64, 3);
+    $xfer += $output->writeI64($self->{id});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{name}) {
+    $xfer += $output->writeFieldBegin('name', TType::STRING, 4);
+    $xfer += $output->writeString($self->{name});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{version}) {
+    $xfer += $output->writeFieldBegin('version', TType::BYTE, 5);
+    $xfer += $output->writeByte($self->{version});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{serverName}) {
+    $xfer += $output->writeFieldBegin('serverName', TType::STRING, 6);
+    $xfer += $output->writeString($self->{serverName});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{port}) {
+    $xfer += $output->writeFieldBegin('port', TType::I32, 7);
+    $xfer += $output->writeI32($self->{port});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::Mutation;
+use base qw(Class::Accessor);
+Hbase::Mutation->mk_accessors( qw( isDelete column value writeToWAL ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{isDelete} = 0;
+  $self->{column} = undef;
+  $self->{value} = undef;
+  $self->{writeToWAL} = 1;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{isDelete}) {
+      $self->{isDelete} = $vals->{isDelete};
+    }
+    if (defined $vals->{column}) {
+      $self->{column} = $vals->{column};
+    }
+    if (defined $vals->{value}) {
+      $self->{value} = $vals->{value};
+    }
+    if (defined $vals->{writeToWAL}) {
+      $self->{writeToWAL} = $vals->{writeToWAL};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Mutation';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::BOOL) {
+        $xfer += $input->readBool(\$self->{isDelete});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{column});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{value});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::BOOL) {
+        $xfer += $input->readBool(\$self->{writeToWAL});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('Mutation');
+  if (defined $self->{isDelete}) {
+    $xfer += $output->writeFieldBegin('isDelete', TType::BOOL, 1);
+    $xfer += $output->writeBool($self->{isDelete});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{column}) {
+    $xfer += $output->writeFieldBegin('column', TType::STRING, 2);
+    $xfer += $output->writeString($self->{column});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{value}) {
+    $xfer += $output->writeFieldBegin('value', TType::STRING, 3);
+    $xfer += $output->writeString($self->{value});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{writeToWAL}) {
+    $xfer += $output->writeFieldBegin('writeToWAL', TType::BOOL, 4);
+    $xfer += $output->writeBool($self->{writeToWAL});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::BatchMutation;
+use base qw(Class::Accessor);
+Hbase::BatchMutation->mk_accessors( qw( row mutations ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{row} = undef;
+  $self->{mutations} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{row}) {
+      $self->{row} = $vals->{row};
+    }
+    if (defined $vals->{mutations}) {
+      $self->{mutations} = $vals->{mutations};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'BatchMutation';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{row});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::LIST) {
+        {
+          my $_size0 = 0;
+          $self->{mutations} = [];
+          my $_etype3 = 0;
+          $xfer += $input->readListBegin(\$_etype3, \$_size0);
+          for (my $_i4 = 0; $_i4 < $_size0; ++$_i4)
+          {
+            my $elem5 = undef;
+            $elem5 = new Hbase::Mutation();
+            $xfer += $elem5->read($input);
+            push(@{$self->{mutations}},$elem5);
+          }
+          $xfer += $input->readListEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('BatchMutation');
+  if (defined $self->{row}) {
+    $xfer += $output->writeFieldBegin('row', TType::STRING, 1);
+    $xfer += $output->writeString($self->{row});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{mutations}) {
+    $xfer += $output->writeFieldBegin('mutations', TType::LIST, 2);
+    {
+      $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{mutations}}));
+      {
+        foreach my $iter6 (@{$self->{mutations}}) 
+        {
+          $xfer += ${iter6}->write($output);
+        }
+      }
+      $xfer += $output->writeListEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::TIncrement;
+use base qw(Class::Accessor);
+Hbase::TIncrement->mk_accessors( qw( table row column ammount ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{table} = undef;
+  $self->{row} = undef;
+  $self->{column} = undef;
+  $self->{ammount} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{table}) {
+      $self->{table} = $vals->{table};
+    }
+    if (defined $vals->{row}) {
+      $self->{row} = $vals->{row};
+    }
+    if (defined $vals->{column}) {
+      $self->{column} = $vals->{column};
+    }
+    if (defined $vals->{ammount}) {
+      $self->{ammount} = $vals->{ammount};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'TIncrement';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{table});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{row});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{column});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::I64) {
+        $xfer += $input->readI64(\$self->{ammount});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('TIncrement');
+  if (defined $self->{table}) {
+    $xfer += $output->writeFieldBegin('table', TType::STRING, 1);
+    $xfer += $output->writeString($self->{table});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{row}) {
+    $xfer += $output->writeFieldBegin('row', TType::STRING, 2);
+    $xfer += $output->writeString($self->{row});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{column}) {
+    $xfer += $output->writeFieldBegin('column', TType::STRING, 3);
+    $xfer += $output->writeString($self->{column});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{ammount}) {
+    $xfer += $output->writeFieldBegin('ammount', TType::I64, 4);
+    $xfer += $output->writeI64($self->{ammount});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::TRowResult;
+use base qw(Class::Accessor);
+Hbase::TRowResult->mk_accessors( qw( row columns ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{row} = undef;
+  $self->{columns} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{row}) {
+      $self->{row} = $vals->{row};
+    }
+    if (defined $vals->{columns}) {
+      $self->{columns} = $vals->{columns};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'TRowResult';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{row});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::MAP) {
+        {
+          my $_size7 = 0;
+          $self->{columns} = {};
+          my $_ktype8 = 0;
+          my $_vtype9 = 0;
+          $xfer += $input->readMapBegin(\$_ktype8, \$_vtype9, \$_size7);
+          for (my $_i11 = 0; $_i11 < $_size7; ++$_i11)
+          {
+            my $key12 = '';
+            my $val13 = new Hbase::TCell();
+            $xfer += $input->readString(\$key12);
+            $val13 = new Hbase::TCell();
+            $xfer += $val13->read($input);
+            $self->{columns}->{$key12} = $val13;
+          }
+          $xfer += $input->readMapEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('TRowResult');
+  if (defined $self->{row}) {
+    $xfer += $output->writeFieldBegin('row', TType::STRING, 1);
+    $xfer += $output->writeString($self->{row});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{columns}) {
+    $xfer += $output->writeFieldBegin('columns', TType::MAP, 2);
+    {
+      $xfer += $output->writeMapBegin(TType::STRING, TType::STRUCT, scalar(keys %{$self->{columns}}));
+      {
+        while( my ($kiter14,$viter15) = each %{$self->{columns}}) 
+        {
+          $xfer += $output->writeString($kiter14);
+          $xfer += ${viter15}->write($output);
+        }
+      }
+      $xfer += $output->writeMapEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::TScan;
+use base qw(Class::Accessor);
+Hbase::TScan->mk_accessors( qw( startRow stopRow timestamp columns caching filterString
) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{startRow} = undef;
+  $self->{stopRow} = undef;
+  $self->{timestamp} = undef;
+  $self->{columns} = undef;
+  $self->{caching} = undef;
+  $self->{filterString} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{startRow}) {
+      $self->{startRow} = $vals->{startRow};
+    }
+    if (defined $vals->{stopRow}) {
+      $self->{stopRow} = $vals->{stopRow};
+    }
+    if (defined $vals->{timestamp}) {
+      $self->{timestamp} = $vals->{timestamp};
+    }
+    if (defined $vals->{columns}) {
+      $self->{columns} = $vals->{columns};
+    }
+    if (defined $vals->{caching}) {
+      $self->{caching} = $vals->{caching};
+    }
+    if (defined $vals->{filterString}) {
+      $self->{filterString} = $vals->{filterString};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'TScan';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{startRow});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{stopRow});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::I64) {
+        $xfer += $input->readI64(\$self->{timestamp});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::LIST) {
+        {
+          my $_size16 = 0;
+          $self->{columns} = [];
+          my $_etype19 = 0;
+          $xfer += $input->readListBegin(\$_etype19, \$_size16);
+          for (my $_i20 = 0; $_i20 < $_size16; ++$_i20)
+          {
+            my $elem21 = undef;
+            $xfer += $input->readString(\$elem21);
+            push(@{$self->{columns}},$elem21);
+          }
+          $xfer += $input->readListEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^5$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{caching});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^6$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{filterString});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('TScan');
+  if (defined $self->{startRow}) {
+    $xfer += $output->writeFieldBegin('startRow', TType::STRING, 1);
+    $xfer += $output->writeString($self->{startRow});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{stopRow}) {
+    $xfer += $output->writeFieldBegin('stopRow', TType::STRING, 2);
+    $xfer += $output->writeString($self->{stopRow});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{timestamp}) {
+    $xfer += $output->writeFieldBegin('timestamp', TType::I64, 3);
+    $xfer += $output->writeI64($self->{timestamp});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{columns}) {
+    $xfer += $output->writeFieldBegin('columns', TType::LIST, 4);
+    {
+      $xfer += $output->writeListBegin(TType::STRING, scalar(@{$self->{columns}}));
+      {
+        foreach my $iter22 (@{$self->{columns}}) 
+        {
+          $xfer += $output->writeString($iter22);
+        }
+      }
+      $xfer += $output->writeListEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{caching}) {
+    $xfer += $output->writeFieldBegin('caching', TType::I32, 5);
+    $xfer += $output->writeI32($self->{caching});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{filterString}) {
+    $xfer += $output->writeFieldBegin('filterString', TType::STRING, 6);
+    $xfer += $output->writeString($self->{filterString});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::IOError;
+use base qw(Thrift::TException);
+use base qw(Class::Accessor);
+Hbase::IOError->mk_accessors( qw( message ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{message} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{message}) {
+      $self->{message} = $vals->{message};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'IOError';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{message});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('IOError');
+  if (defined $self->{message}) {
+    $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
+    $xfer += $output->writeString($self->{message});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::IllegalArgument;
+use base qw(Thrift::TException);
+use base qw(Class::Accessor);
+Hbase::IllegalArgument->mk_accessors( qw( message ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{message} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{message}) {
+      $self->{message} = $vals->{message};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'IllegalArgument';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{message});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('IllegalArgument');
+  if (defined $self->{message}) {
+    $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
+    $xfer += $output->writeString($self->{message});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Hbase::AlreadyExists;
+use base qw(Thrift::TException);
+use base qw(Class::Accessor);
+Hbase::AlreadyExists->mk_accessors( qw( message ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{message} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{message}) {
+      $self->{message} = $vals->{message};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'AlreadyExists';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{message});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('AlreadyExists');
+  if (defined $self->{message}) {
+    $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
+    $xfer += $output->writeString($self->{message});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+1;

Added: hbase/trunk/hbase-examples/src/main/php/DemoClient.php
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/php/DemoClient.php?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/php/DemoClient.php (added)
+++ hbase/trunk/hbase-examples/src/main/php/DemoClient.php Tue Nov  6 21:22:27 2012
@@ -0,0 +1,297 @@
+<?php
+/**
+ * Copyright 2008 The Apache Software Foundation
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+# See {$THRIFT_HOME}/lib/php/README for additional help.
+
+# Change this to match your thrift root.
+$GLOBALS['THRIFT_ROOT'] = '/Users/irubin/Thrift/thrift-20080411p1/lib/php/src';
+
+require_once( $GLOBALS['THRIFT_ROOT'].'/Thrift.php' );
+
+# Something is wrong with this. Is this the PHP way of doing things? 
+# Old versions of thrift seemingly worked with just a couple includes.
+require_once( $GLOBALS['THRIFT_ROOT'].'/type/TMessageType.php' );
+require_once( $GLOBALS['THRIFT_ROOT'].'/type/TType.php' );
+require_once( $GLOBALS['THRIFT_ROOT'].'/exception/TException.php' );
+require_once( $GLOBALS['THRIFT_ROOT'].'/factory/TStringFuncFactory.php' );
+require_once( $GLOBALS['THRIFT_ROOT'].'/stringfunc/TStringFunc.php' );
+require_once( $GLOBALS['THRIFT_ROOT'].'/stringfunc/Core.php' );
+require_once( $GLOBALS['THRIFT_ROOT'].'/transport/TSocket.php' );
+require_once( $GLOBALS['THRIFT_ROOT'].'/transport/TBufferedTransport.php' );
+require_once( $GLOBALS['THRIFT_ROOT'].'/protocol/TBinaryProtocol.php' );
+
+# According to the thrift documentation, compiled PHP thrift libraries should
+# reside under the THRIFT_ROOT/packages directory. Copy them there from gen-php/.
+if (mkdir($GLOBALS['THRIFT_ROOT'].'/packages/Hbase', 0770, true)) {
+  $files = scandir('gen-php/Hbase');
+  foreach ($files as $file) {
+    if (preg_match("/.*php$/", $file)) {
+      copy("./gen-php/Hbase/$file", $GLOBALS['THRIFT_ROOT']."/packages/Hbase/$file"); 
+    }
+  }
+}
+
+require_once( $GLOBALS['THRIFT_ROOT'].'/packages/Hbase/Hbase.php' );
+require_once( $GLOBALS['THRIFT_ROOT'].'/packages/Hbase/Types.php' );
+
+use Thrift\Transport\TSocket;
+use Thrift\Transport\TBufferedTransport;
+use Thrift\Protocol\TBinaryProtocol;
+use Hbase\HbaseClient;
+use Hbase\ColumnDescriptor;
+use Hbase\Mutation;
+ 
+ 
+function printRow( $rowresult ) {
+  echo( "row: {$rowresult->row}, cols: \n" );
+  $values = $rowresult->columns;
+  asort( $values );
+  foreach ( $values as $k=>$v ) {
+    echo( "  {$k} => {$v->value}\n" );
+  }
+}
+
+$socket = new TSocket( 'localhost', 9090 );
+$socket->setSendTimeout( 10000 ); // Ten seconds (too long for production, but this is
just a demo ;)
+$socket->setRecvTimeout( 20000 ); // Twenty seconds
+$transport = new TBufferedTransport( $socket );
+$protocol = new TBinaryProtocol( $transport );
+$client = new HbaseClient( $protocol );
+
+$transport->open();
+
+$t = 'demo_table';
+
+?><html>
+<head>
+<title>DemoClient</title>
+</head>
+<body>
+<pre>
+<?php
+
+#
+# Scan all tables, look for the demo table and delete it.
+#
+echo( "scanning tables...\n" );
+$tables = $client->getTableNames();
+sort( $tables );
+foreach ( $tables as $name ) {
+  echo( "  found: {$name}\n" );
+  if ( $name == $t ) {
+    if ($client->isTableEnabled( $name )) {
+      echo( "    disabling table: {$name}\n");
+      $client->disableTable( $name );
+    }
+    echo( "    deleting table: {$name}\n" );
+    $client->deleteTable( $name );
+  }
+}
+
+#
+# Create the demo table with two column families, entry: and unused:
+#
+$columns = array(
+  new ColumnDescriptor( array(
+    'name' => 'entry:',
+    'maxVersions' => 10
+  ) ),
+  new ColumnDescriptor( array(
+    'name' => 'unused:'
+  ) )
+);
+
+echo( "creating table: {$t}\n" );
+try {
+  $client->createTable( $t, $columns );
+} catch ( AlreadyExists $ae ) {
+  echo( "WARN: {$ae->message}\n" );
+}
+
+echo( "column families in {$t}:\n" );
+$descriptors = $client->getColumnDescriptors( $t );
+asort( $descriptors );
+foreach ( $descriptors as $col ) {
+  echo( "  column: {$col->name}, maxVer: {$col->maxVersions}\n" );
+}
+$dummy_attributes = array();
+#
+# Test UTF-8 handling
+#
+$invalid = "foo-\xfc\xa1\xa1\xa1\xa1\xa1";
+$valid = "foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB";
+
+# non-utf8 is fine for data
+$mutations = array(
+  new Mutation( array(
+    'column' => 'entry:foo',
+    'value' => $invalid
+  ) ),
+);
+$client->mutateRow( $t, "foo", $mutations, $dummy_attributes );
+
+# try empty strings
+$mutations = array(
+  new Mutation( array(
+    'column' => 'entry:',
+    'value' => ""
+  ) ),
+);
+$client->mutateRow( $t, "", $mutations, $dummy_attributes );
+
+# this row name is valid utf8
+$mutations = array(
+  new Mutation( array(
+    'column' => 'entry:foo',
+    'value' => $valid
+  ) ),
+);
+$client->mutateRow( $t, $valid, $mutations, $dummy_attributes );
+
+# non-utf8 is not allowed in row names
+try {
+  $mutations = array(
+    new Mutation( array(
+      'column' => 'entry:foo',
+      'value' => $invalid
+    ) ),
+  );
+  $client->mutateRow( $t, $invalid, $mutations, $dummy_attributes );
+  throw new Exception( "shouldn't get here!" );
+} catch ( IOError $e ) {
+  echo( "expected error: {$e->message}\n" );
+}
+
+# Run a scanner on the rows we just created
+echo( "Starting scanner...\n" );
+$scanner = $client->scannerOpen( $t, "", array( "entry:" ), $dummy_attributes );
+try {
+  while (true) printRow( $client->scannerGet( $scanner ) );
+} catch ( NotFound $nf ) {
+  $client->scannerClose( $scanner );
+  echo( "Scanner finished\n" );
+}
+
+#
+# Run some operations on a bunch of rows.
+#
+for ($e=100; $e>=0; $e--) {
+
+  # format row keys as "00000" to "00100"
+  $row = str_pad( $e, 5, '0', STR_PAD_LEFT );
+
+  $mutations = array(
+    new Mutation( array(
+      'column' => 'unused:',
+      'value' => "DELETE_ME"
+    ) ),
+  );
+  $client->mutateRow( $t, $row, $mutations, $dummy_attributes );
+  printRow( $client->getRow( $t, $row, $dummy_attributes ));
+  $client->deleteAllRow( $t, $row, $dummy_attributes );
+
+  $mutations = array(
+    new Mutation( array(
+      'column' => 'entry:num',
+      'value' => "0"
+    ) ),
+    new Mutation( array(
+      'column' => 'entry:foo',
+      'value' => "FOO"
+    ) ),
+  );
+  $client->mutateRow( $t, $row, $mutations, $dummy_attributes );
+  printRow( $client->getRow( $t, $row, $dummy_attributes ));
+
+  $mutations = array(
+    new Mutation( array(
+      'column' => 'entry:foo',
+      'isDelete' => 1
+    ) ),
+    new Mutation( array(
+      'column' => 'entry:num',
+      'value' => '-1'
+    ) ),
+  );
+  $client->mutateRow( $t, $row, $mutations, $dummy_attributes );
+  printRow( $client->getRow( $t, $row, $dummy_attributes ) );
+
+  $mutations = array(
+    new Mutation( array(
+      'column' => "entry:num",
+      'value' => $e
+    ) ),
+    new Mutation( array(
+      'column' => "entry:sqr",
+      'value' => $e * $e
+    ) ),
+  );
+  $client->mutateRow( $t, $row, $mutations, $dummy_attributes );
+  printRow( $client->getRow( $t, $row, $dummy_attributes ));
+  
+  $mutations = array(
+    new Mutation( array(
+      'column' => 'entry:num',
+      'value' => '-999'
+    ) ),
+    new Mutation( array(
+      'column' => 'entry:sqr',
+      'isDelete' => 1
+    ) ),
+  );
+  $client->mutateRowTs( $t, $row, $mutations, 1, $dummy_attributes ); # shouldn't override
latest
+  printRow( $client->getRow( $t, $row, $dummy_attributes ) );
+
+  $versions = $client->getVer( $t, $row, "entry:num", 10, $dummy_attributes );
+  echo( "row: {$row}, values: \n" );
+  foreach ( $versions as $v ) echo( "  {$v->value};\n" );
+  
+  try {
+    $client->get( $t, $row, "entry:foo", $dummy_attributes );
+    throw new Exception ( "shouldn't get here! " );
+  } catch ( NotFound $nf ) {
+    # blank
+  }
+
+}
+
+$columns = array();
+foreach ( $client->getColumnDescriptors($t) as $col=>$desc ) {
+  echo("column with name: {$desc->name}\n");
+  $columns[] = $desc->name.":";
+}
+
+echo( "Starting scanner...\n" );
+$scanner = $client->scannerOpenWithStop( $t, "00020", "00040", $columns, $dummy_attributes
);
+try {
+  while (true) printRow( $client->scannerGet( $scanner ) );
+} catch ( NotFound $nf ) {
+  $client->scannerClose( $scanner );
+  echo( "Scanner finished\n" );
+}
+  
+$transport->close();
+
+?>
+</pre>
+</body>
+</html>
+



Mime
View raw message