incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [8/11] Changes to the api to the schema objects, still broken.
Date Thu, 10 Jan 2013 19:49:57 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b5ea6935/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm b/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm
index a8416e8..8caf64b 100644
--- a/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm
+++ b/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm
@@ -424,29 +424,37 @@ sub write {
   return $xfer;
 }
 
-package Blur::LiveSchema;
+package Blur::FieldSchema;
 use base qw(Class::Accessor);
-Blur::LiveSchema->mk_accessors( qw( table columnFamilies ) );
+Blur::FieldSchema->mk_accessors( qw( name type numberOfTermsEstimate shardExistence )
);
 
 sub new {
   my $classname = shift;
   my $self      = {};
   my $vals      = shift || {};
-  $self->{table} = undef;
-  $self->{columnFamilies} = undef;
+  $self->{name} = undef;
+  $self->{type} = undef;
+  $self->{numberOfTermsEstimate} = undef;
+  $self->{shardExistence} = undef;
   if (UNIVERSAL::isa($vals,'HASH')) {
-    if (defined $vals->{table}) {
-      $self->{table} = $vals->{table};
+    if (defined $vals->{name}) {
+      $self->{name} = $vals->{name};
     }
-    if (defined $vals->{columnFamilies}) {
-      $self->{columnFamilies} = $vals->{columnFamilies};
+    if (defined $vals->{type}) {
+      $self->{type} = $vals->{type};
+    }
+    if (defined $vals->{numberOfTermsEstimate}) {
+      $self->{numberOfTermsEstimate} = $vals->{numberOfTermsEstimate};
+    }
+    if (defined $vals->{shardExistence}) {
+      $self->{shardExistence} = $vals->{shardExistence};
     }
   }
   return bless ($self, $classname);
 }
 
 sub getName {
-  return 'LiveSchema';
+  return 'FieldSchema';
 }
 
 sub read {
@@ -465,39 +473,116 @@ sub read {
     SWITCH: for($fid)
     {
       /^1$/ && do{      if ($ftype == TType::STRING) {
-        $xfer += $input->readString(\$self->{table});
+        $xfer += $input->readString(\$self->{name});
       } else {
         $xfer += $input->skip($ftype);
       }
       last; };
-      /^2$/ && do{      if ($ftype == TType::MAP) {
+      /^2$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{type});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::I64) {
+        $xfer += $input->readI64(\$self->{numberOfTermsEstimate});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{shardExistence});
+      } 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('FieldSchema');
+  if (defined $self->{name}) {
+    $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
+    $xfer += $output->writeString($self->{name});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{type}) {
+    $xfer += $output->writeFieldBegin('type', TType::I32, 2);
+    $xfer += $output->writeI32($self->{type});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{numberOfTermsEstimate}) {
+    $xfer += $output->writeFieldBegin('numberOfTermsEstimate', TType::I64, 3);
+    $xfer += $output->writeI64($self->{numberOfTermsEstimate});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{shardExistence}) {
+    $xfer += $output->writeFieldBegin('shardExistence', TType::I32, 4);
+    $xfer += $output->writeI32($self->{shardExistence});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::TableSchema;
+use base qw(Class::Accessor);
+Blur::TableSchema->mk_accessors( qw( fields ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{fields} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{fields}) {
+      $self->{fields} = $vals->{fields};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'TableSchema';
+}
+
+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::LIST) {
         {
           my $_size9 = 0;
-          $self->{columnFamilies} = {};
-          my $_ktype10 = 0;
-          my $_vtype11 = 0;
-          $xfer += $input->readMapBegin(\$_ktype10, \$_vtype11, \$_size9);
+          $self->{fields} = [];
+          my $_etype12 = 0;
+          $xfer += $input->readListBegin(\$_etype12, \$_size9);
           for (my $_i13 = 0; $_i13 < $_size9; ++$_i13)
           {
-            my $key14 = '';
-            my $val15 = [];
-            $xfer += $input->readString(\$key14);
-            {
-              my $_size16 = 0;
-              $val15 = {};
-              my $_etype19 = 0;
-              $xfer += $input->readSetBegin(\$_etype19, \$_size16);
-              for (my $_i20 = 0; $_i20 < $_size16; ++$_i20)
-              {
-                my $elem21 = undef;
-                $xfer += $input->readString(\$elem21);
-                $val15->{$elem21} = 1;
-              }
-              $xfer += $input->readSetEnd();
-            }
-            $self->{columnFamilies}->{$key14} = $val15;
+            my $elem14 = undef;
+            $elem14 = new Blur::FieldSchema();
+            $xfer += $elem14->read($input);
+            push(@{$self->{fields}},$elem14);
           }
-          $xfer += $input->readMapEnd();
+          $xfer += $input->readListEnd();
         }
       } else {
         $xfer += $input->skip($ftype);
@@ -514,33 +599,18 @@ sub read {
 sub write {
   my ($self, $output) = @_;
   my $xfer   = 0;
-  $xfer += $output->writeStructBegin('LiveSchema');
-  if (defined $self->{table}) {
-    $xfer += $output->writeFieldBegin('table', TType::STRING, 1);
-    $xfer += $output->writeString($self->{table});
-    $xfer += $output->writeFieldEnd();
-  }
-  if (defined $self->{columnFamilies}) {
-    $xfer += $output->writeFieldBegin('columnFamilies', TType::MAP, 2);
+  $xfer += $output->writeStructBegin('TableSchema');
+  if (defined $self->{fields}) {
+    $xfer += $output->writeFieldBegin('fields', TType::LIST, 1);
     {
-      $xfer += $output->writeMapBegin(TType::STRING, TType::SET, scalar(keys %{$self->{columnFamilies}}));
+      $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{fields}}));
       {
-        while( my ($kiter22,$viter23) = each %{$self->{columnFamilies}}) 
+        foreach my $iter15 (@{$self->{fields}}) 
         {
-          $xfer += $output->writeString($kiter22);
-          {
-            $xfer += $output->writeSetBegin(TType::STRING, scalar(@{${viter23}}));
-            {
-              foreach my $iter24 (@{${viter23}})
-              {
-                $xfer += $output->writeString($iter24);
-              }
-            }
-            $xfer += $output->writeSetEnd();
-          }
+          $xfer += ${iter15}->write($output);
         }
       }
-      $xfer += $output->writeMapEnd();
+      $xfer += $output->writeListEnd();
     }
     $xfer += $output->writeFieldEnd();
   }
@@ -597,18 +667,18 @@ sub read {
       last; };
       /^2$/ && do{      if ($ftype == TType::MAP) {
         {
-          my $_size25 = 0;
+          my $_size16 = 0;
           $self->{arguments} = {};
-          my $_ktype26 = 0;
-          my $_vtype27 = 0;
-          $xfer += $input->readMapBegin(\$_ktype26, \$_vtype27, \$_size25);
-          for (my $_i29 = 0; $_i29 < $_size25; ++$_i29)
+          my $_ktype17 = 0;
+          my $_vtype18 = 0;
+          $xfer += $input->readMapBegin(\$_ktype17, \$_vtype18, \$_size16);
+          for (my $_i20 = 0; $_i20 < $_size16; ++$_i20)
           {
-            my $key30 = '';
-            my $val31 = '';
-            $xfer += $input->readString(\$key30);
-            $xfer += $input->readString(\$val31);
-            $self->{arguments}->{$key30} = $val31;
+            my $key21 = '';
+            my $val22 = '';
+            $xfer += $input->readString(\$key21);
+            $xfer += $input->readString(\$val22);
+            $self->{arguments}->{$key21} = $val22;
           }
           $xfer += $input->readMapEnd();
         }
@@ -638,10 +708,10 @@ sub write {
     {
       $xfer += $output->writeMapBegin(TType::STRING, TType::STRING, scalar(keys %{$self->{arguments}}));
       {
-        while( my ($kiter32,$viter33) = each %{$self->{arguments}}) 
+        while( my ($kiter23,$viter24) = each %{$self->{arguments}}) 
         {
-          $xfer += $output->writeString($kiter32);
-          $xfer += $output->writeString($viter33);
+          $xfer += $output->writeString($kiter23);
+          $xfer += $output->writeString($viter24);
         }
       }
       $xfer += $output->writeMapEnd();
@@ -792,16 +862,16 @@ sub read {
       last; };
       /^3$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size34 = 0;
+          my $_size25 = 0;
           $self->{analyzerSubTypes} = [];
-          my $_etype37 = 0;
-          $xfer += $input->readListBegin(\$_etype37, \$_size34);
-          for (my $_i38 = 0; $_i38 < $_size34; ++$_i38)
+          my $_etype28 = 0;
+          $xfer += $input->readListBegin(\$_etype28, \$_size25);
+          for (my $_i29 = 0; $_i29 < $_size25; ++$_i29)
           {
-            my $elem39 = undef;
-            $elem39 = new Blur::AnalyzerSubType();
-            $xfer += $elem39->read($input);
-            push(@{$self->{analyzerSubTypes}},$elem39);
+            my $elem30 = undef;
+            $elem30 = new Blur::AnalyzerSubType();
+            $xfer += $elem30->read($input);
+            push(@{$self->{analyzerSubTypes}},$elem30);
           }
           $xfer += $input->readListEnd();
         }
@@ -836,9 +906,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{analyzerSubTypes}}));
       {
-        foreach my $iter40 (@{$self->{analyzerSubTypes}}) 
+        foreach my $iter31 (@{$self->{analyzerSubTypes}}) 
         {
-          $xfer += ${iter40}->write($output);
+          $xfer += ${iter31}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -888,16 +958,16 @@ sub read {
     {
       /^1$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size41 = 0;
+          my $_size32 = 0;
           $self->{analyzerTypes} = [];
-          my $_etype44 = 0;
-          $xfer += $input->readListBegin(\$_etype44, \$_size41);
-          for (my $_i45 = 0; $_i45 < $_size41; ++$_i45)
+          my $_etype35 = 0;
+          $xfer += $input->readListBegin(\$_etype35, \$_size32);
+          for (my $_i36 = 0; $_i36 < $_size32; ++$_i36)
           {
-            my $elem46 = undef;
-            $elem46 = new Blur::AnalyzerType();
-            $xfer += $elem46->read($input);
-            push(@{$self->{analyzerTypes}},$elem46);
+            my $elem37 = undef;
+            $elem37 = new Blur::AnalyzerType();
+            $xfer += $elem37->read($input);
+            push(@{$self->{analyzerTypes}},$elem37);
           }
           $xfer += $input->readListEnd();
         }
@@ -922,9 +992,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{analyzerTypes}}));
       {
-        foreach my $iter47 (@{$self->{analyzerTypes}}) 
+        foreach my $iter38 (@{$self->{analyzerTypes}}) 
         {
-          $xfer += ${iter47}->write($output);
+          $xfer += ${iter38}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1045,18 +1115,18 @@ sub read {
       last; };
       /^8$/ && do{      if ($ftype == TType::MAP) {
         {
-          my $_size48 = 0;
+          my $_size39 = 0;
           $self->{properties} = {};
-          my $_ktype49 = 0;
-          my $_vtype50 = 0;
-          $xfer += $input->readMapBegin(\$_ktype49, \$_vtype50, \$_size48);
-          for (my $_i52 = 0; $_i52 < $_size48; ++$_i52)
+          my $_ktype40 = 0;
+          my $_vtype41 = 0;
+          $xfer += $input->readMapBegin(\$_ktype40, \$_vtype41, \$_size39);
+          for (my $_i43 = 0; $_i43 < $_size39; ++$_i43)
           {
-            my $key53 = '';
-            my $val54 = '';
-            $xfer += $input->readString(\$key53);
-            $xfer += $input->readString(\$val54);
-            $self->{properties}->{$key53} = $val54;
+            my $key44 = '';
+            my $val45 = '';
+            $xfer += $input->readString(\$key44);
+            $xfer += $input->readString(\$val45);
+            $self->{properties}->{$key44} = $val45;
           }
           $xfer += $input->readMapEnd();
         }
@@ -1116,10 +1186,10 @@ sub write {
     {
       $xfer += $output->writeMapBegin(TType::STRING, TType::STRING, scalar(keys %{$self->{properties}}));
       {
-        while( my ($kiter55,$viter56) = each %{$self->{properties}}) 
+        while( my ($kiter46,$viter47) = each %{$self->{properties}}) 
         {
-          $xfer += $output->writeString($kiter55);
-          $xfer += $output->writeString($viter56);
+          $xfer += $output->writeString($kiter46);
+          $xfer += $output->writeString($viter47);
         }
       }
       $xfer += $output->writeMapEnd();
@@ -1342,16 +1412,16 @@ sub read {
     {
       /^1$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size57 = 0;
+          my $_size48 = 0;
           $self->{fields} = [];
-          my $_etype60 = 0;
-          $xfer += $input->readListBegin(\$_etype60, \$_size57);
-          for (my $_i61 = 0; $_i61 < $_size57; ++$_i61)
+          my $_etype51 = 0;
+          $xfer += $input->readListBegin(\$_etype51, \$_size48);
+          for (my $_i52 = 0; $_i52 < $_size48; ++$_i52)
           {
-            my $elem62 = undef;
-            $elem62 = new Blur::SortField();
-            $xfer += $elem62->read($input);
-            push(@{$self->{fields}},$elem62);
+            my $elem53 = undef;
+            $elem53 = new Blur::SortField();
+            $xfer += $elem53->read($input);
+            push(@{$self->{fields}},$elem53);
           }
           $xfer += $input->readListEnd();
         }
@@ -1376,9 +1446,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{fields}}));
       {
-        foreach my $iter63 (@{$self->{fields}}) 
+        foreach my $iter54 (@{$self->{fields}}) 
         {
-          $xfer += ${iter63}->write($output);
+          $xfer += ${iter54}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1448,15 +1518,15 @@ sub read {
       last; };
       /^4$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size64 = 0;
+          my $_size55 = 0;
           $self->{fields} = [];
-          my $_etype67 = 0;
-          $xfer += $input->readListBegin(\$_etype67, \$_size64);
-          for (my $_i68 = 0; $_i68 < $_size64; ++$_i68)
+          my $_etype58 = 0;
+          $xfer += $input->readListBegin(\$_etype58, \$_size55);
+          for (my $_i59 = 0; $_i59 < $_size55; ++$_i59)
           {
-            my $elem69 = undef;
-            $xfer += $input->readString(\$elem69);
-            push(@{$self->{fields}},$elem69);
+            my $elem60 = undef;
+            $xfer += $input->readString(\$elem60);
+            push(@{$self->{fields}},$elem60);
           }
           $xfer += $input->readListEnd();
         }
@@ -1491,9 +1561,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRING, scalar(@{$self->{fields}}));
       {
-        foreach my $iter70 (@{$self->{fields}}) 
+        foreach my $iter61 (@{$self->{fields}}) 
         {
-          $xfer += $output->writeString($iter70);
+          $xfer += $output->writeString($iter61);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1730,15 +1800,15 @@ sub read {
       last; };
       /^10$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size71 = 0;
+          my $_size62 = 0;
           $self->{shardIndexes} = [];
-          my $_etype74 = 0;
-          $xfer += $input->readListBegin(\$_etype74, \$_size71);
-          for (my $_i75 = 0; $_i75 < $_size71; ++$_i75)
+          my $_etype65 = 0;
+          $xfer += $input->readListBegin(\$_etype65, \$_size62);
+          for (my $_i66 = 0; $_i66 < $_size62; ++$_i66)
           {
-            my $elem76 = undef;
-            $xfer += $input->readI32(\$elem76);
-            push(@{$self->{shardIndexes}},$elem76);
+            my $elem67 = undef;
+            $xfer += $input->readI32(\$elem67);
+            push(@{$self->{shardIndexes}},$elem67);
           }
           $xfer += $input->readListEnd();
         }
@@ -1808,9 +1878,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::I32, scalar(@{$self->{shardIndexes}}));
       {
-        foreach my $iter77 (@{$self->{shardIndexes}}) 
+        foreach my $iter68 (@{$self->{shardIndexes}}) 
         {
-          $xfer += $output->writeI32($iter77);
+          $xfer += $output->writeI32($iter68);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1888,16 +1958,16 @@ sub read {
       last; };
       /^3$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size78 = 0;
+          my $_size69 = 0;
           $self->{scoreDocs} = [];
-          my $_etype81 = 0;
-          $xfer += $input->readListBegin(\$_etype81, \$_size78);
-          for (my $_i82 = 0; $_i82 < $_size78; ++$_i82)
+          my $_etype72 = 0;
+          $xfer += $input->readListBegin(\$_etype72, \$_size69);
+          for (my $_i73 = 0; $_i73 < $_size69; ++$_i73)
           {
-            my $elem83 = undef;
-            $elem83 = new Blur::ScoreDoc();
-            $xfer += $elem83->read($input);
-            push(@{$self->{scoreDocs}},$elem83);
+            my $elem74 = undef;
+            $elem74 = new Blur::ScoreDoc();
+            $xfer += $elem74->read($input);
+            push(@{$self->{scoreDocs}},$elem74);
           }
           $xfer += $input->readListEnd();
         }
@@ -1913,16 +1983,16 @@ sub read {
       last; };
       /^5$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size84 = 0;
+          my $_size75 = 0;
           $self->{fields} = [];
-          my $_etype87 = 0;
-          $xfer += $input->readListBegin(\$_etype87, \$_size84);
-          for (my $_i88 = 0; $_i88 < $_size84; ++$_i88)
+          my $_etype78 = 0;
+          $xfer += $input->readListBegin(\$_etype78, \$_size75);
+          for (my $_i79 = 0; $_i79 < $_size75; ++$_i79)
           {
-            my $elem89 = undef;
-            $elem89 = new Blur::SortField();
-            $xfer += $elem89->read($input);
-            push(@{$self->{fields}},$elem89);
+            my $elem80 = undef;
+            $elem80 = new Blur::SortField();
+            $xfer += $elem80->read($input);
+            push(@{$self->{fields}},$elem80);
           }
           $xfer += $input->readListEnd();
         }
@@ -1957,9 +2027,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{scoreDocs}}));
       {
-        foreach my $iter90 (@{$self->{scoreDocs}}) 
+        foreach my $iter81 (@{$self->{scoreDocs}}) 
         {
-          $xfer += ${iter90}->write($output);
+          $xfer += ${iter81}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1976,9 +2046,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{fields}}));
       {
-        foreach my $iter91 (@{$self->{fields}}) 
+        foreach my $iter82 (@{$self->{fields}}) 
         {
-          $xfer += ${iter91}->write($output);
+          $xfer += ${iter82}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -2137,16 +2207,16 @@ sub read {
     {
       /^1$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size92 = 0;
+          my $_size83 = 0;
           $self->{fields} = [];
-          my $_etype95 = 0;
-          $xfer += $input->readListBegin(\$_etype95, \$_size92);
-          for (my $_i96 = 0; $_i96 < $_size92; ++$_i96)
+          my $_etype86 = 0;
+          $xfer += $input->readListBegin(\$_etype86, \$_size83);
+          for (my $_i87 = 0; $_i87 < $_size83; ++$_i87)
           {
-            my $elem97 = undef;
-            $elem97 = new Blur::Field();
-            $xfer += $elem97->read($input);
-            push(@{$self->{fields}},$elem97);
+            my $elem88 = undef;
+            $elem88 = new Blur::Field();
+            $xfer += $elem88->read($input);
+            push(@{$self->{fields}},$elem88);
           }
           $xfer += $input->readListEnd();
         }
@@ -2171,9 +2241,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{fields}}));
       {
-        foreach my $iter98 (@{$self->{fields}}) 
+        foreach my $iter89 (@{$self->{fields}}) 
         {
-          $xfer += ${iter98}->write($output);
+          $xfer += ${iter89}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -2422,16 +2492,16 @@ sub read {
       last; };
       /^2$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size99 = 0;
+          my $_size90 = 0;
           $self->{documents} = [];
-          my $_etype102 = 0;
-          $xfer += $input->readListBegin(\$_etype102, \$_size99);
-          for (my $_i103 = 0; $_i103 < $_size99; ++$_i103)
+          my $_etype93 = 0;
+          $xfer += $input->readListBegin(\$_etype93, \$_size90);
+          for (my $_i94 = 0; $_i94 < $_size90; ++$_i94)
           {
-            my $elem104 = undef;
-            $elem104 = new Blur::Document();
-            $xfer += $elem104->read($input);
-            push(@{$self->{documents}},$elem104);
+            my $elem95 = undef;
+            $elem95 = new Blur::Document();
+            $xfer += $elem95->read($input);
+            push(@{$self->{documents}},$elem95);
           }
           $xfer += $input->readListEnd();
         }
@@ -2461,9 +2531,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{documents}}));
       {
-        foreach my $iter105 (@{$self->{documents}}) 
+        foreach my $iter96 (@{$self->{documents}}) 
         {
-          $xfer += ${iter105}->write($output);
+          $xfer += ${iter96}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -2617,15 +2687,15 @@ sub read {
       last; };
       /^2$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size106 = 0;
+          my $_size97 = 0;
           $self->{shards} = [];
-          my $_etype109 = 0;
-          $xfer += $input->readListBegin(\$_etype109, \$_size106);
-          for (my $_i110 = 0; $_i110 < $_size106; ++$_i110)
+          my $_etype100 = 0;
+          $xfer += $input->readListBegin(\$_etype100, \$_size97);
+          for (my $_i101 = 0; $_i101 < $_size97; ++$_i101)
           {
-            my $elem111 = undef;
-            $xfer += $input->readI32(\$elem111);
-            push(@{$self->{shards}},$elem111);
+            my $elem102 = undef;
+            $xfer += $input->readI32(\$elem102);
+            push(@{$self->{shards}},$elem102);
           }
           $xfer += $input->readListEnd();
         }
@@ -2655,9 +2725,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::I32, scalar(@{$self->{shards}}));
       {
-        foreach my $iter112 (@{$self->{shards}}) 
+        foreach my $iter103 (@{$self->{shards}}) 
         {
-          $xfer += $output->writeI32($iter112);
+          $xfer += $output->writeI32($iter103);
         }
       }
       $xfer += $output->writeListEnd();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b5ea6935/src/distribution/src/main/scripts/interface/gen-rb/blur.rb
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur.rb
index f0a38e6..d9931b2 100644
--- a/src/distribution/src/main/scripts/interface/gen-rb/blur.rb
+++ b/src/distribution/src/main/scripts/interface/gen-rb/blur.rb
@@ -357,13 +357,13 @@ module Blur
         raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT,
'queryStatus failed: unknown result')
       end
 
-      def schema(table)
-        send_schema(table)
+      def schema(session, shardsIds)
+        send_schema(session, shardsIds)
         return recv_schema()
       end
 
-      def send_schema(table)
-        send_message('schema', Schema_args, :table => table)
+      def send_schema(session, shardsIds)
+        send_message('schema', Schema_args, :session => session, :shardsIds => shardsIds)
       end
 
       def recv_schema()
@@ -640,7 +640,7 @@ module Blur
         args = read_args(iprot, Schema_args)
         result = Schema_result.new()
         begin
-          result.success = @handler.schema(args.table)
+          result.success = @handler.schema(args.session, args.shardsIds)
         rescue ::Blur::BlurException => ex
           result.ex = ex
         end
@@ -1419,10 +1419,12 @@ module Blur
 
     class Schema_args
       include ::Thrift::Struct, ::Thrift::Struct_Union
-      TABLE = 1
+      SESSION = 1
+      SHARDSIDS = 2
 
       FIELDS = {
-        TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}
+        SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class
=> ::Blur::Session},
+        SHARDSIDS => {:type => ::Thrift::Types::LIST, :name => 'shardsIds', :element
=> {:type => ::Thrift::Types::I32}}
       }
 
       def struct_fields; FIELDS; end
@@ -1439,7 +1441,7 @@ module Blur
       EX = 1
 
       FIELDS = {
-        SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class
=> ::Blur::LiveSchema},
+        SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class
=> ::Blur::TableSchema},
         EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException}
       }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b5ea6935/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb
