Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
ii.c File Reference
#include "groonga_in.h"
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
#include "ii.h"
#include "ctx_impl.h"
#include "token.h"
#include "pat.h"
#include "db.h"
#include "output.h"
#include "util.h"
Include dependency graph for ii.c:

Go to the source code of this file.

Data Structures

struct  grn_ii_ginfo
struct  datavec
struct  buffer_term
struct  buffer_rec
struct  buffer_header
struct  grn_ii_buffer
struct  docid
struct  lexicon_deletable_arg
struct  docinfo
struct  chunk_info
struct  term_sort
struct  _grn_ii_cursor
struct  cursor_heap
struct  token_info
struct  _btr_node
struct  btr
struct  ii_buffer_counter
struct  ii_buffer_block
struct  _grn_ii_buffer

Macros

#define MAX_PSEG   0x20000
#define S_CHUNK   (1 << GRN_II_W_CHUNK)
#define W_SEGMENT   18
#define S_SEGMENT   (1 << W_SEGMENT)
#define N_CHUNKS_PER_FILE   (GRN_IO_FILE_SIZE >> W_SEGMENT)
#define W_ARRAY_ELEMENT   3
#define S_ARRAY_ELEMENT   (1 << W_ARRAY_ELEMENT)
#define W_ARRAY   (W_SEGMENT - W_ARRAY_ELEMENT)
#define ARRAY_MASK_IN_A_SEGMENT   ((1 << W_ARRAY) - 1)
#define NOT_ASSIGNED   0xffffffff
#define S_GARBAGE   (1<<12)
#define CHUNK_SPLIT   0x80000000
#define CHUNK_SPLIT_THRESHOLD   0x60000
#define MAX_N_ELEMENTS   5
#define LSEG(pos)   ((pos) >> 16)
#define LPOS(pos)   (((pos) & 0xffff) << 2)
#define SEG2POS(seg, pos)   ((((uint32_t)(seg)) << 16) + (((uint32_t)(pos)) >> 2))
#define NEXT_ADDR(p)   (((byte *)(p)) + sizeof(*(p)))
#define S_IRUSR   0400
#define S_IWUSR   0200
#define BGQENQUE(lseg)
#define HEADER_CHUNK_AT(ii, offset)   ((((ii)->header->chunks[((offset) >> 3)]) >> ((offset) & 7)) & 1)
#define HEADER_CHUNK_ON(ii, offset)   (((ii)->header->chunks[((offset) >> 3)]) |= (1 << ((offset) & 7)))
#define HEADER_CHUNK_OFF(ii, offset)   (((ii)->header->chunks[((offset) >> 3)]) &= ~(1 << ((offset) & 7)))
#define N_GARBAGES_TH   1
#define N_GARBAGES   ((S_GARBAGE - (sizeof(uint32_t) * 4))/(sizeof(uint32_t)))
#define WIN_MAP2(chunk, ctx, iw, seg, pos, size, mode)
#define UNIT_SIZE   0x80
#define UNIT_MASK   (UNIT_SIZE - 1)
#define USE_P_ENC   (1<<0)
#define CUT_OFF   (1<<1)
#define ODD   (1<<2)
#define GRN_B_DEC_CHECK(v, p, pe)
#define BUFFER_REC_DEL(r)   ((r)->jump = 1)
#define BUFFER_REC_DELETED(r)   ((r)->jump == 1)
#define BUFFER_REC_AT(b, pos)   ((buffer_rec *)(b) + (pos))
#define BUFFER_REC_POS(b, rec)   ((uint16_t)((rec) - (buffer_rec *)(b)))
#define GET_NUM_BITS(x, n)
#define GRN_II_MAX_TF   0x1ffff
#define GETNEXTC()
#define PUTNEXT_(id)
#define PUTNEXTC()
#define GETNEXTB()
#define PUTNEXTB()
#define MERGE_BC(cond)
#define SCALE_FACTOR   2048
#define MAX_NTERMS   8192
#define SPLIT_COND
#define BIT11_01(x)   ((x >> 1) & 0x7ff)
#define BIT31_12(x)   (x >> 12)
#define CHUNK_USED   1
#define BUFFER_USED   2
#define SOLE_DOC_USED   4
#define SOLE_POS_USED   8
#define GRN_II_CURSOR_CMP(c1, c2)
#define EX_NONE   0
#define EX_PREFIX   1
#define EX_SUFFIX   2
#define EX_BOTH   3
#define TERM_EXTRACT_EACH_POST   0
#define TERM_EXTRACT_EACH_TERM   1
#define SKIP_OR_BREAK(pos)

