src/backend/storage/tile_group.cpp
/**
 * Grab specific slot and fill in the tuple
 * Used by recovery
 * Returns slot where inserted (INVALID_ID if not inserted)
 */
Grab specific slot and fill in the tuple
Used by recovery
Returns slot where inserted (INVALID_ID if not inserted)
Grab specific slot and fill in the tuple Used by recovery Returns slot where inserted ( INVALID_ID if not inserted )
oid_t TileGroup::InsertTupleFromRecovery(cid_t commit_id, oid_t tuple_slot_id,
                                         const Tuple *tuple) {
  auto status = tile_group_header->GetEmptyTupleSlot(tuple_slot_id);
  if (status == false) return INVALID_OID;
  cid_t current_begin_cid = tile_group_header->GetBeginCommitId(tuple_slot_id);
  if (current_begin_cid != MAX_CID && current_begin_cid > commit_id) {
    return tuple_slot_id;
  }
  LOG_TRACE("Tile Group Id :: %u status :: %u out of %u slots ",
            tile_group_id, tuple_slot_id, num_tuple_slots);
  oid_t tile_column_count;
  oid_t column_itr = 0;
  for (oid_t tile_itr = 0; tile_itr < tile_count; tile_itr++) {
    const catalog::Schema &schema = tile_schemas[tile_itr];
    tile_column_count = schema.GetColumnCount();
    storage::Tile *tile = GetTile(tile_itr);
    assert(tile);
    char *tile_tuple_location = tile->GetTupleLocation(tuple_slot_id);
    assert(tile_tuple_location);
    storage::Tuple tile_tuple(&schema, tile_tuple_location);
    for (oid_t tile_column_itr = 0; tile_column_itr < tile_column_count;
         tile_column_itr++) {
      tile_tuple.SetValue(tile_column_itr, tuple->GetValue(column_itr),
                          tile->GetPool());
      column_itr++;
    }
  }
  tile_group_header->SetTransactionId(tuple_slot_id, INITIAL_TXN_ID);
  tile_group_header->SetBeginCommitId(tuple_slot_id, commit_id);
  tile_group_header->SetEndCommitId(tuple_slot_id, MAX_CID);
  tile_group_header->SetInsertCommit(tuple_slot_id, false);
  tile_group_header->SetDeleteCommit(tuple_slot_id, false);
  tile_group_header->SetNextItemPointer(tuple_slot_id, INVALID_ITEMPOINTER);
  return tuple_slot_id;
}
oid_t TileGroup :: InsertTupleFromRecovery ( cid_t commit_id , oid_t tuple_slot_id , const Tuple * tuple ) { auto status = tile_group_header -> GetEmptyTupleSlot ( tuple_slot_id ) ; if ( status == false ) return INVALID_OID ; cid_t current_begin_cid = tile_group_header -> GetBeginCommitId ( tuple_slot_id ) ; if ( current_begin_cid != MAX_CID && current_begin_cid > commit_id ) { return tuple_slot_id ; } LOG_TRACE ( " " , tile_group_id , tuple_slot_id , num_tuple_slots ) ; oid_t tile_column_count ; oid_t column_itr = 0 ; for ( oid_t tile_itr = 0 ; tile_itr < tile_count ; tile_itr ++ ) { const catalog :: Schema & schema = tile_schemas [ tile_itr ] ; tile_column_count = schema . GetColumnCount ( ) ; storage :: Tile * tile = GetTile ( tile_itr ) ; assert ( tile ) ; char * tile_tuple_location = tile -> GetTupleLocation ( tuple_slot_id ) ; assert ( tile_tuple_location ) ; storage :: Tuple tile_tuple ( & schema , tile_tuple_location ) ; for ( oid_t tile_column_itr = 0 ; tile_column_itr < tile_column_count ; tile_column_itr ++ ) { tile_tuple . SetValue ( tile_column_itr , tuple -> GetValue ( column_itr ) , tile -> GetPool ( ) ) ; column_itr ++ ; } } tile_group_header -> SetTransactionId ( tuple_slot_id , INITIAL_TXN_ID ) ; tile_group_header -> SetBeginCommitId ( tuple_slot_id , commit_id ) ; tile_group_header -> SetEndCommitId ( tuple_slot_id , MAX_CID ) ; tile_group_header -> SetInsertCommit ( tuple_slot_id , false ) ; tile_group_header -> SetDeleteCommit ( tuple_slot_id , false ) ; tile_group_header -> SetNextItemPointer ( tuple_slot_id , INVALID_ITEMPOINTER ) ; return tuple_slot_id ; }
Grab specific slot and fill in the tuple
 Used by recovery
 Returns slot where inserted (INVALID_ID if not inserted)
Grab specific slot and fill in the tuple Used by recovery Returns slot where inserted ( INVALID_ID if not inserted )
// No more slots // NOTE:: Only a tuple wrapper // Set MVCC info