index af0d86e..100fab8 100644
--- a/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb
+++ b/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb
@@ -168,17 +168,45 @@ module Blur
     ::Thrift::Struct.generate_accessors self
   end
 
-  # 
-  class LiveSchema
+  # The field schema contains the name the type and some simple statistics about the field.
+  class FieldSchema
     include ::Thrift::Struct, ::Thrift::Struct_Union
-    TABLE = 1
-    COLUMNFAMILIES = 2
+    NAME = 1
+    TYPE = 2
+    NUMBEROFTERMSESTIMATE = 3
+    SHARDEXISTENCE = 4
 
     FIELDS = {
-      # 
-      TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'},
-      # 
-      COLUMNFAMILIES => {:type => ::Thrift::Types::MAP, :name => 'columnFamilies',
:key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::SET,
:element => {:type => ::Thrift::Types::STRING}}}
+      # The name of the field.
+      NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
+      # The type of the field.
+      TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class =>
::Blur::TYPE},
+      # This is an estimate of the number of terms present in the index.  This is a naive
+# estimate, it is a sum of all the terms in each of the segments in each of the shards.
+      NUMBEROFTERMSESTIMATE => {:type => ::Thrift::Types::I64, :name => 'numberOfTermsEstimate'},
+      # The number of shards in which this field exists.
+      SHARDEXISTENCE => {:type => ::Thrift::Types::I32, :name => 'shardExistence'}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
+      unless @type.nil? || ::Blur::TYPE::VALID_VALUES.include?(@type)
+        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid
value of field type!')
+      end
+    end
+
+    ::Thrift::Struct.generate_accessors self
+  end
+
+  # TableSchema contains field information that describes the a table.
+  class TableSchema
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    FIELDS = 1
+
+    FIELDS = {
+      # List of field information for a table.
+      FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element =>
{:type => ::Thrift::Types::STRUCT, :class => ::Blur::FieldSchema}}
     }
 
     def struct_fields; FIELDS; end


Mime
View raw message