MCPcopy Create free account
hub / github.com/Shopify/ghostferry / SerializeStateToJSON

Method SerializeStateToJSON

ferry.go:942–960  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

940}
941
942func (f *Ferry) SerializeStateToJSON() (string, error) {
943 if f.StateTracker == nil {
944 err := errors.New("no valid StateTracker")
945 return "", err
946 }
947 var binlogVerifyStore *BinlogVerifyStore = nil
948 if f.inlineVerifier != nil {
949 binlogVerifyStore = f.inlineVerifier.reverifyStore
950 }
951
952 serializedState := f.StateTracker.Serialize(f.Tables, binlogVerifyStore)
953
954 if f.Config.DoNotIncludeSchemaCacheInStateDump {
955 serializedState.LastKnownTableSchemaCache = nil
956 }
957
958 stateBytes, err := json.MarshalIndent(serializedState, "", " ")
959 return string(stateBytes), err
960}
961
962func (f *Ferry) Progress() *Progress {
963 s := &Progress{

Callers 2

ReportStateMethod · 0.95
ReportErrorMethod · 0.80

Calls 1

SerializeMethod · 0.45

Tested by

no test coverage detected