Typedefs

typedef struct grn_ii_buffer buffer
typedef struct _btr_node btr_node

Enumerations

enum  grn_wv_mode { grn_wv_none = 0, grn_wv_static, grn_wv_dynamic, grn_wv_constant }

Functions

int grn_p_enc (grn_ctx *ctx, uint32_t *data, uint32_t data_size, uint8_t **res)
size_t grn_p_encv (grn_ctx *ctx, datavec *dv, uint32_t dvlen, uint8_t *res)
int grn_p_dec (grn_ctx *ctx, uint8_t *data, uint32_t data_size, uint32_t nreq, uint32_t **res)
int grn_p_decv (grn_ctx *ctx, uint8_t *data, uint32_t data_size, datavec *dv, uint32_t dvlen)
int grn_b_enc (grn_ctx *ctx, uint32_t *data, uint32_t data_size, uint8_t **res)
int grn_b_dec (grn_ctx *ctx, uint8_t *data, uint32_t data_size, uint32_t **res)
grn_ii_updspecgrn_ii_updspec_open (grn_ctx *ctx, uint32_t rid, uint32_t sid)
grn_rc grn_ii_updspec_add (grn_ctx *ctx, grn_ii_updspec *u, int pos, int32_t weight)
int grn_ii_updspec_cmp (grn_ii_updspec *a, grn_ii_updspec *b)
grn_rc grn_ii_updspec_close (grn_ctx *ctx, grn_ii_updspec *u)
void grn_ii_buffer_check (grn_ctx *ctx, grn_ii *ii, uint32_t seg)
grn_iigrn_ii_create (grn_ctx *ctx, const char *path, grn_obj *lexicon, uint32_t flags)
grn_rc grn_ii_remove (grn_ctx *ctx, const char *path)
grn_rc grn_ii_truncate (grn_ctx *ctx, grn_ii *ii)
grn_iigrn_ii_open (grn_ctx *ctx, const char *path, grn_obj *lexicon)
grn_rc grn_ii_close (grn_ctx *ctx, grn_ii *ii)
grn_rc grn_ii_info (grn_ctx *ctx, grn_ii *ii, uint64_t *seg_size, uint64_t *chunk_size)
void grn_ii_expire (grn_ctx *ctx, grn_ii *ii)
grn_rc grn_ii_update_one (grn_ctx *ctx, grn_ii *ii, grn_id tid, grn_ii_updspec *u, grn_hash *h)
grn_rc grn_ii_delete_one (grn_ctx *ctx, grn_ii *ii, grn_id tid, grn_ii_updspec *u, grn_hash *h)
grn_ii_cursorgrn_ii_cursor_open (grn_ctx *ctx, grn_ii *ii, grn_id tid, grn_id min, grn_id max, int nelements, int flags)
grn_ii_postinggrn_ii_cursor_next (grn_ctx *ctx, grn_ii_cursor *c)
grn_ii_postinggrn_ii_cursor_next_pos (grn_ctx *ctx, grn_ii_cursor *c)
grn_rc grn_ii_cursor_close (grn_ctx *ctx, grn_ii_cursor *c)
uint32_t grn_ii_get_chunksize (grn_ctx *ctx, grn_ii *ii, grn_id tid)
uint32_t grn_ii_estimate_size (grn_ctx *ctx, grn_ii *ii, grn_id tid)
int grn_ii_entry_info (grn_ctx *ctx, grn_ii *ii, grn_id tid, unsigned int *a, unsigned int *chunk, unsigned int *chunk_size, unsigned int *buffer_free, unsigned int *nterms, unsigned int *nterms_void, unsigned int *bt_tid, unsigned int *size_in_chunk, unsigned int *pos_in_chunk, unsigned int *size_in_buffer, unsigned int *pos_in_buffer)
const char * grn_ii_path (grn_ii *ii)
uint32_t grn_ii_max_section (grn_ii *ii)
grn_objgrn_ii_lexicon (grn_ii *ii)
grn_rc grn_ii_column_update (grn_ctx *ctx, grn_ii *ii, grn_id rid, unsigned int section, grn_obj *oldvalue, grn_obj *newvalue, grn_obj *posting)
grn_rc grn_ii_posting_add (grn_ctx *ctx, grn_ii_posting *pos, grn_hash *s, grn_operator op)
grn_rc grn_ii_similar_search (grn_ctx *ctx, grn_ii *ii, const char *string, unsigned int string_len, grn_hash *s, grn_operator op, grn_select_optarg *optarg)
grn_rc grn_ii_term_extract (grn_ctx *ctx, grn_ii *ii, const char *string, unsigned int string_len, grn_hash *s, grn_operator op, grn_select_optarg *optarg)
grn_rc grn_ii_select (grn_ctx *ctx, grn_ii *ii, const char *string, unsigned int string_len, grn_hash *s, grn_operator op, grn_select_optarg *optarg)
grn_rc grn_ii_sel (grn_ctx *ctx, grn_ii *ii, const char *string, unsigned int string_len, grn_hash *s, grn_operator op, grn_search_optarg *optarg)
grn_rc grn_ii_at (grn_ctx *ctx, grn_ii *ii, grn_id id, grn_hash *s, grn_operator op)
void grn_ii_resolve_sel_and (grn_ctx *ctx, grn_hash *s, grn_operator op)
void grn_ii_cursor_inspect (grn_ctx *ctx, grn_ii_cursor *c, grn_obj *buf)
void grn_ii_inspect_elements (grn_ctx *ctx, grn_ii *ii, grn_obj *buf)
grn_ii_buffergrn_ii_buffer_open (grn_ctx *ctx, grn_ii *ii, long long unsigned int update_buffer_size)
grn_rc grn_ii_buffer_append (grn_ctx *ctx, grn_ii_buffer *ii_buffer, grn_id rid, unsigned int sid, grn_obj *value)
grn_rc grn_ii_buffer_commit (grn_ctx *ctx, grn_ii_buffer *ii_buffer)
grn_rc grn_ii_buffer_close (grn_ctx *ctx, grn_ii_buffer *ii_buffer)
grn_rc grn_ii_build (grn_ctx *ctx, grn_ii *ii, uint64_t sparsity)

