yugabyted

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright (c) YugabyteDB, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) YugabyteDB, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) YugabyteDB, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const VISUALIZER_METADATA_SCHEMA = "ybvoyager_visualizer"
View Source
const YUGABYTED_METADATA_TABLE_NAME = VISUALIZER_METADATA_SCHEMA + "." + "ybvoyager_visualizer_metadata"
View Source
const YUGABYTED_TABLE_METRICS_TABLE_NAME = VISUALIZER_METADATA_SCHEMA + "." + "ybvoyager_visualizer_table_metrics"

Variables

View Source
var MIGRATION_PHASE_MAP = map[string]int{
	"ASSESS MIGRATION": 1,
	"EXPORT SCHEMA":    2,
	"ANALYZE SCHEMA":   3,
	"EXPORT DATA":      4,
	"IMPORT SCHEMA":    5,
	"IMPORT DATA":      6,
}
View Source
var UPDATE_ROW_COUNT_STATUS_STR_TO_INT = map[string]int{
	"NOT STARTED": 0,
	"IN PROGRESS": 1,
	"DONE":        2,
	"COMPLETED":   3,
}

Functions

This section is empty.

Types

type MigrationEvent

type MigrationEvent struct {
	MigrationUUID       uuid.UUID `json:"migration_uuid"`
	MigrationPhase      int       `json:"migration_phase"`
	InvocationSequence  int       `json:"invocation_sequence"`
	MigrationDirectory  string    `json:"migration_dir"`
	DatabaseName        string    `json:"database_name"`
	SchemaName          string    `json:"schema_name"`
	Payload             string    `json:"payload"`
	DBType              string    `json:"db_type"`
	Status              string    `json:"status"`
	InvocationTimestamp string    `json:"invocation_timestamp"`
}

type VisualizerTableMetrics

type VisualizerTableMetrics struct {
	MigrationUUID       uuid.UUID `json:"migration_uuid"`
	TableName           string    `json:"table_name"`
	Schema              string    `json:"schema_name"`
	MigrationPhase      int       `json:"migration_phase"`
	Status              int       `json:"status"` //(0: NOT-STARTED, 1: IN-PROGRESS, 2: DONE, 3: COMPLETED)
	CountLiveRows       int64     `json:"count_live_rows"`
	CountTotalRows      int64     `json:"count_total_rows"`
	InvocationTimestamp string    `json:"invocation_timestamp"`
}

Table metrics for both Export and Import steps.

func CreateVisualzerDBTableMetrics

func CreateVisualzerDBTableMetrics(mUUID uuid.UUID,
	tableName string,
	schema string,
	phase int,
	status int,
	completedRows int64,
	totalRows int64,
	timestamp string) VisualizerTableMetrics

Create a table metrics struct

type YugabyteD

type YugabyteD struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(exportDir string) *YugabyteD

func (*YugabyteD) ExportSchemaCompleted

func (cp *YugabyteD) ExportSchemaCompleted(exportSchemaEvent *controlPlane.ExportSchemaCompletedEvent)

func (*YugabyteD) ExportSchemaStarted

func (cp *YugabyteD) ExportSchemaStarted(exportSchemaEvent *controlPlane.ExportSchemaStartedEvent)

func (*YugabyteD) Finalize

func (cp *YugabyteD) Finalize()

Wait for events to publish and Close the connection.

func (*YugabyteD) ImportSchemaCompleted

func (cp *YugabyteD) ImportSchemaCompleted(importSchemaEvent *controlPlane.ImportSchemaCompletedEvent)

func (*YugabyteD) ImportSchemaStarted

func (cp *YugabyteD) ImportSchemaStarted(importSchemaEvent *controlPlane.ImportSchemaStartedEvent)

func (*YugabyteD) Init

func (cp *YugabyteD) Init() error

Initialize the yugabyted DB for visualisation metadata

func (*YugabyteD) MigrationAssessmentCompleted added in v1.7.0

func (cp *YugabyteD) MigrationAssessmentCompleted(ev *controlPlane.MigrationAssessmentCompletedEvent)

func (*YugabyteD) MigrationAssessmentStarted added in v1.7.0

func (cp *YugabyteD) MigrationAssessmentStarted(ev *controlPlane.MigrationAssessmentStartedEvent)

func (*YugabyteD) MigrationEnded

func (cp *YugabyteD) MigrationEnded(migrationEndedEvent *controlPlane.MigrationEndedEvent)

func (*YugabyteD) SchemaAnalysisIterationCompleted

func (cp *YugabyteD) SchemaAnalysisIterationCompleted(schemaAnalysisReport *controlPlane.SchemaAnalysisIterationCompletedEvent)

func (*YugabyteD) SchemaAnalysisStarted

func (cp *YugabyteD) SchemaAnalysisStarted(schemaAnalysisEvent *controlPlane.SchemaAnalysisStartedEvent)

func (*YugabyteD) SnapshotExportCompleted

func (cp *YugabyteD) SnapshotExportCompleted(snapshotExportEvent *controlPlane.SnapshotExportCompletedEvent)

func (*YugabyteD) SnapshotExportStarted

func (cp *YugabyteD) SnapshotExportStarted(snapshotExportEvent *controlPlane.SnapshotExportStartedEvent)

func (*YugabyteD) SnapshotImportCompleted

func (cp *YugabyteD) SnapshotImportCompleted(snapshotImportEvent *controlPlane.SnapshotImportCompletedEvent)

func (*YugabyteD) SnapshotImportStarted

func (cp *YugabyteD) SnapshotImportStarted(snapshotImportEvent *controlPlane.SnapshotImportStartedEvent)

func (*YugabyteD) UpdateExportedRowCount

func (cp *YugabyteD) UpdateExportedRowCount(
	snapshotExportTablesMetrics []*controlPlane.UpdateExportedRowCountEvent)

func (*YugabyteD) UpdateImportedRowCount

func (cp *YugabyteD) UpdateImportedRowCount(
	snapshotImportTableMetrics []*controlPlane.UpdateImportedRowCountEvent)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL