예제 #1
0
파일: bLSM.cpp 프로젝트: Bathtor/bLSM
void bLSM::replayLog() {
  lsn_t start = tbl_header.log_trunc;
  LogHandle * lh = start ? getLSNHandle(log_file, start) : getLogHandle(log_file);
  const LogEntry * e;
  while((e = nextInLog(lh))) {
    switch(e->type) {
    case UPDATELOG: {
      dataTuple * tup = dataTuple::from_bytes((byte*)stasis_log_entry_update_args_cptr(e));
      insertTuple(tup);
      dataTuple::freetuple(tup);
    } break;
    case INTERNALLOG: { } break;
    default: assert(e->type == UPDATELOG); abort();
    }
  }
  freeLogHandle(lh);
  recovering = false;
  printf("\nLog replay complete.\n");

}
예제 #2
0
파일: logHandle.c 프로젝트: Zhoutall/stasis
LogHandle* getLogHandle(stasis_log_t* log) {
  return getLSNHandle(log, log->truncation_point(log));
}