Variables

const grn_id II_BUFFER_RID_FLAG = 0x80000000
const grn_id II_BUFFER_WEIGHT_FLAG = 0x40000000
const int II_BUFFER_ORDER = GRN_CURSOR_BY_KEY
const uint16_t II_BUFFER_NTERMS_PER_BUFFER = 16380
const uint32_t II_BUFFER_PACKED_BUF_SIZE = 0x4000000
const char * TMPFILE_PATH = "grn_ii_buffer_tmp"
const uint32_t II_BUFFER_NCOUNTERS_MARGIN = 0x100000
const size_t II_BUFFER_BLOCK_SIZE = 0x1000000
const uint32_t II_BUFFER_BLOCK_READ_UNIT_SIZE = 0x200000
const uint32_t PAT_CACHE_SIZE = 1<<20

Macro Definition Documentation

#define ARRAY_MASK_IN_A_SEGMENT   ((1 << W_ARRAY) - 1)

Definition at line 39 of file ii.c.

#define BGQENQUE (   lseg)
Value:
do {\
if (ii->header->binfo[lseg] != NOT_ASSIGNED) {\
ii->header->bgqbody[ii->header->bgqhead] = ii->header->binfo[lseg];\
ii->header->bgqhead = (ii->header->bgqhead + 1) & (GRN_II_BGQSIZE - 1);\
GRN_ASSERT(ii->header->bgqhead != ii->header->bgqtail);\
}\
} while (0)

Definition at line 185 of file ii.c.

#define BIT11_01 (   x)    ((x >> 1) & 0x7ff)

Definition at line 3672 of file ii.c.

#define BIT31_12 (   x)    (x >> 12)

Definition at line 3673 of file ii.c.

#define BUFFER_REC_AT (   b,
  pos 
)    ((buffer_rec *)(b) + (pos))

