kaqing 2.0.193__tar.gz → 2.0.209__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kaqing might be problematic. Click here for more details.
- {kaqing-2.0.193 → kaqing-2.0.209}/PKG-INFO +1 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/batch.py +1 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/app/utils_app.py +1 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/commands_utils.py +2 -29
- {kaqing-2.0.193/adam/commands → kaqing-2.0.209/adam/commands/cql}/alter_tables.py +1 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/cql/completions_c.py +1 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/cql/utils_cql.py +6 -6
- kaqing-2.0.209/adam/commands/debug/debug.py +22 -0
- kaqing-2.0.209/adam/commands/debug/debug_completes.py +35 -0
- kaqing-2.0.209/adam/commands/debug/debug_timings.py +35 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/devices/device.py +1 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/download_cassandra_log.py +2 -2
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/export_databases.py +2 -2
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/export_sessions.py +12 -11
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/exporter.py +140 -53
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/import_session.py +0 -4
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/importer.py +12 -11
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/importer_athena.py +17 -7
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/importer_sqlite.py +21 -9
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/utils_export.py +35 -14
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/postgres/postgres_databases.py +1 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/postgres/postgres_ls.py +1 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/postgres/utils_postgres.py +2 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_cassandra_status.py +2 -3
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/config.py +4 -6
- kaqing-2.0.209/adam/embedded_params.py +2 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/repl.py +3 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/repl_commands.py +12 -11
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/repl_session.py +2 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sso/cred_cache.py +2 -5
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils.py +199 -83
- kaqing-2.0.209/adam/utils_k8s/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/app_clusters.py +11 -4
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/app_pods.py +9 -3
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/cassandra_clusters.py +8 -4
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/cassandra_nodes.py +14 -4
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/kube_context.py +1 -4
- {kaqing-2.0.193/adam → kaqing-2.0.209/adam/utils_k8s}/pod_exec_result.py +8 -2
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/pods.py +80 -24
- kaqing-2.0.209/adam/utils_local.py +52 -0
- kaqing-2.0.209/adam/utils_repl/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_sqlite.py +3 -8
- kaqing-2.0.209/adam/version.py +5 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/kaqing.egg-info/PKG-INFO +1 -1
- {kaqing-2.0.193 → kaqing-2.0.209}/kaqing.egg-info/SOURCES.txt +8 -10
- {kaqing-2.0.193 → kaqing-2.0.209}/setup.py +1 -1
- kaqing-2.0.209/teddy/__init__.py +0 -0
- kaqing-2.0.193/adam/commands/cat.py +0 -36
- kaqing-2.0.193/adam/commands/cd.py +0 -41
- kaqing-2.0.193/adam/commands/download_file.py +0 -47
- kaqing-2.0.193/adam/commands/find_files.py +0 -51
- kaqing-2.0.193/adam/commands/find_processes.py +0 -76
- kaqing-2.0.193/adam/commands/head.py +0 -36
- kaqing-2.0.193/adam/commands/ls.py +0 -41
- kaqing-2.0.193/adam/commands/shell.py +0 -41
- kaqing-2.0.193/adam/embedded_params.py +0 -2
- kaqing-2.0.193/adam/utils_local.py +0 -4
- kaqing-2.0.193/adam/version.py +0 -5
- {kaqing-2.0.193 → kaqing-2.0.209}/MANIFEST.in +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/README +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/app_session.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/apps.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/check.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/check_context.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/check_result.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/check_utils.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/compactionstats.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/cpu.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/cpu_metrics.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/disk.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/gossip.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/issue.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/memory.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/checks/status.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/cli.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/cli_group.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/column.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/columns.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/compactions.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/cpu.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/cpu_metrics.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/dir_data.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/dir_snapshots.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/gossip.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/host_id.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/memory.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/node_address.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/node_load.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/node_owns.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/node_status.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/node_tokens.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/node_utils.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/pod_name.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/volume_cassandra.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/columns/volume_root.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/app/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/app/app.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/app/app_ping.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/app/show_app_actions.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/app/show_app_id.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/app/show_app_queues.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/audit/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/audit/audit.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/audit/audit_repair_tables.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/audit/audit_run.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/audit/completions_l.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/audit/show_last10.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/audit/show_slow10.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/audit/show_top10.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/audit/utils_show_top10.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/bash/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/bash/bash.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/bash/bash_completer.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/bash/utils_bash.py +0 -0
- {kaqing-2.0.193/adam/commands/cql → kaqing-2.0.209/adam/commands/cassandra}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/check.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/cli_commands.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/clipboard_copy.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/code.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/command.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/command_helpers.py +0 -0
- {kaqing-2.0.193/adam/commands/deploy → kaqing-2.0.209/adam/commands/cql}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/cql/cqlsh.py +0 -0
- {kaqing-2.0.193/adam/commands/devices → kaqing-2.0.209/adam/commands/debug}/__init__.py +0 -0
- {kaqing-2.0.193/adam/commands/export → kaqing-2.0.209/adam/commands/deploy}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/code_start.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/code_stop.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/code_utils.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/deploy.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/deploy_frontend.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/deploy_pg_agent.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/deploy_pod.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/deploy_utils.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/undeploy.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/undeploy_frontend.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/undeploy_pg_agent.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/deploy/undeploy_pod.py +0 -0
- {kaqing-2.0.193/adam/commands/medusa → kaqing-2.0.209/adam/commands/devices}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/devices/device_app.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/devices/device_auit_log.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/devices/device_cass.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/devices/device_export.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/devices/device_postgres.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/devices/devices.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/exit.py +0 -0
- {kaqing-2.0.193/adam/commands/postgres → kaqing-2.0.209/adam/commands/export}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/clean_up_all_export_sessions.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/clean_up_export_sessions.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/completions_x.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/download_export_session.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/drop_export_database.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/drop_export_databases.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/export.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/export_select.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/export_use.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/export_x_select.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/import_files.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/show_column_counts.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/show_export_databases.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/show_export_session.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/export/show_export_sessions.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/generate_report.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/help.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/intermediate_command.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/issues.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/kubectl.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/login.py +0 -0
- {kaqing-2.0.193/adam/commands/reaper → kaqing-2.0.209/adam/commands/medusa}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/medusa/medusa.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/medusa/medusa_backup.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/medusa/medusa_restore.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/medusa/medusa_show_backupjobs.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/medusa/medusa_show_restorejobs.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/medusa/utils_medusa.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/nodetool.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/nodetool_commands.py +0 -0
- {kaqing-2.0.193/adam/commands/repair → kaqing-2.0.209/adam/commands/os}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/param_get.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/param_set.py +0 -0
- {kaqing-2.0.193/adam/commands/show → kaqing-2.0.209/adam/commands/postgres}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/postgres/completions_p.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/postgres/postgres.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/postgres/postgres_preview.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/preview_table.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/pwd.py +0 -0
- {kaqing-2.0.193/adam/sql → kaqing-2.0.209/adam/commands/reaper}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_forward.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_forward_session.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_forward_stop.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_restart.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_run_abort.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_runs.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_runs_abort.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_schedule_activate.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_schedule_start.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_schedule_stop.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_schedules.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/reaper_status.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/reaper/utils_reaper.py +0 -0
- {kaqing-2.0.193/adam/sso → kaqing-2.0.209/adam/commands/repair}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/repair/repair.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/repair/repair_log.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/repair/repair_run.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/repair/repair_scan.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/repair/repair_stop.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/restart_cluster.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/restart_node.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/restart_nodes.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/rollout.py +0 -0
- {kaqing-2.0.193/adam/utils_k8s → kaqing-2.0.209/adam/commands/show}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_adam.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_cassandra_repairs.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_cassandra_version.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_cli_commands.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_host.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_login.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_params.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_processes.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/show/show_storage.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/commands/watch.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/embedded_apps.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/log.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/repl_state.py +0 -0
- {kaqing-2.0.193/adam/utils_repl → kaqing-2.0.209/adam/sql}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sql/async_executor.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sql/lark_completer.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sql/lark_parser.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sql/qingl.lark +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sql/sql_completer.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sql/sql_state_machine.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sql/term_completer.py +0 -0
- {kaqing-2.0.193/teddy → kaqing-2.0.209/adam/sso}/__init__.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sso/authenticator.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sso/authn_ad.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sso/authn_okta.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sso/id_token.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sso/idp.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sso/idp_login.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sso/idp_session.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/sso/sso_config.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_athena.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_audits.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_issues.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/config_maps.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/custom_resources.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/deployment.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/ingresses.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/jobs.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/k8s.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/secrets.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/service_accounts.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/services.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/statefulsets.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_k8s/volumes.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_net.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_repl/appendable_completer.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_repl/automata_completer.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_repl/repl_completer.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/adam/utils_repl/state_machine.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/kaqing.egg-info/dependency_links.txt +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/kaqing.egg-info/entry_points.txt +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/kaqing.egg-info/top_level.txt +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/setup.cfg +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/teddy/lark_parser.py +0 -0
- {kaqing-2.0.193 → kaqing-2.0.209}/teddy/lark_parser2.py +0 -0
|
@@ -12,7 +12,7 @@ from adam.commands.deploy.undeploy import Undeploy, UndeployCommandHelper
|
|
|
12
12
|
from adam.commands.issues import Issues
|
|
13
13
|
from adam.commands.login import Login
|
|
14
14
|
from adam.commands.download_cassandra_log import DownloadCassandraLog
|
|
15
|
-
from adam.commands.ls import Ls
|
|
15
|
+
from adam.commands.fs.ls import Ls
|
|
16
16
|
from adam.commands.medusa.medusa import Medusa
|
|
17
17
|
from adam.commands.nodetool import NodeTool, NodeToolCommandHelper
|
|
18
18
|
from adam.commands.postgres.postgres import Postgres, PostgresCommandHelper
|
|
@@ -3,7 +3,7 @@ from typing import Union
|
|
|
3
3
|
|
|
4
4
|
from adam.app_session import AppSession
|
|
5
5
|
from adam.apps import Apps
|
|
6
|
-
from adam.pod_exec_result import PodExecResult
|
|
6
|
+
from adam.utils_k8s.pod_exec_result import PodExecResult
|
|
7
7
|
from adam.repl_state import ReplState
|
|
8
8
|
from adam.utils import log2
|
|
9
9
|
from adam.utils_k8s.app_clusters import AppClusters
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
1
|
from kubernetes import client
|
|
3
2
|
from typing import List
|
|
4
3
|
|
|
5
4
|
from adam.checks.check_utils import run_checks
|
|
6
5
|
from adam.columns.columns import Columns, collect_checks
|
|
7
|
-
from adam.config import Config
|
|
8
|
-
from adam.repl_session import ReplSession
|
|
9
6
|
from adam.utils_issues import IssuesUtils
|
|
10
7
|
from adam.utils_k8s.cassandra_nodes import CassandraNodes
|
|
11
8
|
from adam.utils_k8s.pods import Pods
|
|
12
9
|
from adam.utils_k8s.statefulsets import StatefulSets
|
|
13
10
|
from adam.repl_state import ReplState
|
|
14
|
-
from adam.utils import SORT, duration, tabulize, log2
|
|
11
|
+
from adam.utils import SORT, duration, kaqing_log_file, tabulize, log2
|
|
15
12
|
|
|
16
13
|
def show_pods(pods: List[client.V1Pod], ns: str, show_namespace = True, show_host_id = True):
|
|
17
14
|
if len(pods) == 0:
|
|
@@ -80,28 +77,4 @@ def write_to_kaqing_log_file(r: str):
|
|
|
80
77
|
with kaqing_log_file() as f:
|
|
81
78
|
f.write(r)
|
|
82
79
|
|
|
83
|
-
return f.name
|
|
84
|
-
|
|
85
|
-
def _kaqing_log_file(suffix = 'log'):
|
|
86
|
-
log_prefix = Config().get('log-prefix', '/tmp/qing')
|
|
87
|
-
return f'{log_prefix}-{datetime.now().strftime("%d%H%M%S")}.{suffix}'
|
|
88
|
-
|
|
89
|
-
class LogFileHandler:
|
|
90
|
-
def __init__(self, suffix = 'log'):
|
|
91
|
-
self.suffix = suffix
|
|
92
|
-
|
|
93
|
-
def __enter__(self):
|
|
94
|
-
self.f = open(_kaqing_log_file(), 'w')
|
|
95
|
-
self.f.__enter__()
|
|
96
|
-
|
|
97
|
-
return self.f
|
|
98
|
-
|
|
99
|
-
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
100
|
-
self.f.__exit__(exc_type, exc_val, exc_tb)
|
|
101
|
-
|
|
102
|
-
ReplSession().append_history(f':sh cat {self.f.name}')
|
|
103
|
-
|
|
104
|
-
return False
|
|
105
|
-
|
|
106
|
-
def kaqing_log_file(suffix = 'log'):
|
|
107
|
-
return LogFileHandler(suffix = suffix)
|
|
80
|
+
return f.name
|
|
@@ -59,7 +59,7 @@ class AlterTables(Command):
|
|
|
59
59
|
return state
|
|
60
60
|
|
|
61
61
|
def completion(self, _: ReplState) -> dict[str, any]:
|
|
62
|
-
# auto completion is taken care of by
|
|
62
|
+
# auto completion is taken care of by lark completer
|
|
63
63
|
return {}
|
|
64
64
|
|
|
65
65
|
def help(self, _: ReplState) -> str:
|
|
@@ -18,7 +18,7 @@ def completions_c(state: ReplState) -> dict[str, any]:
|
|
|
18
18
|
'table-props': lambda x: {
|
|
19
19
|
'GC_GRACE_SECONDS': ps
|
|
20
20
|
},
|
|
21
|
-
'table-props-value': lambda x: {'GC_GRACE_SECONDS': ps}[x],
|
|
21
|
+
'table-props-value': lambda x: {None: None, 'GC_GRACE_SECONDS': ps}[x],
|
|
22
22
|
'export-database-types': lambda x: ['athena', 'sqlite', 'csv'],
|
|
23
23
|
'export-databases': lambda x: ExportDatabases.database_names(),
|
|
24
24
|
'export-sessions': lambda x: ExportSessions.export_session_names(state.sts, state.pod, state.namespace),
|
|
@@ -7,7 +7,7 @@ from adam.commands.commands_utils import show_table
|
|
|
7
7
|
from adam.utils_k8s.cassandra_clusters import CassandraClusters
|
|
8
8
|
from adam.utils_k8s.cassandra_nodes import CassandraNodes
|
|
9
9
|
from adam.utils_k8s.secrets import Secrets
|
|
10
|
-
from adam.pod_exec_result import PodExecResult
|
|
10
|
+
from adam.utils_k8s.pod_exec_result import PodExecResult
|
|
11
11
|
from adam.repl_state import ReplState
|
|
12
12
|
from adam.utils import log2, log_timing, wait_log
|
|
13
13
|
from adam.utils_k8s.statefulsets import StatefulSets
|
|
@@ -55,7 +55,7 @@ def table_spec(state: ReplState, table: str, on_any=False) -> 'TableSpec':
|
|
|
55
55
|
|
|
56
56
|
return parse_cql_desc_table(r.stdout if state.pod else r[0].stdout)
|
|
57
57
|
|
|
58
|
-
def run_cql(state: ReplState, cql: str, opts: list = [], show_out = False, show_query = False, use_single_quotes = False, on_any = False, backgrounded=False, log_file=None) -> list[PodExecResult]:
|
|
58
|
+
def run_cql(state: ReplState, cql: str, opts: list = [], show_out = False, show_query = False, use_single_quotes = False, on_any = False, backgrounded=False, log_file=None, history=True) -> list[PodExecResult]:
|
|
59
59
|
if show_query:
|
|
60
60
|
log2(cql)
|
|
61
61
|
|
|
@@ -69,7 +69,7 @@ def run_cql(state: ReplState, cql: str, opts: list = [], show_out = False, show_
|
|
|
69
69
|
|
|
70
70
|
with log_timing(cql):
|
|
71
71
|
with cassandra(state) as pods:
|
|
72
|
-
return pods.exec(command, action='cql', show_out=show_out, on_any=on_any, backgrounded=backgrounded, log_file=log_file)
|
|
72
|
+
return pods.exec(command, action='cql', show_out=show_out, on_any=on_any, backgrounded=backgrounded, log_file=log_file, history=history)
|
|
73
73
|
|
|
74
74
|
def parse_cql_desc_tables(out: str):
|
|
75
75
|
# Keyspace data_endpoint_auth
|
|
@@ -227,16 +227,16 @@ class CassandraPodService:
|
|
|
227
227
|
def __init__(self, handler: 'CassandraExecHandler'):
|
|
228
228
|
self.handler = handler
|
|
229
229
|
|
|
230
|
-
def exec(self, command: str, action='bash', show_out = True, on_any = False, throw_err = False, shell = '/bin/sh', backgrounded = False, log_file = None) -> Union[PodExecResult, list[PodExecResult]]:
|
|
230
|
+
def exec(self, command: str, action='bash', show_out = True, on_any = False, throw_err = False, shell = '/bin/sh', backgrounded = False, log_file = None, history=True) -> Union[PodExecResult, list[PodExecResult]]:
|
|
231
231
|
state = self.handler.state
|
|
232
232
|
pod = self.handler.pod
|
|
233
233
|
|
|
234
234
|
if pod:
|
|
235
235
|
return CassandraNodes.exec(pod, state.namespace, command,
|
|
236
|
-
show_out=show_out, throw_err=throw_err, shell=shell, backgrounded=backgrounded, log_file=log_file)
|
|
236
|
+
show_out=show_out, throw_err=throw_err, shell=shell, backgrounded=backgrounded, log_file=log_file, history=history)
|
|
237
237
|
elif state.sts:
|
|
238
238
|
return CassandraClusters.exec(state.sts, state.namespace, command, action=action,
|
|
239
|
-
show_out=show_out, on_any=on_any, shell=shell, backgrounded=backgrounded, log_file=log_file)
|
|
239
|
+
show_out=show_out, on_any=on_any, shell=shell, backgrounded=backgrounded, log_file=log_file, history=history)
|
|
240
240
|
|
|
241
241
|
return []
|
|
242
242
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from adam.commands.command import Command
|
|
2
|
+
from adam.commands.debug.debug_completes import DebugCompletes
|
|
3
|
+
from adam.commands.debug.debug_timings import DebugTimings
|
|
4
|
+
from adam.commands.intermediate_command import IntermediateCommand
|
|
5
|
+
|
|
6
|
+
class Debug(IntermediateCommand):
|
|
7
|
+
COMMAND = 'debug'
|
|
8
|
+
|
|
9
|
+
# the singleton pattern
|
|
10
|
+
def __new__(cls, *args, **kwargs):
|
|
11
|
+
if not hasattr(cls, 'instance'): cls.instance = super(Debug, cls).__new__(cls)
|
|
12
|
+
|
|
13
|
+
return cls.instance
|
|
14
|
+
|
|
15
|
+
def __init__(self, successor: Command=None):
|
|
16
|
+
super().__init__(successor)
|
|
17
|
+
|
|
18
|
+
def command(self):
|
|
19
|
+
return Debug.COMMAND
|
|
20
|
+
|
|
21
|
+
def cmd_list(self):
|
|
22
|
+
return [DebugTimings(), DebugCompletes()]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from adam.commands import validate_args
|
|
2
|
+
from adam.commands.command import Command
|
|
3
|
+
from adam.config import Config
|
|
4
|
+
from adam.repl_state import ReplState
|
|
5
|
+
|
|
6
|
+
class DebugCompletes(Command):
|
|
7
|
+
COMMAND = 'debug completes'
|
|
8
|
+
|
|
9
|
+
# the singleton pattern
|
|
10
|
+
def __new__(cls, *args, **kwargs):
|
|
11
|
+
if not hasattr(cls, 'instance'): cls.instance = super(DebugCompletes, cls).__new__(cls)
|
|
12
|
+
|
|
13
|
+
return cls.instance
|
|
14
|
+
|
|
15
|
+
def __init__(self, successor: Command=None):
|
|
16
|
+
super().__init__(successor)
|
|
17
|
+
|
|
18
|
+
def command(self):
|
|
19
|
+
return DebugCompletes.COMMAND
|
|
20
|
+
|
|
21
|
+
def run(self, cmd: str, state: ReplState):
|
|
22
|
+
if not(args := self.args(cmd)):
|
|
23
|
+
return super().run(cmd, state)
|
|
24
|
+
|
|
25
|
+
with self.validate(args, state) as (args, state):
|
|
26
|
+
with validate_args(args, state, name='on, off or file') as args:
|
|
27
|
+
Config().set('debugs.complete', args)
|
|
28
|
+
|
|
29
|
+
return state
|
|
30
|
+
|
|
31
|
+
def completion(self, state: ReplState):
|
|
32
|
+
return super().completion(state, {f: None for f in ['on', 'off', 'file']})
|
|
33
|
+
|
|
34
|
+
def help(self, _: ReplState):
|
|
35
|
+
return f'{DebugCompletes.COMMAND} on|off|file\t turn auto complete debug on or off'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from adam.commands import validate_args
|
|
2
|
+
from adam.commands.command import Command
|
|
3
|
+
from adam.config import Config
|
|
4
|
+
from adam.repl_state import ReplState
|
|
5
|
+
|
|
6
|
+
class DebugTimings(Command):
|
|
7
|
+
COMMAND = 'debug timings'
|
|
8
|
+
|
|
9
|
+
# the singleton pattern
|
|
10
|
+
def __new__(cls, *args, **kwargs):
|
|
11
|
+
if not hasattr(cls, 'instance'): cls.instance = super(DebugTimings, cls).__new__(cls)
|
|
12
|
+
|
|
13
|
+
return cls.instance
|
|
14
|
+
|
|
15
|
+
def __init__(self, successor: Command=None):
|
|
16
|
+
super().__init__(successor)
|
|
17
|
+
|
|
18
|
+
def command(self):
|
|
19
|
+
return DebugTimings.COMMAND
|
|
20
|
+
|
|
21
|
+
def run(self, cmd: str, state: ReplState):
|
|
22
|
+
if not(args := self.args(cmd)):
|
|
23
|
+
return super().run(cmd, state)
|
|
24
|
+
|
|
25
|
+
with self.validate(args, state) as (args, state):
|
|
26
|
+
with validate_args(args, state, name='on, off or file') as args:
|
|
27
|
+
Config().set('debugs.timings', args)
|
|
28
|
+
|
|
29
|
+
return state
|
|
30
|
+
|
|
31
|
+
def completion(self, state: ReplState):
|
|
32
|
+
return super().completion(state, {f: None for f in ['on', 'off', 'file']})
|
|
33
|
+
|
|
34
|
+
def help(self, _: ReplState):
|
|
35
|
+
return f'{DebugTimings.COMMAND} on|off|file\t turn timing debug on or off'
|
|
@@ -2,7 +2,7 @@ from abc import abstractmethod
|
|
|
2
2
|
|
|
3
3
|
from adam.commands.command import Command
|
|
4
4
|
from adam.config import Config
|
|
5
|
-
from adam.pod_exec_result import PodExecResult
|
|
5
|
+
from adam.utils_k8s.pod_exec_result import PodExecResult
|
|
6
6
|
from adam.repl_state import BashSession, ReplState
|
|
7
7
|
from adam.utils import log2
|
|
8
8
|
from adam.utils_k8s.pods import Pods
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from adam.commands.command import Command
|
|
2
2
|
from adam.commands.devices.devices import Devices
|
|
3
3
|
from adam.config import Config
|
|
4
|
-
from adam.pod_exec_result import PodExecResult
|
|
4
|
+
from adam.utils_k8s.pod_exec_result import PodExecResult
|
|
5
5
|
from adam.utils import log2
|
|
6
6
|
from adam.utils_k8s.cassandra_nodes import CassandraNodes
|
|
7
7
|
from adam.repl_state import ReplState, RequiredState
|
|
@@ -31,7 +31,7 @@ class DownloadCassandraLog(Command):
|
|
|
31
31
|
|
|
32
32
|
with self.validate(args, state) as (args, state):
|
|
33
33
|
path = Config().get('logs.path', '/c3/cassandra/logs/system.log')
|
|
34
|
-
r: PodExecResult = CassandraNodes.exec(state.pod, state.namespace, f'cat {path}', backgrounded=True,
|
|
34
|
+
r: PodExecResult = CassandraNodes.exec(state.pod, state.namespace, f'cat {path}', backgrounded=True, history=False)
|
|
35
35
|
|
|
36
36
|
to_file = Pods.download_file(state.pod, 'cassandra', state.namespace, path)
|
|
37
37
|
log2(f'Downloaded to {to_file}.')
|
|
@@ -5,6 +5,7 @@ import boto3
|
|
|
5
5
|
|
|
6
6
|
from adam.commands.export.export_sessions import ExportSessions
|
|
7
7
|
from adam.commands.export.importer import Importer
|
|
8
|
+
from adam.commands.export.utils_export import export_log_dir
|
|
8
9
|
from adam.config import Config
|
|
9
10
|
from adam.repl_session import ReplSession
|
|
10
11
|
from adam.repl_state import ReplState
|
|
@@ -197,8 +198,7 @@ class ExportDatabaseService:
|
|
|
197
198
|
database = self.handler.state.export_session
|
|
198
199
|
|
|
199
200
|
def output(out: str):
|
|
200
|
-
|
|
201
|
-
log_file = f'{log_prefix}-{datetime.now().strftime("%d%H%M%S")}-export.log'
|
|
201
|
+
log_file = f'{export_log_dir()}/{datetime.now().strftime("%d%H%M%S")}-export.log'
|
|
202
202
|
|
|
203
203
|
with open(log_file, 'w') as f:
|
|
204
204
|
f.write(out)
|
|
@@ -3,14 +3,14 @@ import os
|
|
|
3
3
|
import re
|
|
4
4
|
|
|
5
5
|
from adam.commands.export.importer import Importer
|
|
6
|
-
from adam.commands.export.utils_export import ExportTableStatus, csv_dir, find_files
|
|
6
|
+
from adam.commands.export.utils_export import ExportTableStatus, csv_dir, export_log_dir, find_files, os_system_exec
|
|
7
7
|
from adam.config import Config
|
|
8
8
|
from adam.repl_state import ReplState
|
|
9
9
|
from adam.utils import log2, tabulize, log, parallelize
|
|
10
10
|
from adam.utils_k8s.cassandra_nodes import CassandraNodes
|
|
11
|
-
from adam.utils_k8s.pods import Pods
|
|
11
|
+
from adam.utils_k8s.pods import Pods
|
|
12
12
|
from adam.utils_k8s.statefulsets import StatefulSets
|
|
13
|
-
from adam.utils_local import
|
|
13
|
+
from adam.utils_local import local_downloads_dir
|
|
14
14
|
|
|
15
15
|
class ExportSessions:
|
|
16
16
|
def clear_export_session_cache():
|
|
@@ -36,13 +36,13 @@ class ExportSessions:
|
|
|
36
36
|
|
|
37
37
|
prefix = Importer.prefix_from_importer(importer)
|
|
38
38
|
|
|
39
|
-
log_files: list[str] = find_files(pod, namespace, f'{
|
|
39
|
+
log_files: list[str] = find_files(pod, namespace, f'{export_log_dir()}/{prefix}*_*.log*')
|
|
40
40
|
|
|
41
41
|
if not log_files:
|
|
42
42
|
return {}
|
|
43
43
|
|
|
44
44
|
for log_file in log_files[:limit]:
|
|
45
|
-
m = re.match(f'{
|
|
45
|
+
m = re.match(f'{export_log_dir()}/([ces].*?)_.*\.log?(.*)', log_file)
|
|
46
46
|
if m:
|
|
47
47
|
s = m.group(1)
|
|
48
48
|
state = m.group(2) # '', '.pending_import', '.done'
|
|
@@ -66,7 +66,8 @@ class ExportSessions:
|
|
|
66
66
|
pod = StatefulSets.pod_names(sts, namespace)[0]
|
|
67
67
|
|
|
68
68
|
CassandraNodes.exec(pod, namespace, f'rm -rf {csv_dir()}/*', show_out=Config().is_debug(), shell='bash')
|
|
69
|
-
|
|
69
|
+
cmd = f'rm -rf {export_log_dir()}/*.log*'
|
|
70
|
+
os_system_exec(cmd, show_out=Config().is_debug())
|
|
70
71
|
|
|
71
72
|
return True
|
|
72
73
|
|
|
@@ -102,17 +103,18 @@ class ExportSessions:
|
|
|
102
103
|
csv_cnt = 0
|
|
103
104
|
log_cnt = 0
|
|
104
105
|
|
|
105
|
-
log_files: list[str] = find_files(pod, namespace, f'{
|
|
106
|
+
log_files: list[str] = find_files(pod, namespace, f'{export_log_dir()}/{session}_*.log*')
|
|
106
107
|
|
|
107
108
|
for log_file in log_files:
|
|
108
|
-
m = re.match(f'{
|
|
109
|
+
m = re.match(f'{export_log_dir()}/{session}_(.*?)\.(.*?)\.log.*', log_file)
|
|
109
110
|
if m:
|
|
110
111
|
table = m.group(2)
|
|
111
112
|
|
|
112
113
|
CassandraNodes.exec(pod, namespace, f'rm -rf {csv_dir()}/{session}_{table}', show_out=not multi_tables, shell='bash')
|
|
113
114
|
csv_cnt += 1
|
|
114
115
|
|
|
115
|
-
|
|
116
|
+
cmd = f'rm -rf {log_file}'
|
|
117
|
+
os_system_exec(cmd, show_out=not multi_tables)
|
|
116
118
|
log_cnt += 1
|
|
117
119
|
|
|
118
120
|
return csv_cnt, log_cnt
|
|
@@ -142,8 +144,7 @@ class ExportSessions:
|
|
|
142
144
|
def download_csv(table):
|
|
143
145
|
from_path: str = table.csv_file
|
|
144
146
|
|
|
145
|
-
to_path = from_path.replace(csv_dir(),
|
|
146
|
-
os.makedirs(os.path.dirname(to_path), exist_ok=True)
|
|
147
|
+
to_path = from_path.replace(csv_dir(), local_downloads_dir())
|
|
147
148
|
Pods.download_file(pod, 'cassandra', namespace, from_path, to_path)
|
|
148
149
|
|
|
149
150
|
log2(f'[{session}] Downloaded to {to_path}.')
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
+
import os
|
|
2
3
|
import time
|
|
4
|
+
import traceback
|
|
3
5
|
|
|
4
6
|
from adam.commands.command import InvalidArgumentsException
|
|
5
7
|
from adam.commands.cql.utils_cql import cassandra_table_names, run_cql, table_spec
|
|
@@ -8,13 +10,12 @@ from adam.commands.export.export_sessions import ExportSessions
|
|
|
8
10
|
from adam.commands.export.importer import Importer
|
|
9
11
|
from adam.commands.export.importer_athena import AthenaImporter
|
|
10
12
|
from adam.commands.export.importer_sqlite import SqliteImporter
|
|
11
|
-
from adam.commands.export.utils_export import ExportSpec, ExportTableStatus, ExportTableSpec, ImportSpec, csv_dir, find_files, state_with_pod
|
|
13
|
+
from adam.commands.export.utils_export import ExportSpec, ExportTableStatus, ExportTableSpec, ImportSpec, csv_dir, export_log_dir, find_files, os_system_exec, state_with_pod
|
|
12
14
|
from adam.config import Config
|
|
13
|
-
from adam.
|
|
15
|
+
from adam.repl_session import ReplSession
|
|
14
16
|
from adam.repl_state import ReplState
|
|
15
|
-
from adam.utils import debug, log, parallelize, log2, ing, log_exc
|
|
17
|
+
from adam.utils import debug, kaqing_log_file_name, log, offload, parallelize, log2, ing, log_exc
|
|
16
18
|
from adam.utils_k8s.cassandra_nodes import CassandraNodes
|
|
17
|
-
from adam.utils_k8s.pods import log_prefix
|
|
18
19
|
|
|
19
20
|
class Exporter:
|
|
20
21
|
def export_tables(args: list[str], state: ReplState, export_only: bool = False, max_workers = 0) -> tuple[list[str], ExportSpec]:
|
|
@@ -133,11 +134,9 @@ class Exporter:
|
|
|
133
134
|
|
|
134
135
|
prefix = Importer.prefix_from_importer(spec.importer)
|
|
135
136
|
if spec.session:
|
|
136
|
-
|
|
137
|
+
state.export_session = f'{prefix}{spec.session[1:]}'
|
|
137
138
|
else:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
state.export_session = spec.session
|
|
139
|
+
state.export_session = f'{prefix}{datetime.now().strftime("%Y%m%d%H%M%S")[3:]}'
|
|
141
140
|
|
|
142
141
|
return spec
|
|
143
142
|
|
|
@@ -154,89 +153,160 @@ class Exporter:
|
|
|
154
153
|
if export_state == 'init':
|
|
155
154
|
CassandraNodes.exec(state.pod, state.namespace, f'rm -rf {csv_dir()}/{spec.session}_*', show_out=Config().is_debug(), shell='bash')
|
|
156
155
|
|
|
157
|
-
|
|
156
|
+
job_log = kaqing_log_file_name()
|
|
157
|
+
|
|
158
|
+
action = f'[{spec.session}] Triggering export of'
|
|
158
159
|
if export_state == 'init':
|
|
159
160
|
action = f'[{spec.session}] Preparing|Prepared'
|
|
160
161
|
elif export_state == 'import':
|
|
161
162
|
action = f'[{spec.session}] Importing|Imported'
|
|
162
163
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
msg = action + ' {size} Cassandra tables'
|
|
165
|
+
|
|
166
|
+
if export_state != 'init':
|
|
167
|
+
log2(f'[{spec.session}] Logging to {job_log}...')
|
|
168
|
+
ReplSession().append_history(f':sh cat {job_log}')
|
|
169
|
+
|
|
170
|
+
pod = state.pod
|
|
171
|
+
with parallelize(spec.tables, max_workers, msg=msg, collect=export_state == 'init', name='exporter') as exec:
|
|
172
|
+
return exec.map(lambda table: Exporter.export_table(table,
|
|
173
|
+
state.with_pod(pod),
|
|
174
|
+
spec.session,
|
|
175
|
+
spec.importer,
|
|
176
|
+
export_only,
|
|
177
|
+
len(spec.tables) > 1,
|
|
178
|
+
consistency=spec.consistency,
|
|
179
|
+
export_state=export_state,
|
|
180
|
+
job_log=None if export_state == 'init' else job_log)), spec
|
|
181
|
+
|
|
182
|
+
def export_table(spec: ExportTableSpec,
|
|
183
|
+
state: ReplState,
|
|
184
|
+
session: str,
|
|
185
|
+
importer: str,
|
|
186
|
+
export_only = False,
|
|
187
|
+
multi_tables = True,
|
|
188
|
+
consistency: str = None,
|
|
189
|
+
export_state=None,
|
|
190
|
+
job_log: str = None):
|
|
167
191
|
s: str = None
|
|
168
192
|
|
|
169
193
|
table, target_table, columns = Exporter.resove_table_n_columns(spec, state, include_ks_in_target=False, importer=importer)
|
|
170
194
|
|
|
171
|
-
log_file = f'{
|
|
195
|
+
log_file = f'{export_log_dir()}/{session}_{spec.keyspace}.{target_table}.log'
|
|
172
196
|
create_db = not state.export_session
|
|
173
197
|
|
|
174
198
|
if export_state == 'init':
|
|
175
199
|
Exporter.create_table_log(spec, state, session, table, target_table)
|
|
176
200
|
return 'table_log_created'
|
|
177
201
|
else:
|
|
178
|
-
|
|
179
|
-
|
|
202
|
+
try:
|
|
203
|
+
if export_state == 'pending_export':
|
|
204
|
+
Exporter.export_to_csv(spec, state, session, table, target_table, columns, multi_tables=multi_tables, consistency=consistency, job_log=job_log)
|
|
180
205
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
206
|
+
log_files: list[str] = find_files(state.pod, state.namespace, f'{log_file}*')
|
|
207
|
+
if not log_files:
|
|
208
|
+
return s
|
|
184
209
|
|
|
185
|
-
|
|
210
|
+
log_file = log_files[0]
|
|
186
211
|
|
|
187
|
-
|
|
188
|
-
while status.status != 'done':
|
|
189
|
-
if status.status == 'export_in_pregress':
|
|
190
|
-
debug('Exporting to CSV is still in progess, sleeping for 1 sec...')
|
|
191
|
-
time.sleep(1)
|
|
192
|
-
elif status.status == 'exported':
|
|
193
|
-
log_file = Exporter.rename_to_pending_import(spec, state, session, target_table)
|
|
194
|
-
if importer == 'csv' or export_only:
|
|
195
|
-
return 'pending_import'
|
|
196
|
-
elif status.status == 'pending_import':
|
|
197
|
-
log_file, session = Exporter.import_from_csv(spec, state, session, importer, table, target_table, columns, multi_tables=multi_tables, create_db=create_db)
|
|
212
|
+
status: ExportTableStatus = ExportTableStatus.from_log_file(state.pod, state.namespace, session, log_file)
|
|
198
213
|
|
|
199
|
-
|
|
214
|
+
with offload(name='exporter') as exec:
|
|
215
|
+
ctx = ExportTableContext(spec, state, session, importer, export_only, multi_tables, table, target_table, columns, create_db, log_file, status, job_log)
|
|
216
|
+
exec.submit(lambda: Exporter.export_loop(ctx))
|
|
217
|
+
# Exporter.export_loop(ExportTableContext(spec, state, session, importer, export_only, multi_tables, table, target_table, columns, create_db, log_file, status))
|
|
218
|
+
except:
|
|
219
|
+
traceback.print_exc()
|
|
200
220
|
|
|
201
221
|
return status.status
|
|
202
222
|
|
|
223
|
+
def export_loop(ctx: 'ExportTableContext'):
|
|
224
|
+
try:
|
|
225
|
+
while ctx.status.status != 'done':
|
|
226
|
+
if ctx.status.status == 'export_in_pregress':
|
|
227
|
+
debug('Exporting to CSV is still in progess, sleeping for 1 sec...')
|
|
228
|
+
time.sleep(1)
|
|
229
|
+
elif ctx.status.status == 'exported':
|
|
230
|
+
ctx.log_file = Exporter.rename_to_pending_import(ctx.spec, ctx.state, ctx.session, ctx.target_table)
|
|
231
|
+
ExportSessions.clear_export_session_cache()
|
|
232
|
+
if ctx.importer == 'csv' or ctx.export_only:
|
|
233
|
+
return 'pending_import'
|
|
234
|
+
elif ctx.status.status == 'pending_import':
|
|
235
|
+
ctx.log_file, ctx.session = Exporter.import_from_csv(ctx.spec,
|
|
236
|
+
ctx.state,
|
|
237
|
+
ctx.session,
|
|
238
|
+
ctx.importer,
|
|
239
|
+
ctx.table,
|
|
240
|
+
ctx.target_table,
|
|
241
|
+
ctx.columns,
|
|
242
|
+
multi_tables=ctx.multi_tables,
|
|
243
|
+
create_db=ctx.create_db,
|
|
244
|
+
job_log=ctx.f)
|
|
245
|
+
|
|
246
|
+
ctx.status = ExportTableStatus.from_log_file(ctx.state.pod, ctx.state.namespace, ctx.session, ctx.log_file)
|
|
247
|
+
|
|
248
|
+
return ctx.status.status
|
|
249
|
+
except:
|
|
250
|
+
traceback.print_exc()
|
|
251
|
+
|
|
203
252
|
def create_table_log(spec: ExportTableSpec, state: ReplState, session: str, table: str, target_table: str):
|
|
204
|
-
log_file = f'{
|
|
253
|
+
log_file = f'{export_log_dir()}/{session}_{spec.keyspace}.{target_table}.log'
|
|
254
|
+
dir = os.path.dirname(log_file)
|
|
205
255
|
|
|
206
|
-
|
|
256
|
+
cmd = f'rm -f {log_file}* && mkdir -p {dir} && touch {log_file}'
|
|
257
|
+
os_system_exec(cmd, show_out=Config().is_debug())
|
|
207
258
|
|
|
208
259
|
return table
|
|
209
260
|
|
|
210
|
-
def export_to_csv(spec: ExportTableSpec,
|
|
261
|
+
def export_to_csv(spec: ExportTableSpec,
|
|
262
|
+
state: ReplState,
|
|
263
|
+
session: str,
|
|
264
|
+
table: str,
|
|
265
|
+
target_table: str,
|
|
266
|
+
columns: str,
|
|
267
|
+
multi_tables = True,
|
|
268
|
+
consistency: str = None,
|
|
269
|
+
job_log: str = None):
|
|
211
270
|
db = f'{session}_{target_table}'
|
|
212
271
|
|
|
213
272
|
CassandraNodes.exec(state.pod, state.namespace, f'mkdir -p {csv_dir()}/{db}', show_out=Config().is_debug(), shell='bash')
|
|
214
273
|
csv_file = f'{csv_dir()}/{db}/{table}.csv'
|
|
215
|
-
|
|
274
|
+
table_log_file = f'{export_log_dir()}/{session}_{spec.keyspace}.{target_table}.log'
|
|
216
275
|
|
|
217
276
|
suppress_ing_log = Config().is_debug() or multi_tables
|
|
218
277
|
queries = []
|
|
219
278
|
if consistency:
|
|
220
279
|
queries.append(f'CONSISTENCY {consistency}')
|
|
221
280
|
queries.append(f"COPY {spec.keyspace}.{table}({columns}) TO '{csv_file}' WITH HEADER = TRUE")
|
|
222
|
-
r: PodExecResult = ing(
|
|
223
|
-
f'[{session}] Dumping table {spec.keyspace}.{table}{f" with consistency {consistency}" if consistency else ""}',
|
|
224
|
-
lambda: run_cql(state, ';'.join(queries), show_out=Config().is_debug(), backgrounded=True, log_file=log_file),
|
|
225
|
-
suppress_log=suppress_ing_log)
|
|
226
281
|
|
|
227
|
-
|
|
282
|
+
with ing(f'[{session}] Triggering dump of table {spec.keyspace}.{table}{f" with consistency {consistency}" if consistency else ""}',
|
|
283
|
+
suppress_log=suppress_ing_log,
|
|
284
|
+
job_log = job_log):
|
|
285
|
+
run_cql(state, ';'.join(queries), show_out=Config().is_debug(), backgrounded=True, log_file=table_log_file, history=False)
|
|
286
|
+
|
|
287
|
+
return table_log_file
|
|
228
288
|
|
|
229
289
|
def rename_to_pending_import(spec: ExportTableSpec, state: ReplState, session: str, target_table: str):
|
|
230
|
-
log_file = f'{
|
|
290
|
+
log_file = f'{export_log_dir()}/{session}_{spec.keyspace}.{target_table}.log'
|
|
231
291
|
to = f'{log_file}.pending_import'
|
|
232
292
|
|
|
233
|
-
|
|
293
|
+
cmd =f'mv {log_file} {to}'
|
|
294
|
+
os_system_exec(cmd, show_out=Config().is_debug())
|
|
234
295
|
|
|
235
296
|
return to
|
|
236
297
|
|
|
237
|
-
def import_from_csv(spec: ExportTableSpec,
|
|
298
|
+
def import_from_csv(spec: ExportTableSpec,
|
|
299
|
+
state: ReplState,
|
|
300
|
+
session: str,
|
|
301
|
+
importer: str,
|
|
302
|
+
table: str,
|
|
303
|
+
target_table: str,
|
|
304
|
+
columns: str,
|
|
305
|
+
multi_tables = True,
|
|
306
|
+
create_db = False,
|
|
307
|
+
job_log: str = None):
|
|
238
308
|
im = AthenaImporter() if importer == 'athena' else SqliteImporter()
|
|
239
|
-
return im.import_from_csv(state, session if session else state.export_session, spec.keyspace, table, target_table, columns, multi_tables, create_db)
|
|
309
|
+
return im.import_from_csv(state, session if session else state.export_session, spec.keyspace, table, target_table, columns, multi_tables, create_db, job_log=job_log)
|
|
240
310
|
|
|
241
311
|
def resove_table_n_columns(spec: ExportTableSpec, state: ReplState, include_ks_in_target = False, importer = 'sqlite'):
|
|
242
312
|
table = spec.table
|
|
@@ -262,6 +332,22 @@ class Exporter:
|
|
|
262
332
|
|
|
263
333
|
return table, target_table, columns
|
|
264
334
|
|
|
335
|
+
class ExportTableContext:
|
|
336
|
+
def __init__(self, spec: ExportTableSpec, state: ReplState, session: str, importer: str, export_only = False, multi_tables = True, table: str = None, target_table: str = None, columns: str = None, create_db = False, log_file: str = None, status: ExportTableStatus = None, f: str = None):
|
|
337
|
+
self.spec = spec
|
|
338
|
+
self.state = state
|
|
339
|
+
self.session = session
|
|
340
|
+
self.importer = importer
|
|
341
|
+
self.export_only = export_only
|
|
342
|
+
self.multi_tables = multi_tables
|
|
343
|
+
self.table = table
|
|
344
|
+
self.target_table = target_table
|
|
345
|
+
self.columns = columns
|
|
346
|
+
self.create_db = create_db
|
|
347
|
+
self.log_file = log_file
|
|
348
|
+
self.status = status
|
|
349
|
+
self.f = f
|
|
350
|
+
|
|
265
351
|
class ExportService:
|
|
266
352
|
def __init__(self, handler: 'ExporterHandler'):
|
|
267
353
|
self.handler = handler
|
|
@@ -279,16 +365,17 @@ class ExportService:
|
|
|
279
365
|
|
|
280
366
|
ExportSessions.clear_export_session_cache()
|
|
281
367
|
|
|
282
|
-
if spec.importer == 'csv' or export_only:
|
|
283
|
-
|
|
284
|
-
else:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
368
|
+
# if spec.importer == 'csv' or export_only:
|
|
369
|
+
# ExportSessions.show_session(state.sts, state.pod, state.namespace, spec.session)
|
|
370
|
+
# else:
|
|
371
|
+
# log()
|
|
372
|
+
# with export_db(state) as dbs:
|
|
373
|
+
# dbs.show_database()
|
|
288
374
|
finally:
|
|
375
|
+
pass
|
|
289
376
|
# if exporting to csv, do not bind the new session id to repl state
|
|
290
|
-
if spec and spec.importer == 'csv':
|
|
291
|
-
|
|
377
|
+
# if spec and spec.importer == 'csv':
|
|
378
|
+
# state.export_session = export_session
|
|
292
379
|
|
|
293
380
|
return state
|
|
294
381
|
|