~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/unique.h

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLED_UNIQUE_H
22
22
#define DRIZZLED_UNIQUE_H
23
23
 
 
24
#include "drizzled/my_tree.h"
24
25
/*
25
26
   Unique -- class for unique (removing of duplicates).
26
27
   Puts all values to the TREE. If the tree becomes too big,
29
30
   memory simultaneously with iteration, so it should be ~2-3x faster.
30
31
 */
31
32
 
 
33
typedef struct st_io_cache IO_CACHE;
 
34
 
32
35
class Unique :public Sql_alloc
33
36
{
34
37
  DYNAMIC_ARRAY file_ptrs;
35
38
  ulong max_elements;
36
39
  size_t max_in_memory_size;
37
 
  IO_CACHE file;
 
40
  IO_CACHE *file;
38
41
  TREE tree;
39
42
  unsigned char *record_pointers;
40
43
  bool flush();
67
70
  void reset();
68
71
  bool walk(tree_walk_action action, void *walk_action_arg);
69
72
 
70
 
  friend int unique_write_to_file(unsigned char* key, element_count count, Unique *unique);
71
 
  friend int unique_write_to_ptrs(unsigned char* key, element_count count, Unique *unique);
 
73
  friend int unique_write_to_file(unsigned char* key, uint32_t count, Unique *unique);
 
74
  friend int unique_write_to_ptrs(unsigned char* key, uint32_t count, Unique *unique);
72
75
};
73
76
 
74
77
#endif /* DRIZZLED_UNIQUE_H */