Definition at line 1928 of file ii.c.

#define BUFFER_REC_DEL (   r)    ((r)->jump = 1)

Definition at line 1925 of file ii.c.

#define BUFFER_REC_DELETED (   r)    ((r)->jump == 1)

Definition at line 1926 of file ii.c.

#define BUFFER_REC_POS (   b,
  rec 
)    ((uint16_t)((rec) - (buffer_rec *)(b)))

Definition at line 1929 of file ii.c.

#define BUFFER_USED   2

Definition at line 3904 of file ii.c.

#define CHUNK_SPLIT   0x80000000

Definition at line 44 of file ii.c.

#define CHUNK_SPLIT_THRESHOLD   0x60000

Definition at line 45 of file ii.c.

#define CHUNK_USED   1

Definition at line 3903 of file ii.c.

#define CUT_OFF   (1<<1)

Definition at line 1467 of file ii.c.

#define EX_BOTH   3

Definition at line 5246 of file ii.c.

#define EX_NONE   0

Definition at line 5243 of file ii.c.

#define EX_PREFIX   1

Definition at line 5244 of file ii.c.

#define EX_SUFFIX   2

Definition at line 5245 of file ii.c.

#define GET_NUM_BITS (   x,
 
)
Value:
do {\
n = x;\
n = (n & 0x55555555) + ((n >> 1) & 0x55555555);\
n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\
n = (n & 0x0F0F0F0F) + ((n >> 4) & 0x0F0F0F0F);\
n = (n & 0x00FF00FF) + ((n >> 8) & 0x00FF00FF);\
n = (n & 0x0000FFFF) + ((n >>16) & 0x0000FFFF);\
} while (0)

Definition at line 2014 of file ii.c.

#define GETNEXTB ( )
Value:
do {\
if (nextb) {\
uint32_t lrid = bid.rid, lsid = bid.sid;\
buffer_rec *br = BUFFER_REC_AT(sb, nextb);\
sbp = NEXT_ADDR(br);\
GRN_B_DEC(bid.rid, sbp);\
if ((ii->header->flags & GRN_OBJ_WITH_SECTION)) {\
GRN_B_DEC(bid.sid, sbp);\
} else {\
bid.sid = 1;\
}\
if (lrid > bid.rid || (lrid == bid.rid && lsid >= bid.sid)) {\
GRN_LOG(ctx, GRN_LOG_CRIT, "brokeng!! (%d:%d) -> (%d:%d)", lrid, lsid, bid.rid, bid.sid);\
break;\
}\
nextb = br->step;\
} else {\
bid.rid = 0;\
}\
} while (0)

Definition at line 2407 of file ii.c.

#define GETNEXTC ( )
Value:
do {\
if (sdf) {\
uint32_t dgap = *srp++;\
cid.rid += dgap;\
if (dgap) { cid.sid = 0; }\
snp += cid.tf;\
cid.tf = 1 + *stp++;\
if ((ii->header->flags & GRN_OBJ_WITH_WEIGHT)) { cid.weight = *sop++; }\
if ((ii->header->flags & GRN_OBJ_WITH_SECTION)) {\
cid.sid += 1 + *ssp++;\
} else {\
cid.sid = 1;\
}\
sdf--;\
} else {\
cid.rid = 0;\
}\
} while (0)

Definition at line 2350 of file ii.c.

#define GRN_B_DEC_CHECK (   v,
  p,
  pe 
)

Definition at line 1580 of file ii.c.

#define GRN_II_CURSOR_CMP (   c1,
  c2 
)
Value:
(((c1)->post->rid > (c2)->post->rid) || \
(((c1)->post->rid == (c2)->post->rid) && \
(((c1)->post->sid > (c2)->post->sid) || \
(((c1)->post->sid == (c2)->post->sid) && \
((c1)->post->pos > (c2)->post->pos)))))

Definition at line 3992 of file ii.c.

#define GRN_II_MAX_TF   0x1ffff

Definition at line 2213 of file ii.c.

#define HEADER_CHUNK_AT (   ii,
  offset 
)    ((((ii)->header->chunks[((offset) >> 3)]) >> ((offset) & 7)) & 1)

Definition at line 212 of file ii.c.

