[Groonga-commit] groonga/grnxx at ef6cad9 [master] Rename RowSet to RecordSet.

Back to archive index

susumu.yata null+****@clear*****
Thu Jun 12 16:26:58 JST 2014


susumu.yata	2014-06-12 16:26:58 +0900 (Thu, 12 Jun 2014)

  New Revision: ef6cad99c4fee31f6f15447edb4931db41da8fe1
  https://github.com/groonga/grnxx/commit/ef6cad99c4fee31f6f15447edb4931db41da8fe1

  Message:
    Rename RowSet to RecordSet.

  Modified files:
    new-interface/cursor.hpp
    new-interface/expression.hpp
    new-interface/group-set.hpp
    new-interface/merger.hpp
    new-interface/sorter.hpp
    new-interface/table.hpp
    new-interface/types.hpp
  Renamed files:
    new-interface/record-set.hpp
      (from new-interface/row-set.hpp)

  Modified: new-interface/cursor.hpp (+2 -2)
===================================================================
--- new-interface/cursor.hpp    2014-06-12 16:09:01 +0900 (fed7bb0)
+++ new-interface/cursor.hpp    2014-06-12 16:26:58 +0900 (e00cd72)
@@ -21,10 +21,10 @@ class Cursor {
   // 成功すれば移動量を返す.
   // 失敗したときは *error にその内容を格納し, -1 を返す.
   //
-  // カーソルの移動中に取得した行は *row_set の末尾に追加する.
+  // カーソルの移動中に取得した行は *record_set の末尾に追加する.
   //
   // 途中で終端に到達したときは count より小さい値を返す.
-  virtual int64_t read(Error *error, int64_t count, RowSet *row_set) = 0;
+  virtual int64_t read(Error *error, int64_t count, RecordSet *record_set) = 0;
 };
 
 }  // namespace grnxx

  Modified: new-interface/expression.hpp (+4 -4)
