Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor import/sync drop dtable-server view-rows #429

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

AlexCXC
Copy link
Contributor

@AlexCXC AlexCXC commented Feb 27, 2023

No description provided.

@AlexCXC AlexCXC force-pushed the CDS-drop-server-rows branch from ce93511 to 84a09d3 Compare March 1, 2023 01:56
@AlexCXC AlexCXC force-pushed the CDS-drop-server-rows branch from 84a09d3 to 173a3f6 Compare March 1, 2023 02:21
if not src_view:
set_common_dataset_invalid(dataset_id, db_session)
set_common_dataset_sync_invalid(dataset_sync_id, db_session)
logging.error('Source view not found.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

设置为无效的,日志应该是warning

except Exception as e:
logging.error('request dst dtable: %s error: %s', dst_dtable_uuid, e)
return
src_enable_archive = (src_dtable_metadata.get('settings') or {}).get('enable_archive', False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个目前需要判断是否是归档数据吗

@@ -533,298 +540,376 @@ def generate_single_row(converted_row, src_row, src_columns, transfered_columns_
if not transfered_column:
continue

if to_archive and col['key'] in ['_creator', '_ctime', '_last_modifier', '_mtime']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to_archive是用于处理,同步归档数据吗

return {
'dst_table_id': None,
'error_msg': 'update rows error',
'task_status_code': 500
}


def delete_dst_rows(dst_dtable_uuid, dst_table_name, to_be_deleted_row_ids, dst_dtable_db_api, dst_dtable_server_api, to_archive):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

归档和非归档数据都可以使用dtable-db的接口删除

updates = []
for row in to_be_updated_rows[i: i+step]:
updates.append({
def update_dst_rows(dst_dtable_uuid, dst_table_name, to_be_updated_rows, dst_dtable_db_api, dst_dtable_server_api, to_archive):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

归档和非归档数据都可以使用dtable-db的接口更新

@AlexCXC AlexCXC force-pushed the CDS-drop-server-rows branch from 59815e1 to a38891e Compare March 1, 2023 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants