[Groonga-commit] groonga/groonga [master] Modified output structure of check command.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 13日 (火) 18:51:09 JST


Daijiro MORI	2010-07-13 09:51:09 +0000 (Tue, 13 Jul 2010)

  New Revision: 9b29084b4b1e0ccb9662aac194236319ea4bde75

  Log:
    Modified output structure of check command.

  Modified files:
    lib/ii.c
    lib/proc.c

  Modified: lib/ii.c (+2 -1)
===================================================================
--- lib/ii.c    2010-07-13 00:40:09 +0000 (45b0151)
+++ lib/ii.c    2010-07-13 09:51:09 +0000 (5c31b0e)
@@ -2960,6 +2960,7 @@ grn_ii_buffer_check(grn_ctx *ctx, grn_ii *ii, uint32_t seg)
   if ((ii->header->flags & GRN_OBJ_WITH_POSITION)) {
     rdv[ii->n_elements - 1].flags = ODD;
   }
+  GRN_OUTPUT_MAP_OPEN("BUFFER", -1);
   GRN_OUTPUT_CSTR("buffer id");
   GRN_OUTPUT_INT64(seg);
   if ((scn = sb->header.chunk) == NOT_ASSIGNED) {
@@ -3052,9 +3053,9 @@ grn_ii_buffer_check(grn_ctx *ctx, grn_ii *ii, uint32_t seg)
     GRN_OUTPUT_CSTR("nterms with corrupt chunk");
     GRN_OUTPUT_INT64(nerrors);
   }
+  GRN_OUTPUT_MAP_CLOSE();
   datavec_fin(ctx, rdv);
   if (sc) { grn_io_win_unmap2(&sw); }
-
   buffer_close(ctx, ii, pseg);
 }
 

  Modified: lib/proc.c (+9 -7)
===================================================================
--- lib/proc.c    2010-07-13 00:40:09 +0000 (10276c5)
+++ lib/proc.c    2010-07-13 09:51:09 +0000 (b35cffa)
@@ -1854,12 +1854,7 @@ proc_check(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
         grn_ii *ii = (grn_ii *)obj;
         struct grn_ii_header *h = ii->header;
         char buf[8];
-        GRN_OUTPUT_MAP_OPEN("RESULT", 8);
-        GRN_OUTPUT_CSTR("flags");
-        grn_itoh(h->flags, buf, 8);
-        GRN_OUTPUT_STR(buf, 8);
-        GRN_OUTPUT_CSTR("max sid");
-        GRN_OUTPUT_INT64(h->smax);
+        GRN_OUTPUT_ARRAY_OPEN("RESULT", 8);
         {
           uint32_t i, j, g =0, a = 0, b = 0;
           uint32_t max = 0;
@@ -1882,6 +1877,12 @@ proc_check(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
               a++;
             }
           }
+          GRN_OUTPUT_MAP_OPEN("SUMMARY", 8);
+          GRN_OUTPUT_CSTR("flags");
+          grn_itoh(h->flags, buf, 8);
+          GRN_OUTPUT_STR(buf, 8);
+          GRN_OUTPUT_CSTR("max sid");
+          GRN_OUTPUT_INT64(h->smax);
           GRN_OUTPUT_CSTR("number of garbage segments");
           GRN_OUTPUT_INT64(g);
           GRN_OUTPUT_CSTR("number of array segments");
@@ -1914,11 +1915,12 @@ proc_check(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
             GRN_OUTPUT_INT64(h->ngarbages[i]);
           }
           GRN_OUTPUT_ARRAY_CLOSE();
+          GRN_OUTPUT_MAP_CLOSE();
           for (i = 0; i < GRN_II_MAX_LSEG; i++) {
             if (h->binfo[i] < 0x20000) { grn_ii_buffer_check(ctx, ii, i); }
           }
         }
-        GRN_OUTPUT_MAP_CLOSE();
+        GRN_OUTPUT_ARRAY_CLOSE();
       }
       break;
     }




Groonga-commit メーリングリストの案内
Back to archive index