go.temporal.io/server/common/archiver/util.go
122 LOC · 64 covered · 58 uncovered · 29 ranges · 185 concepts · 17 introducers · 85 tests
File neighbourhood
The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.
Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.
package archiver
import (
"errors"
archiverspb "go.temporal.io/server/api/archiver/v1"
"go.temporal.io/server/common/log"
"go.temporal.io/server/common/log/tag"
)
var (
errEmptyNamespaceID = errors.New("field NamespaceId is empty")
errEmptyNamespace = errors.New("field Namespace is empty")
errEmptyWorkflowID = errors.New("field WorkflowId is empty")
errEmptyRunID = errors.New("field RunId is empty")
errInvalidPageSize = errors.New("field PageSize should be greater than 0")
errEmptyWorkflowTypeName = errors.New("field WorkflowTypeName is empty")
errEmptyStartTime = errors.New("field StartTime is empty")
errEmptyCloseTime = errors.New("field CloseTime is empty")
)
// TagLoggerWithArchiveHistoryRequestAndURI tags logger with fields in the archive history request and the URI
func TagLoggerWithArchiveHistoryRequestAndURI(logger log.Logger, request *ArchiveHistoryRequest, URI string) log.Logger {
util.go ×1
return log.With(
logger,
tag.ShardID(request.ShardID),
tag.ArchivalRequestNamespaceID(request.NamespaceID),
tag.ArchivalRequestNamespace(request.Namespace),
tag.ArchivalRequestWorkflowID(request.WorkflowID),
tag.ArchivalRequestRunID(request.RunID),
tag.ArchivalRequestBranchToken(request.BranchToken),
tag.ArchivalRequestNextEventID(request.NextEventID),
tag.ArchivalRequestCloseFailoverVersion(request.CloseFailoverVersion),
tag.ArchivalURI(URI),
)
}
// TagLoggerWithArchiveVisibilityRequestAndURI tags logger with fields in the archive visibility request and the URI
func TagLoggerWithArchiveVisibilityRequestAndURI(logger log.Logger, request *archiverspb.VisibilityRecord, URI string) log.Logger {
message.pb.go ×4
return log.With(
logger,
tag.ArchivalRequestNamespaceID(request.GetNamespaceId()),
tag.ArchivalRequestNamespace(request.GetNamespace()),
tag.ArchivalRequestWorkflowID(request.GetWorkflowId()),
tag.ArchivalRequestRunID(request.GetRunId()),
tag.ArchvialRequestWorkflowType(request.GetWorkflowTypeName()),
tag.ArchivalRequestCloseTimestamp(request.GetCloseTime()),
tag.ArchivalRequestStatus(request.GetStatus().String()),
tag.ArchivalURI(URI),
)
}
// ValidateHistoryArchiveRequest validates the archive history request
if request.NamespaceID == "" {
return errEmptyNamespaceID
}
}
return errEmptyRunID
}
return errEmptyNamespace
}
}
// ValidateGetRequest validates the get archived history request
if request.NamespaceID == "" {
return errEmptyNamespaceID
}
return errEmptyWorkflowID
}
return errEmptyRunID
}
}
}
// ValidateVisibilityArchivalRequest validates the archive visibility request
func ValidateVisibilityArchivalRequest(request *archiverspb.VisibilityRecord) error {
util.go ×1
if request.GetNamespaceId() == "" {
}
}
return errEmptyWorkflowID
}
return errEmptyRunID
}
return errEmptyWorkflowTypeName
}
return errEmptyStartTime
}
return errEmptyCloseTime
}
}
// ValidateQueryRequest validates the query visibility request
if request.NamespaceID == "" {
}
}
}