#define HEADER_CHUNK_OFF (   ii,
  offset 
)    (((ii)->header->chunks[((offset) >> 3)]) &= ~(1 << ((offset) & 7)))

Definition at line 218 of file ii.c.

#define HEADER_CHUNK_ON (   ii,
  offset 
)    (((ii)->header->chunks[((offset) >> 3)]) |= (1 << ((offset) & 7)))

Definition at line 215 of file ii.c.

#define LPOS (   pos)    (((pos) & 0xffff) << 2)

Definition at line 50 of file ii.c.

#define LSEG (   pos)    ((pos) >> 16)

Definition at line 49 of file ii.c.

#define MAX_N_ELEMENTS   5

Definition at line 47 of file ii.c.

#define MAX_NTERMS   8192

Definition at line 3348 of file ii.c.

#define MAX_PSEG   0x20000

Definition at line 31 of file ii.c.

#define MERGE_BC (   cond)

Definition at line 2448 of file ii.c.

#define N_CHUNKS_PER_FILE   (GRN_IO_FILE_SIZE >> W_SEGMENT)

Definition at line 35 of file ii.c.

#define N_GARBAGES   ((S_GARBAGE - (sizeof(uint32_t) * 4))/(sizeof(uint32_t)))

Definition at line 223 of file ii.c.

#define N_GARBAGES_TH   1

Definition at line 221 of file ii.c.

#define NEXT_ADDR (   p)    (((byte *)(p)) + sizeof(*(p)))

Definition at line 53 of file ii.c.

#define NOT_ASSIGNED   0xffffffff

Definition at line 40 of file ii.c.

#define ODD   (1<<2)

Definition at line 1468 of file ii.c.

#define PUTNEXT_ (   id)
Value:
do {\
uint32_t dgap = id.rid - lid.rid;\
uint32_t sgap = (dgap ? id.sid : id.sid - lid.sid) - 1;\
*ridp++ = dgap;\
if ((ii->header->flags & GRN_OBJ_WITH_SECTION)) {\
*sidp++ = sgap;\
}\
*tfp++ = id.tf - 1;\
if ((ii->header->flags & GRN_OBJ_WITH_WEIGHT)) { *weightp++ = id.weight; }\
lid.rid = id.rid;\
lid.sid = id.sid;\
} while (0)

Definition at line 2369 of file ii.c.

#define PUTNEXTB ( )
Value:
do {\
if (bid.rid && bid.sid) {\
GRN_B_DEC(bid.tf, sbp);\
if (bid.tf > 0) {\
if (lid.rid > bid.rid || (lid.rid == bid.rid && lid.sid >= bid.sid)) {\
GRN_LOG(ctx, GRN_LOG_CRIT, "brokenb!! (%d:%d) -> (%d:%d)", lid.rid, lid.sid, bid.rid, bid.sid);\
break;\
}\
if ((ii->header->flags & GRN_OBJ_WITH_WEIGHT)) { GRN_B_DEC(bid.weight, sbp); }\
PUTNEXT_(bid);\
if ((ii->header->flags & GRN_OBJ_WITH_POSITION)) {\
while (bid.tf--) { GRN_B_DEC(*posp, sbp); spos += *posp++; }\
}\
}\
}\
GETNEXTB();\
} while (0)

Definition at line 2429 of file ii.c.

#define PUTNEXTC ( )
Value:
do {\
if (cid.rid) {\
if (cid.tf) {\
if (lid.rid > cid.rid || (lid.rid == cid.rid && lid.sid >= cid.sid)) {\
GRN_LOG(ctx, GRN_LOG_CRIT, "brokenc!! (%d:%d) -> (%d:%d)", lid.rid, lid.sid, bid.rid, bid.sid);\
break;\
}\
PUTNEXT_(cid);\
if ((ii->header->flags & GRN_OBJ_WITH_POSITION)) {\
uint32_t i;\
for (i = 0; i < cid.tf; i++) {\
*posp++ = snp[i];\
spos += snp[i];\
}\
}\
} else {\
GRN_LOG(ctx, GRN_LOG_CRIT, "invalid chunk(%d,%d)", bt->tid, cid.rid);\
break;\
}\
}\
GETNEXTC();\
} while (0)