===================================================================
--- new-interface/expression.hpp    2014-06-12 16:09:01 +0900 (485cdbf)
+++ new-interface/expression.hpp    2014-06-12 16:26:58 +0900 (c5e7b59)
@@ -37,14 +37,14 @@ class Expression {
   //  - NaN が発生する.
   //   - TODO: これらの取り扱いについては検討の余地がある.
   virtual int64_t filter(Error *error,
-                         RowSet *row_set,
+                         RecordSet *record_set,
                          int64_t offset) = 0;
 
   // スコアを調整する.
   // 成功すれば true を返す.
   // 失敗したときは *error にその内容を格納し, false を返す.
   //
-  // 評価結果を *row_set に格納する.
+  // 評価結果を *record_set に格納する.
   // 式の構築において _score を指定することにより,
   // 既存のスコアを入力として使うこともできる.
   //
@@ -60,7 +60,7 @@ class Expression {
   //  - NaN が発生する.
   //   - TODO: これらの取り扱いについては検討の余地がある.
   virtual bool adjust(Error *error,
-                      RowSet *row_set,
+                      RecordSet *record_set,
                       int64_t offset) = 0;
 
   // 行の一覧に対する評価結果を取得する.
@@ -75,7 +75,7 @@ class Expression {
   //   - TODO: これらの取り扱いについては検討の余地がある.
   // - リソースが確保できない.
   virtual bool evaluate(Error *error,
-                        const RowSet &row_set,
+                        const RecordSet &record_set,
                         int64_t offset,
                         int64_t limit,
                         Data *values) = 0;

  Modified: new-interface/group-set.hpp (+1 -1)
===================================================================
--- new-interface/group-set.hpp    2014-06-12 16:09:01 +0900 (33acae2)
+++ new-interface/group-set.hpp    2014-06-12 16:26:58 +0900 (c26bfb5)
@@ -18,7 +18,7 @@ class GroupSet {
   // 行数を取得する.
   int64_t get_num_rows(int64_t i) const;
   // 保存してある行の一覧を取得する.
-  RowSet *get_row_set(int64_t i) const;
+  RecordSet *get_record_set(int64_t i) const;
 
   // 整列する.
   // 成功すれば true を返す.

  Modified: new-interface/merger.hpp (+6 -6)
===================================================================
--- new-interface/merger.hpp    2014-06-12 16:09:01 +0900 (66f2fe8)
+++ new-interface/merger.hpp    2014-06-12 16:26:58 +0900 (92fb896)
@@ -25,9 +25,9 @@ class Merger {
   // 入力がまだ残っているときは MERGE_CONTINUE,
   // 入力がもう残っていないときは MERGE_FINISH を指定する.
   //
-  // lhs_row_set, rhs_row_set を入力として,
-  // 合成した結果を result_row_set に出力する.
-  // 合成に使用された行は lhs_row_set, rhs_row_set から取り除かれる.
+  // lhs_record_set, rhs_record_set を入力として,
+  // 合成した結果を result_record_set に出力する.
+  // 合成に使用された行は lhs_record_set, rhs_record_set から取り除かれる.
   // そのため,空になった方の入力に行を補充することで合成を継続できる.
   //
   // 入力は行 ID 昇順もしくは降順になっているものとする.
@@ -37,9 +37,9 @@ class Merger {
   // - スコアが合成によって不正な値になる.
   // - リソースが確保できない.
   virtual int64_t merge(Error *error,
-                        RowSet *lhs_row_set,
-                        RowSet *rhs_row_set,
-                        RowSet *result_row_set,
+                        RecordSet *lhs_record_set,
+                        RecordSet *rhs_record_set,
+                        RecordSet *result_record_set,
                         MergeStatus status) const = 0;
 };
 

  Renamed: new-interface/record-set.hpp (+15 -13) 74%
===================================================================
--- new-interface/row-set.hpp    2014-06-12 16:09:01 +0900 (02d64c9)
+++ new-interface/record-set.hpp    2014-06-12 16:26:58 +0900 (1eb4eba)
@@ -1,24 +1,26 @@
-#ifndef GRNXX_ROW_SET_HPP
-#define GRNXX_ROW_SET_HPP
+#ifndef GRNXX_RECORD_SET_HPP
+#define GRNXX_RECORD_SET_HPP
 
 #include "grnxx/types.hpp"
 
 namespace grnxx {
 
-class RowSet {
+class RecordSet {
  public:
-  RowSet();
-  ~RowSet();
+  RecordSet();
+  ~RecordSet();
 
   // 所属するテーブルを取得する.
   Table *table() const;
-  // 行数を取得する.
-  int64_t num_rows() const;
+  // レコード ID の最小値を取得する.
+  RecordID min_record_id() const;
+  // レコード ID の最大値を取得する.
+  RecordID max_record_id() const;
 
   // 行 ID を取得する.
-  RowID get_row_id(int64_t i) const;
+  RowID get_row_id(RecordID record_id) const;
   // スコアを取得する.
-  double get_score(int64_t i) const;
+  double get_score(RecordID record_id) const;
 
   // スコアを正規化する.
   // 成功すれば true を返す.
@@ -30,10 +32,10 @@ class RowSet {
   //       ほかにも何か必要な正規化があるかどうか.
   //
   // 失敗する状況としては,以下のようなものが挙げられる.
-  // - 最大値が 0.0, negative, infinity である.
+  // - 最大値が 0.0, negative, infinity のいずれかである.
   bool normalize(Error *error, const NormalizeOptions &options);
 
-  // TODO: Sorter を使うより RowSet::sort() の方が良い?
+  // TODO: Sorter を使うより RecordSet::sort() の方が良い?
 
   // 整列する.
   // 成功すれば true を返す.
@@ -46,7 +48,7 @@ class RowSet {
   // - 演算において例外が発生する.
   bool sort(Error *error, const SortConditions &conditions);
 
-  // TODO: Grouper を使うより RowSet::group() の方が良い?
+  // TODO: Grouper を使うより RecordSet::group() の方が良い?
 
   // グループ化する.
   // 成功すれば true を返す.
@@ -63,4 +65,4 @@ class RowSet {
 
 }  // namespace grnxx
 
-#endif  // GRNXX_ROW_SET_HPP
+#endif  // GRNXX_RECORD_SET_HPP

  Modified: new-interface/sorter.hpp (+1 -1)
===================================================================
--- new-interface/sorter.hpp    2014-06-12 16:09:01 +0900 (5356c53)
+++ new-interface/sorter.hpp    2014-06-12 16:26:58 +0900 (d499555)
@@ -24,7 +24,7 @@ class Sorter {
   // - 演算において例外が発生する.
   // - リソースを確保できない.
   virtual bool sort(Error *error,
-                    RowSet *row_set,
+                    RecordSet *record_set,
                     int64_t offset,
                     int64_t limit);
 };

  Modified: new-interface/table.hpp (+3 -3)
===================================================================
--- new-interface/table.hpp    2014-06-12 16:09:01 +0900 (b0cb6ce)
+++ new-interface/table.hpp    2014-06-12 16:26:58 +0900 (1678498)
@@ -343,9 +343,9 @@ class Table {
   // - オプションが不正である.
   // - リソースが確保できない.
   virtual bool merge(Error *error,
-                     RowSet *lhs,
-                     RowSet *rhs,
-                     RowSet *output,
+                     RecordSet *lhs_record_set,
+                     RecordSet *rhs_record_set,
+                     RecordSet *result_record_set,
                      const MergerOptions &options);
 
  protected:

  Modified: new-interface/types.hpp (+1 -0)
===================================================================
--- new-interface/types.hpp    2014-06-12 16:09:01 +0900 (9ff7ce1)
+++ new-interface/types.hpp    2014-06-12 16:26:58 +0900 (438a81a)
@@ -31,6 +31,7 @@ using TableID  = int64_t;
 using ColumnID = int64_t;
 using IndexID  = int64_t;
 using RowID    = int64_t;
+using RecordID = int64_t;
 
 constexpr RowID NULL_ROW_ID = RowID(0);
 constexpr RowID MIN_ROW_ID  = RowID(1);
-------------- next part --------------
HTML����������������������������...
下载 



More information about the Groonga-commit mailing list
Back to archive index