0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Cell.cc
Go to the documentation of this file.
1 
22 #include "Common/Compat.h"
23 #include "Common/Logger.h"
24 #include "Cell.h"
25 
26 namespace Hypertable {
27 
28 std::ostream &operator<<(std::ostream &os, const Cell &cell) {
29  os <<"{Cell:";
30 
31  HT_DUMP_CSTR(os, key, cell.row_key);
32  HT_DUMP_CSTR(os, cf, cell.column_family);
33  HT_DUMP_CSTR(os, cq, cell.column_qualifier);
34  if (cell.value_len == 0)
35  HT_DUMP_CSTR(os, val, 0);
36  else {
37  std::string value((const char *)cell.value, cell.value_len);
38  HT_DUMP_CSTR(os, val, value.c_str());
39  }
40 
41  os <<" len="<< cell.value_len
42  <<" ts="<< cell.timestamp
43  <<" flag=";
44  if (cell.flag==FLAG_DELETE_ROW)
45  os << "DELETE_ROW";
46  else if (cell.flag==FLAG_DELETE_COLUMN_FAMILY)
47  os << "DELETE_COLUMN_FAMILY";
48  else if (cell.flag==FLAG_DELETE_CELL)
49  os << "DELETE_CELL";
50  else if (cell.flag == FLAG_DELETE_CELL_VERSION)
51  os << "DELETE_CELL_VERSION";
52  else if (cell.flag==FLAG_INSERT)
53  os << "FLAG_INSERT";
54  else
55  os << cell.flag << " (unrecognized)";
56 
57  os <<'}';
58  return os;
59 }
60 
61 } // namespace Hypertable
static const uint32_t FLAG_DELETE_ROW
Definition: KeySpec.h:40
static const uint32_t FLAG_INSERT
Definition: KeySpec.h:47
const char * column_qualifier
Definition: Cell.h:68
static const uint32_t FLAG_DELETE_CELL
Definition: KeySpec.h:42
static const uint32_t FLAG_DELETE_COLUMN_FAMILY
Definition: KeySpec.h:41
Logging routines and macros.
Compatibility Macros for C/C++.
#define HT_DUMP_CSTR(_os_, _label_, _str_)
Definition: Logger.h:227
std::ostream & operator<<(std::ostream &os, const crontab_entry &entry)
Helper function to write crontab_entry to an ostream.
Definition: Crontab.cc:301
const char * row_key
Definition: Cell.h:66
Hypertable definitions
const char * column_family
Definition: Cell.h:67
uint32_t value_len
Definition: Cell.h:72
uint8_t flag
Definition: Cell.h:73
Encapsulates decomposed key and value.
Definition: Cell.h:32
static const uint32_t FLAG_DELETE_CELL_VERSION
Definition: KeySpec.h:43
const uint8_t * value
Definition: Cell.h:71
int64_t timestamp
Definition: Cell.h:69