Definition at line 2382 of file ii.c.

#define S_ARRAY_ELEMENT   (1 << W_ARRAY_ELEMENT)

Definition at line 37 of file ii.c.

#define S_CHUNK   (1 << GRN_II_W_CHUNK)

Definition at line 32 of file ii.c.

#define S_GARBAGE   (1<<12)

Definition at line 42 of file ii.c.

#define S_IRUSR   0400

Definition at line 56 of file ii.c.

#define S_IWUSR   0200

Definition at line 59 of file ii.c.

#define S_SEGMENT   (1 << W_SEGMENT)

Definition at line 34 of file ii.c.

#define SCALE_FACTOR   2048

Definition at line 3347 of file ii.c.

#define SEG2POS (   seg,
  pos 
)    ((((uint32_t)(seg)) << 16) + (((uint32_t)(pos)) >> 2))

Definition at line 51 of file ii.c.

#define SKIP_OR_BREAK (   pos)
Value:
{\
if (token_info_skip_pos(ctx, ti, rid, sid, pos)) { break; } \
if (ti->p->rid != rid || ti->p->sid != sid) { \
nrid = ti->p->rid; \
nsid = ti->p->sid; \
break; \
} \
}
#define SOLE_DOC_USED   4

Definition at line 3905 of file ii.c.

#define SOLE_POS_USED   8

Definition at line 3906 of file ii.c.

#define SPLIT_COND
Value:
(b->header.nterms > 1024 ||\
(b->header.nterms > 1 &&\
b->header.chunk_size * 100 > ii->header->total_chunk_size))

Definition at line 3349 of file ii.c.

#define TERM_EXTRACT_EACH_POST   0

Definition at line 5836 of file ii.c.

#define TERM_EXTRACT_EACH_TERM   1

Definition at line 5837 of file ii.c.

#define UNIT_MASK   (UNIT_SIZE - 1)

Definition at line 442 of file ii.c.

#define UNIT_SIZE   0x80

Definition at line 441 of file ii.c.

#define USE_P_ENC   (1<<0)

Definition at line 1466 of file ii.c.

#define W_ARRAY   (W_SEGMENT - W_ARRAY_ELEMENT)

Definition at line 38 of file ii.c.

#define W_ARRAY_ELEMENT   3

Definition at line 36 of file ii.c.

#define W_SEGMENT   18

Definition at line 33 of file ii.c.

#define WIN_MAP2 (   chunk,
  ctx,
  iw,
  seg,
  pos,
  size,
  mode 
)
Value:
grn_io_win_map2(chunk, ctx, iw,\
(((seg) & ((1 << GRN_II_N_CHUNK_VARIATION) - 1)) << GRN_II_W_LEAST_CHUNK) + (pos),\
size,mode)

Definition at line 233 of file ii.c.

Typedef Documentation

typedef struct _btr_node btr_node

Definition at line 5588 of file ii.c.

typedef struct grn_ii_buffer buffer

Definition at line 1875 of file ii.c.

Enumeration Type Documentation

Enumerator:
grn_wv_none 
grn_wv_static 
grn_wv_dynamic 
grn_wv_constant 

Definition at line 5681 of file ii.c.

Function Documentation

int grn_b_dec ( grn_ctx ctx,
uint8_t *  data,
uint32_t  data_size,
uint32_t **  res 
)

Definition at line 1835 of file ii.c.

int grn_b_enc ( grn_ctx ctx,
uint32_t *  data,
uint32_t  data_size,
uint8_t **  res 
)

Definition at line 1822 of file ii.c.

grn_rc grn_ii_at ( grn_ctx ctx,
grn_ii ii,
grn_id  id,
grn_hash s,
grn_operator  op 
)

Definition at line 6158 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_buffer_append ( grn_ctx ctx,
grn_ii_buffer ii_buffer,
grn_id  rid,
unsigned int  sid,
grn_obj value 
)

Definition at line 7252 of file ii.c.

void grn_ii_buffer_check ( grn_ctx ctx,
grn_ii ii,
uint32_t  seg 
)

Definition at line 2954 of file ii.c.

Here is the call graph for this function:

grn_rc grn_ii_buffer_close ( grn_ctx ctx,
grn_ii_buffer ii_buffer 
)

