void popdown() { int i, j; char *pp; char buf[2]={0}; #if (NMOD_X86EMU_INT10 > 0)||(NMOD_X86EMU > 0) for (i=POP_Y; i<POP_Y + POP_H; i++) { for (j=POP_X; j<POP_X + POP_W; j++) { pp = (char *)(SCREEN_ADR + (i * 160) + (j * 2)); *pp = save[0][i-POP_Y][j-POP_X]; /* Restore screen */ set_scrn_buf(i, j, save[0][i-POP_Y][j-POP_X]); pp++; *pp = save[1][i-POP_Y][j-POP_X]; /* Restore color */ } } #elif NMOD_FRAMEBUFFER > 0 video_set_bg(0, 0, 128); for (i=POP_Y; i<POP_Y + POP_H; i++) { for (j=POP_X; j<POP_X + POP_W; j++) { buf[0] = video_get_console_char(j, i); set_scrn_buf(i, j, buf[0]); video_console_print(j, i, buf); } } #endif tty_print_region(POP_Y, POP_X, POP_Y+POP_H, POP_X+POP_W); #if NMOD_FRAMEBUFFER >0 begin_record(); #endif }
BinaryInputStream& BinaryInputStream::read_record(Numeric::float64* data, int nbr) { begin_record(); read_array(data, nbr); end_record(); return *this; }
BinaryOutputStream& BinaryOutputStream::write_record( Numeric::float64* data, int nbr ) { begin_record(); write_array(data, nbr); end_record(); return *this; }
void SimpleCheckpoint::DoCheckpoint() { // TODO split checkpoint file into multiple files in the future // Create a new file for checkpoint CreateFile(); auto &log_manager = LogManager::GetInstance(); if (logger_ == nullptr) { logger_.reset(BackendLogger::GetBackendLogger(LOGGING_TYPE_NVM_WAL)); } start_commit_id_ = log_manager.GetGlobalMaxFlushedCommitId(); if (start_commit_id_ == INVALID_CID) { auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance(); start_commit_id_ = txn_manager.GetMaxCommittedCid(); } LOG_TRACE("DoCheckpoint cid = %lu", start_commit_id_); // Add txn begin record std::shared_ptr<LogRecord> begin_record(new TransactionRecord( LOGRECORD_TYPE_TRANSACTION_BEGIN, start_commit_id_)); CopySerializeOutput begin_output_buffer; begin_record->Serialize(begin_output_buffer); records_.push_back(begin_record); auto &catalog_manager = catalog::Manager::GetInstance(); auto database_count = catalog_manager.GetDatabaseCount(); // loop all databases for (oid_t database_idx = 0; database_idx < database_count; database_idx++) { auto database = catalog_manager.GetDatabase(database_idx); auto table_count = database->GetTableCount(); auto database_oid = database->GetOid(); // loop all tables for (oid_t table_idx = 0; table_idx < table_count; table_idx++) { // Get the target table storage::DataTable *target_table = database->GetTable(table_idx); PL_ASSERT(target_table); LOG_TRACE("SeqScan: database idx %u table idx %u: %s", database_idx, table_idx, target_table->GetName().c_str()); Scan(target_table, database_oid); } } // Add txn commit record std::shared_ptr<LogRecord> commit_record(new TransactionRecord( LOGRECORD_TYPE_TRANSACTION_COMMIT, start_commit_id_)); CopySerializeOutput commit_output_buffer; commit_record->Serialize(commit_output_buffer); records_.push_back(commit_record); // TODO Add delimiter record for checkpoint recovery as well Persist(); Cleanup(); most_recent_checkpoint_cid = start_commit_id_; }