* Copyright (c) 2026 Huawei Technologies Co., Ltd.
* openFuyao is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
package types
type ByteRange struct {
RelativePath string `json:"relativePath"`
Start int64 `json:"start"`
End int64 `json:"end"`
RelayOffset int64 `json:"relayOffset,omitempty"`
}
type SourceEndpoint struct {
SourceID string `json:"sourceID"`
SourceType string `json:"sourceType"`
NodeName string `json:"nodeName,omitempty"`
Endpoint string `json:"endpoint"`
Path string `json:"path"`
AccessToken string `json:"accessToken,omitempty"`
RelayRDMA *RelayRDMAHint `json:"relayRDMA,omitempty"`
}
type SourceSegmentPlan struct {
SourceID string `json:"sourceID"`
SourceEndpoint SourceEndpoint `json:"sourceEndpoint"`
ByteRanges []ByteRange `json:"byteRanges,omitempty"`
Weight int32 `json:"weight,omitempty"`
MaxParallelism int32 `json:"maxParallelism,omitempty"`
}
type TopologyHints struct {
NetworkDomain string `json:"networkDomain,omitempty"`
SameRack bool `json:"sameRack,omitempty"`
SuggestedQPS int32 `json:"suggestedQps,omitempty"`
}
type TargetTransferPlan struct {
TargetNode string `json:"targetNode"`
TransferMode TransferMode `json:"transferMode"`
SourceSegments []SourceSegmentPlan `json:"sourceSegments"`
FallbackSources []SourceEndpoint `json:"fallbackSources,omitempty"`
TopologyHints TopologyHints `json:"topologyHints,omitempty"`
}
type WarmupDistributionPlan struct {
PlanID string `json:"planID"`
Strategy DistributionStrategy `json:"strategy"`
EstimatedMs int64 `json:"estimatedMs,omitempty"`
TargetPlans []TargetTransferPlan `json:"targetPlans"`
}
type TransferSpec struct {
TaskID string `json:"taskID"`
ArtifactKey string `json:"artifactKey"`
TransferMode TransferMode `json:"transferMode"`
LogicalManifest LogicalManifest `json:"logicalManifest"`
CollectiveSpec CollectiveSpec `json:"collectiveSpec,omitempty"`
SourceSegments []SourceSegmentPlan `json:"sourceSegments"`
FallbackSources []SourceEndpoint `json:"fallbackSources,omitempty"`
TargetTempPath string `json:"targetTempPath"`
TargetFinalPath string `json:"targetFinalPath"`
PreserveExisting bool `json:"preserveExisting,omitempty"`
ForceSyncClose bool `json:"forceSyncClose,omitempty"`
EnableChunkCRC32C bool `json:"enableChunkCRC32C,omitempty"`
ChunkSizeBytes int64 `json:"chunkSizeBytes"`
Parallelism int32 `json:"parallelism,omitempty"`
RetryLimit int32 `json:"retryLimit,omitempty"`
TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
}
type TransferredChunk struct {
ChunkID string `json:"chunkID"`
FilePath string `json:"filePath"`
RelativePath string `json:"relativePath"`
Offset int64 `json:"offset"`
Size int64 `json:"size"`
CRC32C string `json:"crc32c,omitempty"`
SourceID string `json:"sourceID,omitempty"`
}
type TransferResult struct {
TaskID string `json:"taskID"`
TempPath string `json:"tempPath"`
BytesTransferred int64 `json:"bytesTransferred"`
ChunkCount int32 `json:"chunkCount"`
SucceededChunks int32 `json:"succeededChunks"`
FailedChunks int32 `json:"failedChunks"`
ThroughputMBps float64 `json:"throughputMBps"`
TransportPath TransportPath `json:"transportPath,omitempty"`
SourceID string `json:"sourceID,omitempty"`
StartedAt int64 `json:"startedAt"`
FinishedAt int64 `json:"finishedAt"`
TransferredChunks []TransferredChunk `json:"transferredChunks,omitempty"`
SolidifiedManifest *SolidifiedManifest `json:"solidifiedManifest,omitempty"`
}