Definition at line 7349 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_buffer_commit ( grn_ctx ctx,
grn_ii_buffer ii_buffer 
)

Definition at line 7261 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_ii_buffer* grn_ii_buffer_open ( grn_ctx ctx,
grn_ii ii,
long long unsigned int  update_buffer_size 
)

Definition at line 7195 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_build ( grn_ctx ctx,
grn_ii ii,
uint64_t  sparsity 
)

Definition at line 7437 of file ii.c.

Here is the call graph for this function:

grn_rc grn_ii_close ( grn_ctx ctx,
grn_ii ii 
)

Definition at line 3623 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_column_update ( grn_ctx ctx,
grn_ii ii,
grn_id  rid,
unsigned int  section,
grn_obj oldvalue,
grn_obj newvalue,
grn_obj posting 
)

Definition at line 5044 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_ii* grn_ii_create ( grn_ctx ctx,
const char *  path,
grn_obj lexicon,
uint32_t  flags 
)

Definition at line 3505 of file ii.c.

Here is the caller graph for this function:

grn_rc grn_ii_cursor_close ( grn_ctx ctx,
grn_ii_cursor c 
)

Definition at line 4399 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void grn_ii_cursor_inspect ( grn_ctx ctx,
grn_ii_cursor c,
grn_obj buf 
)

Definition at line 6380 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_ii_posting* grn_ii_cursor_next ( grn_ctx ctx,
grn_ii_cursor c 
)

Definition at line 4167 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_ii_posting* grn_ii_cursor_next_pos ( grn_ctx ctx,
grn_ii_cursor c 
)

Definition at line 4352 of file ii.c.

Here is the caller graph for this function:

grn_ii_cursor* grn_ii_cursor_open ( grn_ctx ctx,
grn_ii ii,
grn_id  tid,
grn_id  min,
grn_id  max,
int  nelements,
int  flags 
)

Definition at line 4000 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_delete_one ( grn_ctx ctx,
grn_ii ii,
grn_id  tid,
grn_ii_updspec u,
grn_hash h 
)

Definition at line 3831 of file ii.c.

Here is the caller graph for this function:

int grn_ii_entry_info ( grn_ctx ctx,
grn_ii ii,
grn_id  tid,
unsigned int *  a,
unsigned int *  chunk,
unsigned int *  chunk_size,
unsigned int *  buffer_free,
unsigned int *  nterms,
unsigned int *  nterms_void,
unsigned int *  bt_tid,
unsigned int *  size_in_chunk,
unsigned int *  pos_in_chunk,
unsigned int *  size_in_buffer,
unsigned int *  pos_in_buffer 
)

Definition at line 4465 of file ii.c.

uint32_t grn_ii_estimate_size ( grn_ctx ctx,
grn_ii ii,
grn_id  tid 
)

Definition at line 4438 of file ii.c.

Here is the caller graph for this function:

void grn_ii_expire ( grn_ctx ctx,
grn_ii ii 
)

Definition at line 3664 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t grn_ii_get_chunksize ( grn_ctx ctx,
grn_ii ii,
grn_id  tid 
)

Definition at line 4411 of file ii.c.

grn_rc grn_ii_info ( grn_ctx ctx,
grn_ii ii,
uint64_t *  seg_size,
uint64_t *  chunk_size 
)

Definition at line 3644 of file ii.c.

Here is the call graph for this function:

void grn_ii_inspect_elements ( grn_ctx ctx,
grn_ii ii,
grn_obj buf 
)

Definition at line 6426 of file ii.c.

Here is the call graph for this function:

grn_obj* grn_ii_lexicon ( grn_ii ii)

Definition at line 4508 of file ii.c.

uint32_t grn_ii_max_section ( grn_ii ii)

Definition at line 4502 of file ii.c.

grn_ii* grn_ii_open ( grn_ctx ctx,
const char *  path,
grn_obj lexicon 
)

Definition at line 3574 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

const char* grn_ii_path ( grn_ii ii)

Definition at line 4496 of file ii.c.

Here is the call graph for this function:

grn_rc grn_ii_posting_add ( grn_ctx ctx,
grn_ii_posting pos,
grn_hash s,
grn_operator  op 
)

Definition at line 5570 of file ii.c.

grn_rc grn_ii_remove ( grn_ctx ctx,
const char *  path 
)

Definition at line 3520 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void grn_ii_resolve_sel_and ( grn_ctx ctx,
grn_hash s,
grn_operator  op 
)

Definition at line 6174 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_sel ( grn_ctx ctx,
grn_ii ii,
const char *  string,
unsigned int  string_len,
grn_hash s,
grn_operator  op,
grn_search_optarg optarg 
)

Definition at line 6100 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_select ( grn_ctx ctx,
grn_ii ii,
const char *  string,
unsigned int  string_len,
grn_hash s,
grn_operator  op,
grn_select_optarg optarg 
)

Definition at line 5923 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_similar_search ( grn_ctx ctx,
grn_ii ii,
const char *  string,
unsigned int  string_len,
grn_hash s,
grn_operator  op,
grn_select_optarg optarg 
)

Definition at line 5716 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_term_extract ( grn_ctx ctx,
grn_ii ii,
const char *  string,
unsigned int  string_len,
grn_hash s,
grn_operator  op,
grn_select_optarg optarg 
)

Definition at line 5840 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_truncate ( grn_ctx ctx,
grn_ii ii 
)

Definition at line 3533 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_update_one ( grn_ctx ctx,
grn_ii ii,
grn_id  tid,
grn_ii_updspec u,
grn_hash h 
)

Definition at line 3676 of file ii.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_ii_updspec_add ( grn_ctx ctx,
grn_ii_updspec u,
int  pos,
int32_t  weight 
)

Definition at line 2216 of file ii.c.

grn_rc grn_ii_updspec_close ( grn_ctx ctx,
grn_ii_updspec u 
)

Definition at line 2254 of file ii.c.

Here is the caller graph for this function:

int grn_ii_updspec_cmp ( grn_ii_updspec a,
grn_ii_updspec b 
)

Definition at line 2238 of file ii.c.

Here is the caller graph for this function:

grn_ii_updspec* grn_ii_updspec_open ( grn_ctx ctx,
uint32_t  rid,
uint32_t  sid 
)

Definition at line 2198 of file ii.c.

int grn_p_dec ( grn_ctx ctx,
uint8_t *  data,
uint32_t  data_size,
uint32_t  nreq,
uint32_t **  res 
)

Definition at line 1713 of file ii.c.

int grn_p_decv ( grn_ctx ctx,
uint8_t *  data,
uint32_t  data_size,
datavec dv,
uint32_t  dvlen 
)

Definition at line 1742 of file ii.c.

Here is the caller graph for this function:

int grn_p_enc ( grn_ctx ctx,
uint32_t *  data,
uint32_t  data_size,
uint8_t **  res 
)

Definition at line 1442 of file ii.c.

size_t grn_p_encv ( grn_ctx ctx,
datavec dv,
uint32_t  dvlen,
uint8_t *  res 
)

Definition at line 1520 of file ii.c.

Variable Documentation

const uint32_t II_BUFFER_BLOCK_READ_UNIT_SIZE = 0x200000

Definition at line 6467 of file ii.c.

const size_t II_BUFFER_BLOCK_SIZE = 0x1000000

Definition at line 6466 of file ii.c.

const uint32_t II_BUFFER_NCOUNTERS_MARGIN = 0x100000

Definition at line 6465 of file ii.c.

const uint16_t II_BUFFER_NTERMS_PER_BUFFER = 16380

Definition at line 6462 of file ii.c.

const int II_BUFFER_ORDER = GRN_CURSOR_BY_KEY

Definition at line 6460 of file ii.c.

const uint32_t II_BUFFER_PACKED_BUF_SIZE = 0x4000000

Definition at line 6463 of file ii.c.

const grn_id II_BUFFER_RID_FLAG = 0x80000000

Definition at line 6455 of file ii.c.

const grn_id II_BUFFER_WEIGHT_FLAG = 0x40000000

Definition at line 6456 of file ii.c.

const uint32_t PAT_CACHE_SIZE = 1<<20

Definition at line 6767 of file ii.c.

const char* TMPFILE_PATH = "grn_ii_buffer_tmp"

Definition at line 6464 of file ii.c.