Initial project source
这个提交包含在:
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api-bom</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>${revision}</version>
|
||||
|
||||
<description>
|
||||
aixun-api-bom api依赖项
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<revision>1.0.0</revision>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- 系统接口 -->
|
||||
<dependency>
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api-system</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 资源服务接口 -->
|
||||
<dependency>
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api-resource</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- workflow接口 -->
|
||||
<dependency>
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api-workflow</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- DataGov business-unit boundaries -->
|
||||
<dependency>
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api-integration</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api-dataops</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api-governance</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api-dataproduct</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>aixun-api-dataops</artifactId>
|
||||
<description>DataGov data operations unit public contracts</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.aixunkeji</groupId>
|
||||
<artifactId>aixun-api-integration</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package cn.aixunkeji.datagov.dataops.api;
|
||||
|
||||
/** Stable deployment and routing coordinates for the data operations unit. */
|
||||
public final class DataOpsBoundary {
|
||||
|
||||
public static final String UNIT = "dataops";
|
||||
public static final String SERVICE_NAME = "aixun-dataops";
|
||||
public static final String NACOS_DATA_ID = "aixun-dataops.yml";
|
||||
public static final String GATEWAY_PATH = "/api/dataops/**";
|
||||
public static final String REST_BASE_PATH = "/api/dataops/v1";
|
||||
public static final String PERMISSION_NAMESPACE = "aixun:dataops:";
|
||||
public static final String ACTIVATION_MILESTONE = "M2";
|
||||
|
||||
private DataOpsBoundary() {
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package cn.aixunkeji.datagov.dataops.api;
|
||||
|
||||
/** Browser-facing M2 run request. No credential material is accepted. */
|
||||
public record GoldenRunRequest(
|
||||
String batchNo,
|
||||
boolean failHiveOnce,
|
||||
boolean forceUnknownProbe
|
||||
) {
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package cn.aixunkeji.datagov.dataops.api;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** Secret-free platform run read model. */
|
||||
public record GoldenRunView(
|
||||
Long runId,
|
||||
Long definitionId,
|
||||
Long snapshotId,
|
||||
Long parentRunId,
|
||||
String runType,
|
||||
String batchNo,
|
||||
String requestId,
|
||||
String idempotencyKey,
|
||||
String status,
|
||||
String sourceStatus,
|
||||
String dolphinSchedulerDefinitionCode,
|
||||
String dolphinSchedulerInstanceId,
|
||||
String seaTunnelJobId,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime startedAt,
|
||||
LocalDateTime completedAt,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.aiassistant;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DataOps AI assistant contract. Every result is a reviewable draft; this API has
|
||||
* no operation which executes SQL, writes a target table, or submits a job.
|
||||
*/
|
||||
public final class SqlProcessingSuggestionApi {
|
||||
|
||||
private SqlProcessingSuggestionApi() {
|
||||
}
|
||||
|
||||
public enum SuggestionStatus { DRAFT, ADOPTED, IGNORED }
|
||||
|
||||
/** Client input: an opaque reference and type only; authorization and freshness are server facts. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record EvidenceRequest(
|
||||
String reference,
|
||||
String kind
|
||||
) implements Serializable {
|
||||
}
|
||||
|
||||
/** Server-resolved evidence persisted with and supplied to the provider for a suggestion. */
|
||||
public record EvidenceRef(
|
||||
String reference,
|
||||
String kind,
|
||||
String summary,
|
||||
Long sourceVersion,
|
||||
LocalDateTime observedAt,
|
||||
String sha256
|
||||
) implements Serializable {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record SuggestionRequest(
|
||||
String requestId,
|
||||
String objectRef,
|
||||
String objectType,
|
||||
String instruction,
|
||||
String sqlDraft,
|
||||
String processingDraft,
|
||||
List<EvidenceRequest> evidence,
|
||||
Long tableFileId
|
||||
) implements Serializable {
|
||||
public SuggestionRequest(String requestId, String objectRef, String objectType, String instruction,
|
||||
String sqlDraft, String processingDraft, List<EvidenceRequest> evidence) {
|
||||
this(requestId, objectRef, objectType, instruction, sqlDraft, processingDraft, evidence, null);
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StateRequest(Long version, String reason) implements Serializable {
|
||||
}
|
||||
|
||||
public record SuggestionView(
|
||||
Long suggestionId,
|
||||
String requestId,
|
||||
String objectRef,
|
||||
String objectType,
|
||||
String instruction,
|
||||
String sqlDraft,
|
||||
String processingDraft,
|
||||
List<EvidenceRef> evidence,
|
||||
String title,
|
||||
String summary,
|
||||
String model,
|
||||
String providerVersion,
|
||||
BigDecimal confidence,
|
||||
String impactSummary,
|
||||
SuggestionStatus status,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
Long version,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) implements Serializable {
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.alertevent;
|
||||
|
||||
import cn.aixunkeji.datagov.dataops.api.alertevent.AlertEventApi.EventStatus;
|
||||
import cn.aixunkeji.datagov.dataops.api.alertevent.AlertEventApi.Severity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Minimum read-only alert-duty boundary for DataOps consumers. */
|
||||
public interface AlertDutyDirectory {
|
||||
|
||||
DutyResult listOpenDuty(DutyQuery query);
|
||||
|
||||
record DutyQuery(
|
||||
long actorId,
|
||||
long orgId,
|
||||
boolean unrestricted,
|
||||
String projectRef,
|
||||
String dataDomainCode,
|
||||
int limit
|
||||
) {
|
||||
}
|
||||
|
||||
record DutyItem(
|
||||
Long eventId,
|
||||
String ruleName,
|
||||
Long ownerObjectId,
|
||||
String ownerObjectName,
|
||||
Severity severity,
|
||||
EventStatus status,
|
||||
Long responsibleUserId
|
||||
) {
|
||||
}
|
||||
|
||||
record DutyResult(List<DutyItem> rows, long total, long unassignedTotal) {
|
||||
public DutyResult {
|
||||
rows = rows == null ? List.of() : List.copyOf(rows);
|
||||
if (total < 0 || unassignedTotal < 0) {
|
||||
throw new IllegalArgumentException("alert duty totals are invalid");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+235
@@ -0,0 +1,235 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.alertevent;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** FR-OPS-0483 through FR-OPS-0487 alert-event contracts. */
|
||||
public final class AlertEventApi {
|
||||
|
||||
private AlertEventApi() {
|
||||
}
|
||||
|
||||
public enum Source { SCHEDULING, BATCH_INGESTION, FILE_INGESTION }
|
||||
|
||||
public enum Metric { FAILED_COUNT, FAILURE_RATE_PERCENT, BACKLOG_COUNT, MAX_DURATION_MS }
|
||||
|
||||
public enum Operator { GT, GTE, LT, LTE }
|
||||
|
||||
public enum Severity { CRITICAL, HIGH, MEDIUM, LOW }
|
||||
|
||||
public enum EventStatus { OPEN, ASSIGNED, PROCESSING, RESOLVED, VERIFIED, CLOSED }
|
||||
|
||||
public enum NotificationType { OPEN, MANUAL, RECOVERY, ESCALATION }
|
||||
|
||||
public enum NotificationStatus { RECORDED }
|
||||
|
||||
public enum ProcessAction { START_PROCESSING, RESOLVE }
|
||||
|
||||
public enum VerifyAction { VERIFY, CLOSE }
|
||||
|
||||
public record PageView<T>(List<T> rows, long total) {
|
||||
public PageView {
|
||||
rows = rows == null ? List.of() : List.copyOf(rows);
|
||||
}
|
||||
}
|
||||
|
||||
public record WriteView<T>(String requestId, T result) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record RuleSaveRequest(
|
||||
String name,
|
||||
Source source,
|
||||
Metric metric,
|
||||
Operator operator,
|
||||
BigDecimal threshold,
|
||||
Severity severity,
|
||||
Integer observationMinutes,
|
||||
Integer triggerCount,
|
||||
Integer recoveryCount,
|
||||
Integer aggregateMinutes,
|
||||
Integer silenceMinutes,
|
||||
String dataDomainCode,
|
||||
Long primaryUserId,
|
||||
Long escalationUserId,
|
||||
Integer escalationWaitMinutes,
|
||||
Boolean enabled,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record RuleStatusRequest(Boolean enabled, Long version) {
|
||||
}
|
||||
|
||||
public record RuleView(
|
||||
Long ruleId,
|
||||
Long orgId,
|
||||
String name,
|
||||
Source source,
|
||||
Metric metric,
|
||||
Operator operator,
|
||||
BigDecimal threshold,
|
||||
Severity severity,
|
||||
int observationMinutes,
|
||||
int triggerCount,
|
||||
int recoveryCount,
|
||||
int aggregateMinutes,
|
||||
int silenceMinutes,
|
||||
@JsonIgnore
|
||||
String projectRef,
|
||||
String dataDomainCode,
|
||||
Long primaryUserId,
|
||||
String primaryUserName,
|
||||
Long escalationUserId,
|
||||
String escalationUserName,
|
||||
int escalationWaitMinutes,
|
||||
boolean enabled,
|
||||
long version,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record EventSummary(
|
||||
Long eventId,
|
||||
Long ruleId,
|
||||
String ruleName,
|
||||
Source source,
|
||||
Long ownerObjectId,
|
||||
String ownerObjectName,
|
||||
@JsonIgnore
|
||||
String projectRef,
|
||||
String dataDomainCode,
|
||||
Metric metric,
|
||||
Operator operator,
|
||||
BigDecimal threshold,
|
||||
BigDecimal currentValue,
|
||||
Severity severity,
|
||||
EventStatus status,
|
||||
long occurrenceCount,
|
||||
Long primaryUserId,
|
||||
String primaryUserName,
|
||||
Long assigneeUserId,
|
||||
String assigneeUserName,
|
||||
LocalDateTime openedAt,
|
||||
LocalDateTime lastOccurredAt,
|
||||
LocalDateTime resolvedAt,
|
||||
LocalDateTime verifiedAt,
|
||||
LocalDateTime closedAt,
|
||||
long version
|
||||
) {
|
||||
}
|
||||
|
||||
public record OccurrenceView(
|
||||
Long occurrenceId,
|
||||
BigDecimal metricValue,
|
||||
long sampleCount,
|
||||
String evidenceSha256,
|
||||
LocalDateTime observedFrom,
|
||||
LocalDateTime observedTo,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record NotificationView(
|
||||
Long notificationId,
|
||||
NotificationType type,
|
||||
NotificationStatus status,
|
||||
Long recipientUserId,
|
||||
String recipientUserName,
|
||||
String contentSummary,
|
||||
LocalDateTime recordedAt,
|
||||
String mailboxState,
|
||||
Long mailboxMessageId,
|
||||
LocalDateTime mailboxAttemptedAt
|
||||
) {
|
||||
public NotificationView(Long notificationId, NotificationType type, NotificationStatus status,
|
||||
Long recipientUserId, String recipientUserName, String contentSummary, LocalDateTime recordedAt) {
|
||||
this(notificationId, type, status, recipientUserId, recipientUserName, contentSummary, recordedAt, "RECORDED", null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public record TimelineView(
|
||||
Long timelineId,
|
||||
String action,
|
||||
EventStatus fromStatus,
|
||||
EventStatus toStatus,
|
||||
Long actorUserId,
|
||||
String actorName,
|
||||
String requestId,
|
||||
String reasonSummary,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record PostmortemView(
|
||||
Long postmortemId,
|
||||
String summary,
|
||||
String rootCause,
|
||||
String impact,
|
||||
String correctiveActions,
|
||||
List<String> evidenceRefs,
|
||||
Long authorUserId,
|
||||
String authorName,
|
||||
long version,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
public PostmortemView {
|
||||
evidenceRefs = evidenceRefs == null ? List.of() : List.copyOf(evidenceRefs);
|
||||
}
|
||||
}
|
||||
|
||||
public record EventDetailView(
|
||||
EventSummary summary,
|
||||
List<OccurrenceView> occurrences,
|
||||
List<NotificationView> notifications,
|
||||
List<TimelineView> timeline,
|
||||
PostmortemView postmortem
|
||||
) {
|
||||
public EventDetailView {
|
||||
occurrences = occurrences == null ? List.of() : List.copyOf(occurrences);
|
||||
notifications = notifications == null ? List.of() : List.copyOf(notifications);
|
||||
timeline = timeline == null ? List.of() : List.copyOf(timeline);
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record NotifyRequest(Long recipientUserId, String reason, Long version) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record AssignRequest(Long assigneeUserId, String reason, Long version) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record ProcessRequest(ProcessAction action, String reason, Long version) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record VerifyRequest(VerifyAction action, String reason, Long version) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record PostmortemRequest(
|
||||
String summary,
|
||||
String rootCause,
|
||||
String impact,
|
||||
String correctiveActions,
|
||||
List<String> evidenceRefs,
|
||||
Long eventVersion,
|
||||
Long postmortemVersion
|
||||
) {
|
||||
public PostmortemRequest {
|
||||
evidenceRefs = evidenceRefs == null ? List.of() : List.copyOf(evidenceRefs);
|
||||
}
|
||||
}
|
||||
|
||||
public record IdentityCandidate(Long userId, String userName, String nickName) {
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.alertevent;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import cn.aixunkeji.datagov.dataops.api.alertevent.AlertEventApi.*;
|
||||
import cn.aixunkeji.datagov.dataops.api.tasklog.TaskLogApi.Status;
|
||||
|
||||
/** Frozen server observations. Client references never supply rules, runs or historical values. */
|
||||
public interface AlertOccurrenceEvidenceDirectory {
|
||||
String VERSION = "1.0.0";
|
||||
Evidence current(Selection selection);
|
||||
record Reference(String eventId,String occurrenceId,long eventVersion,String payloadSha256) implements Serializable { }
|
||||
record Selection(List<Reference> references) implements Serializable { }
|
||||
record RuleSnapshot(String ruleId,long version,Source source,Metric metric,Operator operator,String threshold,
|
||||
Severity severity,int observationMinutes,int triggerCount,int recoveryCount,
|
||||
int aggregateMinutes,int silenceMinutes,boolean enabled) implements Serializable { }
|
||||
record Run(String key,String runId,Source source,String ownerObjectId,String orgId,String projectRef,String dataDomainCode,
|
||||
Status status,LocalDateTime startedAt,LocalDateTime completedAt,LocalDateTime createdAt,LocalDateTime updatedAt,
|
||||
LocalDateTime windowTime,String timeBasis,List<String> metricRoles) implements Serializable { }
|
||||
record Payload(int formatVersion,String state,RuleSnapshot rule,String orgId,String ownerObjectId,
|
||||
String projectRef,String dataDomainCode,String ownerProjectRef,String ownerDataDomainCode,
|
||||
LocalDateTime appliedFrom,LocalDateTime appliedTo,String zoneId,String timeBasis,
|
||||
LocalDateTime sampleMinCreatedAt,int ownerRowCount,long metricSampleCount,long unknownStatusCount,
|
||||
String metricValue,boolean breached,String originalEvidenceSha256,String streakEvidenceState,
|
||||
List<Run> runs) implements Serializable { }
|
||||
record View(Reference reference,String state,Source source,String eventStatus,Payload payload,String scopeNote) implements Serializable { }
|
||||
record Evidence(Selection selection,List<View> occurrences,String fingerprint) implements Serializable { }
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.assetupgrade;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* C-SOURCE-01/C-HQD-01 physical evidence only. DataProduct owns business content versions.
|
||||
* Read-only methods do not submit work. Actual execution uses approved Integration/DS paths.
|
||||
* Every implementation must authenticate RPC peer/delegation, derive HTTP actor on server,
|
||||
* and recheck scope/action/resource/purpose. A Context is not authentication evidence.
|
||||
*/
|
||||
public interface AssetUpgradeExecutionOwner {
|
||||
String VERSION = "1.1.0";
|
||||
String GROUP = "aixun-datagov-asset-upgrade-execution";
|
||||
|
||||
SourceSnapshot resolveSource(SourceQuery query);
|
||||
PreparationExecution resolveExecution(ExecutionQuery query);
|
||||
|
||||
enum State { SUBMITTED, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN }
|
||||
enum SourceKind { TABLE_SNAPSHOT, PRIVATE_FILE }
|
||||
enum Completeness { PREVIEW, COMPLETE, UNKNOWN }
|
||||
enum FileUse { CANONICAL_DATA, SAFE_DISPLAY }
|
||||
enum Operation { FIELD_MAPPING, MISSING_VALUE, NORMALIZE, EXACT_DEDUPLICATE,
|
||||
NEAR_DUPLICATE_GROUP, STATIC_MASK, LABEL_PREPARATION, GROUP_SPLIT }
|
||||
|
||||
record Context(int contractVersion, long actorId, long organizationId, long departmentId,
|
||||
String callerService, String delegationRef, String requestId) implements Serializable {
|
||||
public Context {
|
||||
if (contractVersion != 1) throw invalid();
|
||||
positive(actorId); positive(organizationId); positive(departmentId);
|
||||
text(callerService); text(delegationRef); text(requestId);
|
||||
}
|
||||
}
|
||||
record SourceQuery(Context context, String sourceRef, long sourceVersion, String purpose)
|
||||
implements Serializable {
|
||||
public SourceQuery { Objects.requireNonNull(context); text(sourceRef); positive(sourceVersion); text(purpose); }
|
||||
}
|
||||
/** No query text, row data, connection information or credentials on this control boundary. */
|
||||
record SourceSnapshot(SourceQuery binding, SourceKind kind, String immutableSnapshotRef,
|
||||
String schemaVersion, String schemaSha256, String rawBytesSha256,
|
||||
String canonicalContentSha256, String normalizationVersion,
|
||||
String boundedRangeRef, long rows, long bytes, Completeness completeness,
|
||||
String authorizationEvidenceRef, String consistencyEvidenceRef,
|
||||
Instant observedAt, Instant expiresAt, String errorCode) implements Serializable {
|
||||
public SourceSnapshot {
|
||||
Objects.requireNonNull(binding); Objects.requireNonNull(kind); Objects.requireNonNull(completeness);
|
||||
if (rows < 0 || bytes < 0) throw invalid();
|
||||
if (completeness == Completeness.COMPLETE) {
|
||||
text(immutableSnapshotRef); text(schemaVersion); sha(schemaSha256); sha(rawBytesSha256);
|
||||
sha(canonicalContentSha256); text(normalizationVersion); text(boundedRangeRef);
|
||||
text(authorizationEvidenceRef); text(consistencyEvidenceRef);
|
||||
Objects.requireNonNull(observedAt); Objects.requireNonNull(expiresAt);
|
||||
if (!expiresAt.isAfter(observedAt) || errorCode != null) throw invalid();
|
||||
} else if (completeness == Completeness.UNKNOWN) text(errorCode);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Immutable plan, not an RPC submit endpoint or a promise of executor support.
|
||||
* inputContentVersionId/inputContentSha256 may refer to a DataProduct-owned DraftInput
|
||||
* whose actual imported bytes, source and license have been revalidated. A first input
|
||||
* does not require a prior successful preparation run; it never implies frozen content.
|
||||
*/
|
||||
record PreparationPlan(long datasetId, String inputContentVersionId, String inputContentSha256,
|
||||
String licenseVersion, List<Operation> operations, String planSha256,
|
||||
String outputAuthorizationRef, String idempotencyKey,
|
||||
String algorithmVersion, long seed, long maximumRows,
|
||||
long maximumTextBytes, long maximumCandidatePairs) implements Serializable {
|
||||
public PreparationPlan {
|
||||
positive(datasetId); text(inputContentVersionId); sha(inputContentSha256); text(licenseVersion);
|
||||
operations = List.copyOf(operations); if (operations.isEmpty()) throw invalid();
|
||||
sha(planSha256); text(outputAuthorizationRef); text(idempotencyKey); text(algorithmVersion);
|
||||
if (maximumRows <= 0 || maximumRows > 100_000 || maximumTextBytes <= 0
|
||||
|| maximumTextBytes > 65_536 || maximumCandidatePairs <= 0 || maximumCandidatePairs > 1_000_000) throw invalid();
|
||||
}
|
||||
}
|
||||
record ExecutionQuery(Context context, String runId, long runVersion) implements Serializable {
|
||||
public ExecutionQuery { Objects.requireNonNull(context); text(runId); positive(runVersion); }
|
||||
}
|
||||
record PhysicalOutput(String fileId, String objectVersion, FileUse use, String derivedFromFileId,
|
||||
String derivationPolicyVersion, String bytesSha256, String canonicalSha256,
|
||||
long rows, long bytes, String mime, String privateBindingRef) implements Serializable {
|
||||
public PhysicalOutput {
|
||||
text(fileId); text(objectVersion); Objects.requireNonNull(use); sha(bytesSha256);
|
||||
sha(canonicalSha256); if (rows < 0 || bytes < 0) throw invalid(); text(mime); text(privateBindingRef);
|
||||
if (use == FileUse.SAFE_DISPLAY) { text(derivedFromFileId); text(derivationPolicyVersion); }
|
||||
if (fileId.equals(derivedFromFileId)) throw invalid();
|
||||
}
|
||||
}
|
||||
record PreparationExecution(ExecutionQuery binding, long datasetId, String inputContentVersionId,
|
||||
String inputSha256, String planSha256, State state, String externalId,
|
||||
Long inputRows, Long outputRows, Long filteredRows, Long failedRows,
|
||||
List<PhysicalOutput> outputs, String evidenceRef, String evidenceSha256,
|
||||
Instant observedAt, String errorCode) implements Serializable {
|
||||
public PreparationExecution {
|
||||
Objects.requireNonNull(binding); positive(datasetId); text(inputContentVersionId);
|
||||
sha(inputSha256); sha(planSha256); Objects.requireNonNull(state);
|
||||
outputs = List.copyOf(outputs); Objects.requireNonNull(observedAt);
|
||||
if (state == State.SUCCEEDED) {
|
||||
text(externalId); text(evidenceRef); sha(evidenceSha256);
|
||||
if (inputRows == null || outputRows == null || filteredRows == null || failedRows == null
|
||||
|| inputRows < 0 || outputRows < 0 || filteredRows < 0 || failedRows < 0
|
||||
|| outputs.isEmpty() || errorCode != null) throw invalid();
|
||||
}
|
||||
// UNKNOWN preserves externalId; consumers must reconcile, never blindly resubmit.
|
||||
if (state == State.UNKNOWN || state == State.FAILED) text(errorCode);
|
||||
}
|
||||
}
|
||||
private static void positive(long value) { if (value <= 0) throw invalid(); }
|
||||
private static void text(String value) { if (value == null || value.isBlank() || value.length() > 512) throw invalid(); }
|
||||
private static void sha(String value) { if (value == null || !value.matches("[a-f0-9]{64}")) throw invalid(); }
|
||||
private static IllegalArgumentException invalid() { return new IllegalArgumentException("INVALID_CONTRACT"); }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
public record BatchArrivalValidationCommand(String reason) {
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public record BatchArrivalValidationView(
|
||||
long validationId,
|
||||
long taskId,
|
||||
long runId,
|
||||
String batchNo,
|
||||
Long sourceCount,
|
||||
Long targetCount,
|
||||
String checksum,
|
||||
Long duplicateCount,
|
||||
String status,
|
||||
LocalDateTime evidenceAt,
|
||||
String evidenceRef,
|
||||
boolean retryable,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public record BatchCheckpointView(
|
||||
long checkpointRecordId,
|
||||
long taskId,
|
||||
long runId,
|
||||
String externalJobId,
|
||||
String checkpointId,
|
||||
long checkpointSequence,
|
||||
String status,
|
||||
LocalDateTime evidenceAt,
|
||||
String evidenceRef,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public record BatchCloseSubmissionCommand(long version, long taskVersion, String reason) implements Serializable { }
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BatchFieldMappingCommand(
|
||||
String sourceField,
|
||||
String targetField,
|
||||
String sourceType,
|
||||
String targetType,
|
||||
BatchFieldTransform transform,
|
||||
String defaultValue,
|
||||
BatchFilterOperator filterOperator,
|
||||
List<String> filterValues
|
||||
) {
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BatchFieldMappingView(
|
||||
long mappingId,
|
||||
int mappingOrder,
|
||||
String sourceField,
|
||||
String targetField,
|
||||
String sourceType,
|
||||
String targetType,
|
||||
BatchFieldTransform transform,
|
||||
String defaultValue,
|
||||
BatchFilterOperator filterOperator,
|
||||
List<String> filterValues
|
||||
) {
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
public enum BatchFieldTransform {
|
||||
NONE,
|
||||
CAST,
|
||||
TRIM,
|
||||
UPPER,
|
||||
LOWER,
|
||||
DEFAULT_IF_NULL
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
/** Fixed structured filter operators; arbitrary SQL is never accepted. */
|
||||
public enum BatchFilterOperator {
|
||||
EQUALS,
|
||||
NOT_EQUALS,
|
||||
GREATER_THAN,
|
||||
GREATER_OR_EQUALS,
|
||||
LESS_THAN,
|
||||
LESS_OR_EQUALS,
|
||||
IN,
|
||||
NOT_IN,
|
||||
BETWEEN,
|
||||
IS_NULL,
|
||||
IS_NOT_NULL
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
public enum BatchIngestionMode {
|
||||
FULL,
|
||||
INCREMENTAL
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
/** Platform status for FR-ING-0304..0307. */
|
||||
public enum BatchIngestionStatus {
|
||||
DRAFT,
|
||||
READY,
|
||||
SUBMITTED,
|
||||
RUNNING,
|
||||
SUCCEEDED,
|
||||
FAILED,
|
||||
CANCELED,
|
||||
UNKNOWN
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
/** FR-ING-0304 explicit observation of an existing run; no external submission. */
|
||||
public record BatchObservationCommand(long version) { }
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
public record BatchReadyCommand(long version) {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
public record BatchResumeCommand(String reason) {
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public record BatchRunView(
|
||||
long runId,
|
||||
long taskId,
|
||||
long definitionId,
|
||||
long snapshotId,
|
||||
Long parentRunId,
|
||||
String runType,
|
||||
String batchNo,
|
||||
String requestId,
|
||||
BatchIngestionStatus status,
|
||||
String sourceStatus,
|
||||
String externalJobId,
|
||||
boolean retryable,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime startedAt,
|
||||
LocalDateTime completedAt,
|
||||
LocalDateTime createdAt,
|
||||
long version
|
||||
) {
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** Safe evidence only; a planned ID does not imply external acceptance. */
|
||||
public record BatchSubmissionRecoveryView(
|
||||
long runId, long taskId, long runVersion, long taskVersion, String phase,
|
||||
String plannedJobId, String initialErrorCode, String initialErrorSummary,
|
||||
boolean canObserve, boolean canClose, String guidance, List<Event> events
|
||||
) implements Serializable {
|
||||
public record Event(long sequence, String status, String sourceStatus, String externalJobId,
|
||||
String summary, LocalDateTime createdAt) implements Serializable { }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
public record BatchSubmitCommand(long version) {
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import cn.aixunkeji.datagov.dataops.api.tablefile.TableFileApi;
|
||||
import java.util.List;
|
||||
|
||||
/** FR-ING-0304/0305: structured MySQL-to-Doris target selection. */
|
||||
public final class BatchTargetWizardApi {
|
||||
private BatchTargetWizardApi() { }
|
||||
public record Context(long sourceId, String sourceObject, long resourceId, long spaceId) { }
|
||||
public record SourceColumn(String name, String type, int ordinal, Boolean nullable, boolean masked,
|
||||
String nativeType, Integer precision, Integer scale, Long octetLength) { }
|
||||
public record Field(SourceColumn source, TableFileApi.ColumnDefinition target, String issue) { }
|
||||
public record Draft(String sourceFingerprint, List<Field> fields, String sourceTableComment,
|
||||
String sourceTableCommentState) {
|
||||
public Draft(String sourceFingerprint, List<Field> fields) {
|
||||
this(sourceFingerprint, fields, null, "UNKNOWN");
|
||||
}
|
||||
}
|
||||
public record Confirm(Context context, String sourceFingerprint, String name,
|
||||
List<TableFileApi.ColumnDefinition> columns) { }
|
||||
public record Match(Context context, String name, List<String> selectedColumns) { }
|
||||
public record Matched(List<BatchFieldMappingCommand> mappings) { }
|
||||
public record Created(TableFileApi.OperationView operation, List<BatchFieldMappingCommand> mappings) { }
|
||||
public record TargetExistenceCommand(long resourceId, long spaceId, List<String> tables) { }
|
||||
public enum TargetExistenceState { EXISTS, MISSING, UNKNOWN }
|
||||
public record TargetExistenceItem(String table, TargetExistenceState state, String reason) { }
|
||||
public record TargetExistenceResult(List<TargetExistenceItem> items) { }
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BatchTaskConfiguration {
|
||||
String name();
|
||||
String dataDomainCode();
|
||||
long sourceRefId();
|
||||
long targetRefId();
|
||||
String sourceConnector();
|
||||
String targetConnector();
|
||||
String sourceObject();
|
||||
String targetObject();
|
||||
BatchIngestionMode mode();
|
||||
String incrementalField();
|
||||
String partitionField();
|
||||
int parallelism();
|
||||
boolean checkpointEnabled();
|
||||
Integer checkpointIntervalSeconds();
|
||||
List<BatchFieldMappingCommand> mappings();
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BatchTaskCreateCommand(
|
||||
String name,
|
||||
String dataDomainCode,
|
||||
long sourceRefId,
|
||||
long targetRefId,
|
||||
String sourceConnector,
|
||||
String targetConnector,
|
||||
String sourceObject,
|
||||
String targetObject,
|
||||
BatchIngestionMode mode,
|
||||
String incrementalField,
|
||||
String partitionField,
|
||||
int parallelism,
|
||||
boolean checkpointEnabled,
|
||||
Integer checkpointIntervalSeconds,
|
||||
List<BatchFieldMappingCommand> mappings
|
||||
) implements BatchTaskConfiguration {
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BatchTaskPageView(List<BatchTaskView> rows, long total) {
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BatchTaskUpdateCommand(
|
||||
long version,
|
||||
String name,
|
||||
String dataDomainCode,
|
||||
long sourceRefId,
|
||||
long targetRefId,
|
||||
String sourceConnector,
|
||||
String targetConnector,
|
||||
String sourceObject,
|
||||
String targetObject,
|
||||
BatchIngestionMode mode,
|
||||
String incrementalField,
|
||||
String partitionField,
|
||||
int parallelism,
|
||||
boolean checkpointEnabled,
|
||||
Integer checkpointIntervalSeconds,
|
||||
List<BatchFieldMappingCommand> mappings
|
||||
) implements BatchTaskConfiguration {
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
public record BatchTaskView(
|
||||
long taskId,
|
||||
long definitionId,
|
||||
long currentSnapshotId,
|
||||
String taskCode,
|
||||
String name,
|
||||
long orgScopeId,
|
||||
String dataDomainCode,
|
||||
long sourceRefId,
|
||||
long targetRefId,
|
||||
String sourceConnector,
|
||||
String targetConnector,
|
||||
String sourceObject,
|
||||
String targetObject,
|
||||
BatchIngestionMode mode,
|
||||
String incrementalField,
|
||||
String partitionField,
|
||||
int parallelism,
|
||||
boolean checkpointEnabled,
|
||||
Integer checkpointIntervalSeconds,
|
||||
BatchIngestionStatus status,
|
||||
long version,
|
||||
LocalDateTime capabilityCheckedAt,
|
||||
LocalDateTime capabilityExpiresAt,
|
||||
List<BatchFieldMappingView> mappings,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
import java.io.Serializable;
|
||||
/** Current-session task requirements only; choosing a registry node does not bind or execute this task. */
|
||||
public interface CollectionNodeTaskDirectory {
|
||||
String VERSION="1.0.0";
|
||||
Requirement current(String taskId,long expectedVersion);
|
||||
record Requirement(long actorId,long deptId,String taskId,long version,String snapshotId,String sourceConnector,
|
||||
String targetConnector,String mode,int parallelism,String status,String fingerprint) implements Serializable { }
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchingestion;
|
||||
|
||||
import cn.aixunkeji.datagov.dataops.api.storage.StorageResourceType;
|
||||
import cn.aixunkeji.datagov.dataops.api.storage.StoragePhysicalOperationView;
|
||||
import cn.aixunkeji.datagov.dataops.api.tablefile.TableFileApi.ColumnDefinition;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** Project-free public contract for database table ingestion. */
|
||||
public final class UnifiedIngestionApi {
|
||||
private UnifiedIngestionApi() { }
|
||||
|
||||
public enum Layer { ODS, DWD, DWS, ADS }
|
||||
public enum CollectionStatus { SUBMITTING, SUBMITTED, RUNNING, SUCCEEDED, PARTIAL, FAILED, CANCELED, UNKNOWN }
|
||||
public enum MetricStatus { OBSERVED, PARTIAL, UNKNOWN, NOT_OBSERVED }
|
||||
public enum MetricSourceType { ARRIVAL_VALIDATION, INTEGRATION, EXTERNAL_ENGINE }
|
||||
|
||||
public record Source(Long id, String name, String type, String status, String databaseName,
|
||||
boolean available, String unavailableReason, long version) { }
|
||||
public record SourcePage(List<Source> rows, int total) { }
|
||||
public record SourceTable(String sourceDatabase, String name, String kind) { }
|
||||
public record SourceTablePage(List<SourceTable> rows, int total, int pageNum, int pageSize) { }
|
||||
public record TargetDatabase(Long spaceId, String name, String databaseName, long version) { }
|
||||
public record Target(Long resourceId, String name, StorageResourceType type, long version, Long accessVersion,
|
||||
List<TargetDatabase> databases) { }
|
||||
public record TargetPage(List<Target> rows, long total) { }
|
||||
|
||||
public record SourceSelection(long sourceId, long sourceVersion, String sourceName,
|
||||
String sourceDatabase, String table) { }
|
||||
public record DraftRequest(List<SourceSelection> items, StorageResourceType targetType) { }
|
||||
public record DraftItem(long sourceId, long sourceVersion, String sourceName, String sourceDatabase,
|
||||
String sourceTable, String targetTable, String sourceFingerprint,
|
||||
List<ColumnDefinition> columns, List<BatchFieldMappingCommand> mappings,
|
||||
String errorSummary, String sourceTableComment, String sourceTableCommentState) {
|
||||
public DraftItem(long sourceId, long sourceVersion, String sourceName, String sourceDatabase,
|
||||
String sourceTable, String targetTable, String sourceFingerprint,
|
||||
List<ColumnDefinition> columns, List<BatchFieldMappingCommand> mappings, String errorSummary) {
|
||||
this(sourceId, sourceVersion, sourceName, sourceDatabase, sourceTable, targetTable, sourceFingerprint,
|
||||
columns, mappings, errorSummary, null, "UNKNOWN");
|
||||
}
|
||||
}
|
||||
public record Draft(List<DraftItem> items) { }
|
||||
|
||||
public record CreateDatabaseRequest(long resourceId, long resourceVersion, long accessVersion,
|
||||
String name) { }
|
||||
public record CreateDatabaseResult(StoragePhysicalOperationView operation) { }
|
||||
|
||||
public record SubmitItem(long sourceId, long sourceVersion, String sourceName, String sourceDatabase,
|
||||
String sourceTable, String targetTable, String sourceFingerprint,
|
||||
boolean createTarget, List<ColumnDefinition> columns,
|
||||
List<BatchFieldMappingCommand> mappings) { }
|
||||
public record SubmitRequest(String name, long targetResourceId, long targetResourceVersion,
|
||||
long targetSpaceId, long targetSpaceVersion,
|
||||
StorageResourceType targetType, Layer layer, List<SubmitItem> items) { }
|
||||
/** Read-only, verified historical configuration; never an execution command. */
|
||||
public record ConfigurationCopyItem(Long itemId, int itemOrder) { }
|
||||
public record CollectionConfigurationCopy(Long collectionId, List<ConfigurationCopyItem> items,
|
||||
SubmitRequest configuration) { }
|
||||
public record SubmitItemResult(long sourceId, long sourceVersion, String sourceName,
|
||||
String sourceDatabase, String sourceTable, String targetTable, String status,
|
||||
Long taskId, Long runId, String externalJobId,
|
||||
String errorCode, String errorSummary,
|
||||
String targetCreateRequestId, String targetCreateState,
|
||||
String targetDatabase, Long layerId, String layerName,
|
||||
boolean retryable) { }
|
||||
public record SubmitResult(long collectionId, CollectionStatus status, List<SubmitItemResult> items,
|
||||
int accepted, int failed, LocalDateTime submittedAt, boolean replayed) { }
|
||||
|
||||
public record Metric(Long value, MetricStatus status, MetricSourceType sourceType, String source,
|
||||
LocalDateTime observedAt) { }
|
||||
public record CollectionSummary(long collectionId, String name, CollectionStatus status,
|
||||
int itemCount, int accepted, int failed, Metric rows, Metric bytes,
|
||||
LocalDateTime submittedAt, LocalDateTime updatedAt) { }
|
||||
public record CollectionPage(List<CollectionSummary> rows, long total) { }
|
||||
public record CollectionItem(long itemId, int itemOrder, long sourceId, long sourceVersion,
|
||||
String sourceName, String sourceDatabase, String sourceTable,
|
||||
long targetResourceId, long targetSpaceId, StorageResourceType targetType,
|
||||
Layer layer, String targetDatabase, String targetTable,
|
||||
Long layerId, String layerName, String targetCreateRequestId,
|
||||
String targetCreateState, String status, Long taskId, Long runId,
|
||||
String externalJobId, boolean retryable, String errorCode,
|
||||
String errorSummary, Metric rows, Metric bytes) { }
|
||||
public record CollectionDetail(long collectionId, String name, CollectionStatus status,
|
||||
List<CollectionItem> items, int accepted, int failed,
|
||||
Metric rows, Metric bytes, LocalDateTime submittedAt,
|
||||
LocalDateTime updatedAt) { }
|
||||
|
||||
/** Internal evidence command; callers may never send guessed or default byte values. */
|
||||
public record ByteMetricObservation(Long value, MetricStatus status, MetricSourceType sourceType,
|
||||
String source, LocalDateTime observedAt, String evidenceRef,
|
||||
String errorCode, String errorSummary) { }
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchjob;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** Stable V1 contract for batch-job definitions. It intentionally contains no execution fields. */
|
||||
public final class BatchJobApi {
|
||||
|
||||
private BatchJobApi() {
|
||||
}
|
||||
|
||||
public enum JobStatus { DRAFT, READY }
|
||||
|
||||
public enum ExecutionEngine { SEATUNNEL }
|
||||
|
||||
public enum ReadMode { SNAPSHOT }
|
||||
|
||||
public enum WriteMode { APPEND, OVERWRITE }
|
||||
|
||||
public enum TransformOperation { COPY, TRIM, UPPER, LOWER, CAST }
|
||||
|
||||
public enum FilterOperator { EQ, NE, GT, GTE, LT, LTE, IS_NULL, NOT_NULL }
|
||||
|
||||
public enum DataType {
|
||||
BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, DECIMAL,
|
||||
STRING, VARCHAR, CHAR, DATE, TIMESTAMP, DATETIME
|
||||
}
|
||||
|
||||
public enum FaultTolerance { FAIL_FAST, SKIP_BAD_RECORDS }
|
||||
|
||||
public record MySqlSource(Long dataSourceId, Long sourceVersion, String database, String table) { }
|
||||
|
||||
public record SourceDefinition(List<Long> inputTableFileIds, ReadMode readMode,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) MySqlSource mysqlSource) {
|
||||
public SourceDefinition(List<Long> inputTableFileIds, ReadMode readMode) {
|
||||
this(inputTableFileIds, readMode, null);
|
||||
}
|
||||
}
|
||||
|
||||
public record FieldMapping(
|
||||
String sourceField,
|
||||
String targetField,
|
||||
TransformOperation operation,
|
||||
DataType targetType
|
||||
) {
|
||||
}
|
||||
|
||||
public record FilterRule(String field, FilterOperator operator, String value) {
|
||||
}
|
||||
|
||||
public record TransformDefinition(List<FieldMapping> fieldMappings, List<FilterRule> filters) {
|
||||
}
|
||||
|
||||
public record SinkDefinition(List<Long> outputTableFileIds, WriteMode writeMode) {
|
||||
}
|
||||
|
||||
public record JobParameters(
|
||||
Integer parallelism,
|
||||
Integer coordinatorMemoryMb,
|
||||
Integer workerMemoryMb,
|
||||
Integer workerCpuMillicores,
|
||||
Integer timeoutSeconds,
|
||||
Integer retryCount,
|
||||
Integer retryIntervalSeconds,
|
||||
FaultTolerance faultTolerance
|
||||
) {
|
||||
}
|
||||
|
||||
public record BatchJobCreateRequest(
|
||||
String name,
|
||||
ExecutionEngine executionEngine,
|
||||
SourceDefinition source,
|
||||
TransformDefinition transform,
|
||||
SinkDefinition sink,
|
||||
JobParameters parameters
|
||||
) {
|
||||
}
|
||||
|
||||
public record BatchJobUpdateRequest(
|
||||
String name,
|
||||
ExecutionEngine executionEngine,
|
||||
SourceDefinition source,
|
||||
TransformDefinition transform,
|
||||
SinkDefinition sink,
|
||||
JobParameters parameters,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
|
||||
public record BatchJobParameterRequest(JobParameters parameters, Long version) {
|
||||
}
|
||||
|
||||
public record BatchJobReadyRequest(Long version) {
|
||||
}
|
||||
|
||||
public record BatchJobDeleteRequest(Long version) {
|
||||
}
|
||||
|
||||
public record BatchJobView(
|
||||
Long jobId,
|
||||
String name,
|
||||
Long orgId,
|
||||
String dataDomainCode,
|
||||
ExecutionEngine executionEngine,
|
||||
SourceDefinition source,
|
||||
TransformDefinition transform,
|
||||
SinkDefinition sink,
|
||||
JobParameters parameters,
|
||||
String definitionSha256,
|
||||
JobStatus status,
|
||||
Long version,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.batchjob;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/** Saved owner observations only; no execution, refresh or business commands. */
|
||||
public interface BatchJobRunAssistDirectory {
|
||||
String VERSION = "1.0.0";
|
||||
record Selection(String jobId, long jobVersion, String runId, String evidenceId, long evidenceVersion) implements Serializable { }
|
||||
record Candidate(String runId, String scheduleId, String nodeKey, String evidenceId, long evidenceVersion,
|
||||
String kind, String status, String observedAt) implements Serializable { }
|
||||
record Fact(String key, String kind, String value, String observedAt) implements Serializable { }
|
||||
record Check(String key, boolean satisfied, List<String> factKeys) implements Serializable { }
|
||||
record Context(Selection selection, String fingerprint, String scheduleId, String nodeKey,
|
||||
List<Fact> facts, List<Check> checks, String boundary) implements Serializable { }
|
||||
Context current(Selection selection);
|
||||
}
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.chainmetric;
|
||||
|
||||
import cn.aixunkeji.datagov.dataops.api.tasklog.TaskLogApi.Source;
|
||||
import cn.aixunkeji.datagov.dataops.api.tasklog.TaskLogApi.Status;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** FR-OPS-0479/0480 evidence-only metric snapshot and topology contracts. */
|
||||
public final class ChainMetricApi {
|
||||
|
||||
private ChainMetricApi() {
|
||||
}
|
||||
|
||||
public enum SnapshotState { PENDING, AVAILABLE, UNKNOWN, UNSUPPORTED }
|
||||
|
||||
public enum MetricCategory { RESOURCE, COST }
|
||||
|
||||
public record QueryView(
|
||||
Source source,
|
||||
Status status,
|
||||
@JsonIgnore
|
||||
String projectRef,
|
||||
String taskType,
|
||||
LocalDateTime startedFrom,
|
||||
LocalDateTime startedTo
|
||||
) {
|
||||
}
|
||||
|
||||
public record LatencyStats(
|
||||
long sampleCount,
|
||||
long minimumMs,
|
||||
BigDecimal averageMs,
|
||||
long maximumMs
|
||||
) {
|
||||
}
|
||||
|
||||
public record BaseMetrics(
|
||||
long runCount,
|
||||
long terminalCount,
|
||||
long failedCount,
|
||||
long backlogCount,
|
||||
LatencyStats latency,
|
||||
BigDecimal throughputPerHour,
|
||||
BigDecimal errorRate
|
||||
) {
|
||||
}
|
||||
|
||||
public record OverviewView(
|
||||
QueryView query,
|
||||
BaseMetrics metrics,
|
||||
LocalDateTime calculatedAt
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record RefreshRequest(
|
||||
String source,
|
||||
String status,
|
||||
String taskType,
|
||||
LocalDateTime startedFrom,
|
||||
LocalDateTime startedTo
|
||||
) {
|
||||
}
|
||||
|
||||
public record RefreshView(
|
||||
long observationRequestId,
|
||||
Long snapshotId,
|
||||
SnapshotState state,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime observedAt,
|
||||
LocalDateTime createdAt,
|
||||
boolean truncated
|
||||
) {
|
||||
}
|
||||
|
||||
public record SnapshotSummary(
|
||||
long snapshotId,
|
||||
SnapshotState state,
|
||||
QueryView query,
|
||||
BaseMetrics metrics,
|
||||
String externalSource,
|
||||
String evidenceRef,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime observedAt,
|
||||
LocalDateTime createdAt,
|
||||
boolean truncated
|
||||
) {
|
||||
}
|
||||
|
||||
public record SnapshotPageView(List<SnapshotSummary> rows, long total) {
|
||||
public SnapshotPageView {
|
||||
rows = rows == null ? List.of() : List.copyOf(rows);
|
||||
}
|
||||
}
|
||||
|
||||
public record ObservedMetric(
|
||||
String metricKey,
|
||||
MetricCategory category,
|
||||
BigDecimal value,
|
||||
String unit,
|
||||
LocalDateTime observedAt,
|
||||
String source,
|
||||
String evidenceRef
|
||||
) {
|
||||
}
|
||||
|
||||
public record SnapshotDetailView(SnapshotSummary summary, List<ObservedMetric> observedMetrics) {
|
||||
public SnapshotDetailView {
|
||||
observedMetrics = observedMetrics == null ? List.of() : List.copyOf(observedMetrics);
|
||||
}
|
||||
}
|
||||
|
||||
public record TopologyNode(
|
||||
String nodeId,
|
||||
String nodeType,
|
||||
String displayName,
|
||||
String ownerReference,
|
||||
String externalReference,
|
||||
LocalDateTime observedAt,
|
||||
String evidenceRef,
|
||||
String internalPath
|
||||
) {
|
||||
}
|
||||
|
||||
public record TopologyEdge(
|
||||
String sourceNodeId,
|
||||
String targetNodeId,
|
||||
String relationType,
|
||||
String evidenceRef
|
||||
) {
|
||||
}
|
||||
|
||||
public record TopologyView(
|
||||
SnapshotState state,
|
||||
List<TopologyNode> nodes,
|
||||
List<TopologyEdge> edges,
|
||||
boolean truncated,
|
||||
LocalDateTime observedAt,
|
||||
String source,
|
||||
String evidenceRef,
|
||||
String errorCode,
|
||||
String errorSummary
|
||||
) {
|
||||
public TopologyView {
|
||||
nodes = nodes == null ? List.of() : List.copyOf(nodes);
|
||||
edges = edges == null ? List.of() : List.copyOf(edges);
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.chainmetric;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
/** Current applied-window references. Never an as-of reconstruction of a saved aggregate snapshot. */
|
||||
public interface ChainStageEvidenceDirectory {
|
||||
String VERSION="1.0.0";
|
||||
Context current(Selection selection);
|
||||
record Scope(String source,String status,String projectRef,String taskType,LocalDateTime startedFrom,LocalDateTime startedTo) implements Serializable { }
|
||||
record Reference(String runId,String fingerprint) implements Serializable { }
|
||||
record Selection(Scope scope,List<Reference> references) implements Serializable { }
|
||||
record Run(String key,String runId,String runType,String status,LocalDateTime startedAt,LocalDateTime completedAt,
|
||||
LocalDateTime createdAt,LocalDateTime updatedAt,LocalDateTime windowTime,String fingerprint) implements Serializable { }
|
||||
record Context(Selection selection,String state,List<Run> candidates,List<Run> selected,long total,boolean truncated,
|
||||
String fingerprint,String boundary) implements Serializable { }
|
||||
record Binding(Selection selection,String fingerprint) implements Serializable { }
|
||||
}
|
||||
+217
@@ -0,0 +1,217 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.codedevelopment;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/** FR-DEV-0349/0351/0352 secret-safe code-development contracts. */
|
||||
public final class CodeDevelopmentApi {
|
||||
|
||||
private CodeDevelopmentApi() {
|
||||
}
|
||||
|
||||
public enum Language { SQL, SHELL, PYTHON }
|
||||
|
||||
// body/tableName remain wire-compatible with older clients. SQL alone determines referenced tables.
|
||||
public record SqlPreviewCommand(String body, Long resourceId, Long spaceId, String tableName, String previewSql) {
|
||||
public SqlPreviewCommand(String body, Long resourceId, Long spaceId, String tableName) {
|
||||
this(body, resourceId, spaceId, tableName, null);
|
||||
}
|
||||
@Override public String toString() { return "SqlPreviewCommand[body=REDACTED]"; }
|
||||
}
|
||||
|
||||
public record SqlPreviewView(String requestId, DebugState state, List<String> columns,
|
||||
List<Map<String, String>> rows, int rowCount, long byteCount, boolean truncated,
|
||||
String errorCode, String errorSummary, LocalDateTime observedAt, String generatedSql) {
|
||||
public SqlPreviewView(String requestId, DebugState state, List<String> columns,
|
||||
List<Map<String, String>> rows, int rowCount, long byteCount, boolean truncated,
|
||||
String errorCode, String errorSummary, LocalDateTime observedAt) {
|
||||
this(requestId, state, columns, rows, rowCount, byteCount, truncated,
|
||||
errorCode, errorSummary, observedAt, null);
|
||||
}
|
||||
@Override public String toString() { return "SqlPreviewView[state=" + state + ", rows=REDACTED]"; }
|
||||
}
|
||||
|
||||
public enum ObjectStatus { ENABLED, DISABLED }
|
||||
|
||||
public enum SnippetScope { GLOBAL }
|
||||
|
||||
public enum DebugState { SUBMITTED, RUNNING, SUCCEEDED, FAILED, UNKNOWN, CANCELED }
|
||||
|
||||
public enum MaterializationTargetMode { NEW_TABLE, EXISTING_TABLE }
|
||||
|
||||
public enum MaterializationState { SUBMITTED, RUNNING, SUCCEEDED, FAILED, UNKNOWN }
|
||||
|
||||
public record TableCandidateView(long tableFileId,long storageResourceId,long storageSpaceId,
|
||||
String engineType,String catalogName,String namespaceName,String name,String resourceName,String spaceName,String availability) { }
|
||||
public record TableCandidateScopeView(long storageResourceId,long storageSpaceId,String resourceName,String spaceName,String availability) { }
|
||||
|
||||
public record ParameterDefinition(String name, String valueType, boolean required, String description) { }
|
||||
|
||||
public record CodeCreateCommand(
|
||||
String name,
|
||||
Language language,
|
||||
String body,
|
||||
List<ParameterDefinition> parameters,
|
||||
ObjectStatus status
|
||||
) {
|
||||
public CodeCreateCommand {
|
||||
status = status == null ? ObjectStatus.ENABLED : status;
|
||||
}
|
||||
public CodeCreateCommand(String name, Language language, String body, List<ParameterDefinition> parameters) {
|
||||
this(name, language, body, parameters, ObjectStatus.ENABLED);
|
||||
}
|
||||
}
|
||||
|
||||
public record CodeUpdateCommand(
|
||||
String name,
|
||||
String body,
|
||||
List<ParameterDefinition> parameters,
|
||||
ObjectStatus status,
|
||||
Long version
|
||||
) { }
|
||||
|
||||
public record CodeSummaryView(
|
||||
Long codeId,
|
||||
String name,
|
||||
Language language,
|
||||
Long orgId,
|
||||
String bodySha256,
|
||||
ObjectStatus status,
|
||||
Long version,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) { }
|
||||
|
||||
public record CodeDetailView(
|
||||
CodeSummaryView summary,
|
||||
String body,
|
||||
List<ParameterDefinition> parameters,
|
||||
List<CodeVersionView> versions
|
||||
) { }
|
||||
|
||||
public record CodeVersionView(
|
||||
Long versionId,
|
||||
Long codeId,
|
||||
Long objectVersion,
|
||||
String bodySha256,
|
||||
String snapshotSha256,
|
||||
LocalDateTime createdAt
|
||||
) { }
|
||||
|
||||
public record SnippetCreateCommand(
|
||||
String name,
|
||||
Language language,
|
||||
SnippetScope scope,
|
||||
String body,
|
||||
String description
|
||||
) { }
|
||||
|
||||
public record SnippetUpdateCommand(
|
||||
String name,
|
||||
String body,
|
||||
String description,
|
||||
ObjectStatus status,
|
||||
Long version
|
||||
) { }
|
||||
|
||||
public record SnippetView(
|
||||
Long snippetId,
|
||||
String name,
|
||||
Language language,
|
||||
SnippetScope scope,
|
||||
Long orgId,
|
||||
String body,
|
||||
String bodySha256,
|
||||
String description,
|
||||
ObjectStatus status,
|
||||
Long version,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) { }
|
||||
|
||||
/** SQL values are bound server-side; secret-shaped names and values are rejected before persistence or execution. */
|
||||
public record DebugCommand(
|
||||
Long version,
|
||||
Map<String, Object> parameters,
|
||||
List<Long> tableFileIds
|
||||
) { }
|
||||
|
||||
/** Rows are returned only for the live response and are never stored in audit or evidence. */
|
||||
public record DebugView(
|
||||
String requestId,
|
||||
Long codeId,
|
||||
Long objectVersion,
|
||||
DebugState state,
|
||||
List<String> columns,
|
||||
List<Map<String, String>> rows,
|
||||
int rowCount,
|
||||
long byteCount,
|
||||
boolean truncated,
|
||||
String sqlSha256,
|
||||
String parameterDigestSha256,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
boolean replayed,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime completedAt
|
||||
) { }
|
||||
|
||||
public record CancelView(String requestId, DebugState state, boolean cancelRequested) { }
|
||||
|
||||
public record MaterializationCommand(
|
||||
Long version,
|
||||
Map<String, Object> parameters,
|
||||
List<Long> sourceTableFileIds,
|
||||
MaterializationTargetMode targetMode,
|
||||
Long targetResourceId,
|
||||
Long targetSpaceId,
|
||||
Long targetTableFileId,
|
||||
String targetTableName,
|
||||
Long targetLayerId,
|
||||
String targetTableComment
|
||||
) {
|
||||
public MaterializationCommand(Long version, Map<String, Object> parameters, List<Long> sourceTableFileIds,
|
||||
MaterializationTargetMode targetMode, Long targetResourceId, Long targetSpaceId,
|
||||
Long targetTableFileId, String targetTableName) {
|
||||
this(version, parameters, sourceTableFileIds, targetMode, targetResourceId, targetSpaceId,
|
||||
targetTableFileId, targetTableName, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public record MaterializationExecuteCommand(Long requestVersion, Map<String, Object> parameters) { }
|
||||
|
||||
public record MaterializationColumn(String name, String sourceAlias, String comment, String nativeType,
|
||||
boolean nullable, Integer precision, Integer scale) {
|
||||
public MaterializationColumn(String name, String nativeType, boolean nullable,
|
||||
Integer precision, Integer scale) {
|
||||
this(name, null, null, nativeType, nullable, precision, scale);
|
||||
}
|
||||
}
|
||||
|
||||
public record MaterializationView(
|
||||
String requestId,
|
||||
Long codeId,
|
||||
Long objectVersion,
|
||||
MaterializationState state,
|
||||
MaterializationTargetMode targetMode,
|
||||
Long targetResourceId,
|
||||
Long targetSpaceId,
|
||||
Long targetLayerId,
|
||||
Long targetTableFileId,
|
||||
String targetTableName,
|
||||
String targetTableComment,
|
||||
List<MaterializationColumn> outputColumns,
|
||||
List<MaterializationColumn> targetColumns,
|
||||
boolean compatible,
|
||||
Long affectedRows,
|
||||
String externalObjectId,
|
||||
String externalEvidenceSha256,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
long requestVersion,
|
||||
boolean replayed,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime completedAt
|
||||
) { }
|
||||
}
|
||||
+185
@@ -0,0 +1,185 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.datatesting;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** FR-DEV-0371 through FR-DEV-0373 closed, secret-safe data-testing contracts. */
|
||||
public final class DataTestingApi {
|
||||
|
||||
private DataTestingApi() {
|
||||
}
|
||||
|
||||
public enum DefinitionStatus { DRAFT, READY }
|
||||
|
||||
public enum TestType { UNIT, ASSERTION, INTEGRATION }
|
||||
|
||||
public enum OwnerType { CODE_OBJECT, BATCH_JOB, TRANSFORMATION, SCHEDULE, TABLE_FILE }
|
||||
|
||||
public enum AssertionType { ROW_COUNT, SCHEMA, UNIQUE, RECONCILIATION, BALANCE }
|
||||
|
||||
public enum ComparisonOperator { EQ, GTE, LTE, BETWEEN }
|
||||
|
||||
public enum ValueType { STRING, LONG, DECIMAL, BOOLEAN, DATE, TIMESTAMP }
|
||||
|
||||
public enum IntegrationCheck {
|
||||
UPSTREAM_CONNECTIVITY, DOWNSTREAM_CONNECTIVITY, OWNER_PERMISSION, TASK_DEPENDENCY, RESULT_EVIDENCE
|
||||
}
|
||||
|
||||
public enum RunStatus { PENDING, RUNNING, PASSED, FAILED, ERROR, UNKNOWN, UNSUPPORTED }
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record TargetReference(OwnerType ownerType, Long targetId) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record FixtureCell(String name, ValueType valueType, String value) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record FixtureRow(List<FixtureCell> cells) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record Fixture(List<FixtureRow> rows) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record NumericExpectation(
|
||||
ComparisonOperator operator,
|
||||
Long expectedValue,
|
||||
Long upperBound
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record SchemaField(String name, ValueType valueType, Boolean nullable) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record SchemaExpectation(List<SchemaField> fields, Boolean exactOrder) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record UniqueExpectation(List<String> keyColumns) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record ReconciliationExpectation(
|
||||
TargetReference leftTarget,
|
||||
TargetReference rightTarget,
|
||||
List<String> keyColumns,
|
||||
Long maximumDifferenceRows
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record BalanceExpectation(
|
||||
TargetReference leftTarget,
|
||||
String leftField,
|
||||
TargetReference rightTarget,
|
||||
String rightField,
|
||||
Double tolerancePercent
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record AssertionDefinition(
|
||||
String assertionKey,
|
||||
String name,
|
||||
AssertionType type,
|
||||
NumericExpectation numeric,
|
||||
SchemaExpectation schema,
|
||||
UniqueExpectation unique,
|
||||
ReconciliationExpectation reconciliation,
|
||||
BalanceExpectation balance
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record DefinitionCreateRequest(
|
||||
String name,
|
||||
TestType testType,
|
||||
TargetReference target,
|
||||
Fixture fixture,
|
||||
List<AssertionDefinition> assertions,
|
||||
List<IntegrationCheck> integrationChecks
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record DefinitionUpdateRequest(
|
||||
String name,
|
||||
TestType testType,
|
||||
TargetReference target,
|
||||
Fixture fixture,
|
||||
List<AssertionDefinition> assertions,
|
||||
List<IntegrationCheck> integrationChecks,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record AssertionsUpdateRequest(List<AssertionDefinition> assertions, Long version) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record VersionRequest(Long version) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record RunRequest(Long version, String reason) {
|
||||
}
|
||||
|
||||
public record DefinitionSummaryView(
|
||||
Long testId,
|
||||
String name,
|
||||
Long orgId,
|
||||
TestType testType,
|
||||
OwnerType ownerType,
|
||||
Long targetId,
|
||||
DefinitionStatus status,
|
||||
Long version,
|
||||
Long currentSnapshotId,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record DefinitionDetailView(
|
||||
DefinitionSummaryView summary,
|
||||
Fixture fixture,
|
||||
List<AssertionDefinition> assertions,
|
||||
List<IntegrationCheck> integrationChecks,
|
||||
String definitionSha256
|
||||
) {
|
||||
}
|
||||
|
||||
public record SnapshotView(
|
||||
Long snapshotId,
|
||||
Long testId,
|
||||
Long definitionVersion,
|
||||
String snapshotSha256,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record RunView(
|
||||
Long runId,
|
||||
Long testId,
|
||||
Long snapshotId,
|
||||
TestType actionType,
|
||||
RunStatus status,
|
||||
String evidenceRef,
|
||||
String evidenceSha256,
|
||||
String sourceStatus,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime observedAt,
|
||||
LocalDateTime lastSyncAt,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.engineering;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import cn.aixunkeji.datagov.dataops.api.batchingestion.UnifiedIngestionApi.SourceSelection;
|
||||
import cn.aixunkeji.datagov.dataops.api.storage.StorageResourceType;
|
||||
|
||||
/** Current, authorized metadata only. A binding is an expected value, never an authorization token. */
|
||||
public interface EngineeringContextDirectory {
|
||||
String VERSION = "1.0.0";
|
||||
Context current(Selection selection);
|
||||
default void validateBatch(Binding binding, Map<String,Object> configuration) { throw new IllegalStateException("当前工程依据服务不支持批量映射核对"); }
|
||||
default void validateLayer(Binding binding, Map<String,Object> configuration) { throw new IllegalStateException("当前工程依据服务不支持分层核对"); }
|
||||
default void validateVisual(Binding binding, Map<String,Object> configuration) { throw new IllegalStateException("当前工程依据服务不支持可视化映射核对"); }
|
||||
default void validateCleaning(Binding binding, Map<String,Object> configuration) { throw new IllegalStateException("当前工程依据服务不支持转换清洗核对"); }
|
||||
default void validateTableStructure(Binding binding, Map<String,Object> configuration) { throw new IllegalStateException("当前工程依据服务不支持表结构核对"); }
|
||||
default void validateSchedule(Binding binding, Map<String,Object> configuration) { throw new IllegalStateException("当前工程依据服务不支持治理流程核对"); }
|
||||
record Reference(String kind, String id, Map<String,String> executionOptions) implements Serializable {
|
||||
public Reference(String kind,String id){this(kind,id,Map.of());}
|
||||
public Reference { executionOptions=executionOptions==null?Map.of():java.util.Collections.unmodifiableMap(new java.util.TreeMap<>(executionOptions)); }
|
||||
}
|
||||
record EditedObject(String id, long version) implements Serializable { }
|
||||
record Ingestion(List<SourceSelection> sources, StorageResourceType targetType,
|
||||
String resourceId, String spaceId) implements Serializable { }
|
||||
record BatchSelection(String sourceId, String sourceObject, String resourceId,
|
||||
String spaceId, String targetObject) implements Serializable { }
|
||||
record LayerSelection(String resourceId, String spaceId, String layerType, Long admissionVersion) implements Serializable {
|
||||
public LayerSelection(String resourceId,String spaceId,String layerType){this(resourceId,spaceId,layerType,null);}
|
||||
}
|
||||
record VisualSelection(String sourceId,String sourceObject,String resourceId,String spaceId,String targetObject) implements Serializable { }
|
||||
record PublicationSelection(String id,int version) implements Serializable { }
|
||||
record CleaningSelection(String sourceTableId,String outputTableId,List<PublicationSelection> publications) implements Serializable { }
|
||||
record TableStructureSelection(String resourceId,String spaceId,String layerId,String sourceTableFileId) implements Serializable { }
|
||||
record Selection(String type, List<Reference> references, Ingestion ingestion,
|
||||
EditedObject editedObject, BatchSelection batch, LayerSelection layer,VisualSelection visual,CleaningSelection cleaning,TableStructureSelection tableStructure) implements Serializable {
|
||||
public Selection(String type,List<Reference> references,Ingestion ingestion,EditedObject editedObject,BatchSelection batch,LayerSelection layer,VisualSelection visual,CleaningSelection cleaning){this(type,references,ingestion,editedObject,batch,layer,visual,cleaning,null);}
|
||||
public Selection(String type,List<Reference> references,Ingestion ingestion,EditedObject editedObject,BatchSelection batch,LayerSelection layer,VisualSelection visual){this(type,references,ingestion,editedObject,batch,layer,visual,null);}
|
||||
public Selection(String type,List<Reference> references,Ingestion ingestion,EditedObject editedObject){this(type,references,ingestion,editedObject,null,null,null);}
|
||||
public Selection(String type,List<Reference> references,Ingestion ingestion,EditedObject editedObject,BatchSelection batch){this(type,references,ingestion,editedObject,batch,null,null);}
|
||||
public Selection(String type,List<Reference> references,Ingestion ingestion,EditedObject editedObject,BatchSelection batch,LayerSelection layer){this(type,references,ingestion,editedObject,batch,layer,null);}
|
||||
}
|
||||
record Binding(Selection selection, String contextSha256) implements Serializable { }
|
||||
record Field(String name, String type, Boolean nullable, Integer precision, Integer scale) implements Serializable {
|
||||
public Field(String name,String type,Boolean nullable){this(name,type,nullable,null,null);}
|
||||
}
|
||||
record Fact(String key, String kind, String id, String version, String sha256,
|
||||
String state, String capability, List<Field> fields) implements Serializable { }
|
||||
record Source(String key, String id, long version, String name, String database,
|
||||
String table, String fingerprint, List<Field> sourceFields,
|
||||
List<Field> proposedTargetFields) implements Serializable { }
|
||||
record Target(String resourceId, long resourceVersion, long accessVersion,
|
||||
String spaceId, long spaceVersion, String type, String namespace) implements Serializable { }
|
||||
record LayerDefinition(String key, String id, String name, String layerType, long version,
|
||||
long admissionVersion, String granularity, String namingPattern,
|
||||
java.math.BigDecimal minimumQualityScore, int lifecycleDays, List<String> upstreamIds,
|
||||
boolean enabled, String mappingStatus, String definitionSha256) implements Serializable { }
|
||||
record LayerContext(String resourceId, long resourceVersion, Long accessVersion, String spaceId,
|
||||
long spaceVersion, String engineType, String catalogName, String namespaceName,
|
||||
String mappingSha256, List<LayerDefinition> layers) implements Serializable { }
|
||||
record Context(Selection selection, List<Fact> facts, List<Source> sources, Target target,
|
||||
String contextSha256, String scopeNote, LayerContext layer) implements Serializable {
|
||||
public Context(Selection selection,List<Fact> facts,List<Source> sources,Target target,String contextSha256,String scopeNote){this(selection,facts,sources,target,contextSha256,scopeNote,null);}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
/** Evidence state; registration alone never implies execution support. */
|
||||
public enum AggregateCapabilityStatus {
|
||||
SUPPORTED,
|
||||
UNSUPPORTED,
|
||||
UNKNOWN
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/** Minimal public aggregate-ingestion command. Internal references and engine configuration are server-owned. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record AggregateIngestionCreateCommand(
|
||||
String name,
|
||||
AggregateIngestionSourceScenario sourceScenario,
|
||||
AggregateIngestionRunMode runMode,
|
||||
String endpoint,
|
||||
FileAuthMode authMode,
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) char[] password,
|
||||
String responseContentField,
|
||||
FilePaginationMode paginationMode,
|
||||
String paginationField,
|
||||
String cursorResponseField,
|
||||
Integer maxPages,
|
||||
Integer rateLimitPerMinute,
|
||||
String incrementalMarker,
|
||||
String relativePath,
|
||||
List<FileFormat> allowedFormats,
|
||||
AggregateScheduleType scheduleType,
|
||||
Integer periodSeconds,
|
||||
String scheduleCron,
|
||||
String scheduleTimezone,
|
||||
Long datasourceId,
|
||||
Long datasourceVersion,
|
||||
String sourceObject,
|
||||
CdcStartPosition cdcStartPosition,
|
||||
Long targetStorageResourceId,
|
||||
Long targetStorageSpaceId,
|
||||
String targetObject
|
||||
) implements AutoCloseable {
|
||||
|
||||
public AggregateIngestionCreateCommand {
|
||||
password = password == null ? null : password.clone();
|
||||
allowedFormats = allowedFormats == null ? null : List.copyOf(allowedFormats);
|
||||
}
|
||||
|
||||
@Override
|
||||
public char[] password() {
|
||||
return password == null ? null : password.clone();
|
||||
}
|
||||
|
||||
public boolean passwordProvided() {
|
||||
return password != null && password.length > 0;
|
||||
}
|
||||
|
||||
@JsonAnySetter
|
||||
public void rejectUnknownField(String fieldName, Object ignored) {
|
||||
throw new IllegalArgumentException("不支持的聚合采集字段: " + fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (password != null) Arrays.fill(password, '\0');
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AggregateIngestionCreateCommand[password=REDACTED]";
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record AggregateIngestionPageView(List<AggregateIngestionView> rows, long total) {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
/** Execution ownership is external: on-demand SeaTunnel, scheduled DolphinScheduler, continuous SeaTunnel CDC. */
|
||||
public enum AggregateIngestionRunMode {
|
||||
ON_DEMAND,
|
||||
SCHEDULED,
|
||||
CONTINUOUS
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
/** Neutral source scenarios for the aggregate-ingestion control plane. */
|
||||
public enum AggregateIngestionSourceScenario {
|
||||
FILE_TRANSFER,
|
||||
API_PULL,
|
||||
DATABASE_CDC
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record AggregateIngestionUpdateCommand(
|
||||
long version,
|
||||
String name,
|
||||
AggregateIngestionSourceScenario sourceScenario,
|
||||
AggregateIngestionRunMode runMode,
|
||||
String endpoint,
|
||||
FileAuthMode authMode,
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) char[] password,
|
||||
String responseContentField,
|
||||
FilePaginationMode paginationMode,
|
||||
String paginationField,
|
||||
String cursorResponseField,
|
||||
Integer maxPages,
|
||||
Integer rateLimitPerMinute,
|
||||
String incrementalMarker,
|
||||
String relativePath,
|
||||
List<FileFormat> allowedFormats,
|
||||
AggregateScheduleType scheduleType,
|
||||
Integer periodSeconds,
|
||||
String scheduleCron,
|
||||
String scheduleTimezone,
|
||||
Long datasourceId,
|
||||
Long datasourceVersion,
|
||||
String sourceObject,
|
||||
CdcStartPosition cdcStartPosition,
|
||||
Long targetStorageResourceId,
|
||||
Long targetStorageSpaceId,
|
||||
String targetObject
|
||||
) implements AutoCloseable {
|
||||
|
||||
public AggregateIngestionUpdateCommand {
|
||||
password = password == null ? null : password.clone();
|
||||
allowedFormats = allowedFormats == null ? null : List.copyOf(allowedFormats);
|
||||
}
|
||||
|
||||
@Override
|
||||
public char[] password() {
|
||||
return password == null ? null : password.clone();
|
||||
}
|
||||
|
||||
public boolean passwordProvided() {
|
||||
return password != null && password.length > 0;
|
||||
}
|
||||
|
||||
@JsonAnySetter
|
||||
public void rejectUnknownField(String fieldName, Object ignored) {
|
||||
throw new IllegalArgumentException("不支持的聚合采集字段: " + fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (password != null) Arrays.fill(password, '\0');
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AggregateIngestionUpdateCommand[password=REDACTED]";
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** Public neutral view. Endpoint text, internal sourceRef, secretRef and engine configuration are omitted. */
|
||||
public record AggregateIngestionView(
|
||||
long ingestionId,
|
||||
String ingestionCode,
|
||||
String name,
|
||||
AggregateIngestionSourceScenario sourceScenario,
|
||||
AggregateIngestionRunMode runMode,
|
||||
AggregateScheduleType scheduleType,
|
||||
Integer periodSeconds,
|
||||
String scheduleCron,
|
||||
String scheduleTimezone,
|
||||
boolean endpointConfigured,
|
||||
FileAuthMode authMode,
|
||||
boolean credentialConfigured,
|
||||
String responseContentField,
|
||||
FilePaginationMode paginationMode,
|
||||
String paginationField,
|
||||
String cursorResponseField,
|
||||
Integer maxPages,
|
||||
Integer rateLimitPerMinute,
|
||||
String incrementalMarker,
|
||||
String relativePath,
|
||||
List<FileFormat> allowedFormats,
|
||||
Long datasourceId,
|
||||
Long datasourceVersion,
|
||||
String sourceObject,
|
||||
CdcStartPosition cdcStartPosition,
|
||||
Long targetStorageResourceId,
|
||||
Long targetStorageSpaceId,
|
||||
String targetObject,
|
||||
AggregateCapabilityStatus capabilityStatus,
|
||||
FileIngestionStatus status,
|
||||
long version,
|
||||
LocalDateTime capabilityCheckedAt,
|
||||
LocalDateTime capabilityExpiresAt,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
public enum AggregateScheduleType {
|
||||
FIXED_PERIOD,
|
||||
CRON
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
/** Controlled CDC starting-point policy. Raw binlog/WAL offsets are not accepted from public requests. */
|
||||
public enum CdcStartPosition {
|
||||
EARLIEST,
|
||||
LATEST,
|
||||
RESUME_FROM_CHECKPOINT
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
public record FileActionCommand(String reason) {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
/** Explicit V1 connector allow-list; free-form connector names are not accepted. */
|
||||
public enum FileApiConnector {
|
||||
GENERIC_HTTPS_JSON,
|
||||
SALESFORCE,
|
||||
SERVICENOW
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
/** Structured authentication modes resolved from a server-managed credential by the integration gateway. */
|
||||
public enum FileAuthMode {
|
||||
BASIC,
|
||||
BEARER,
|
||||
API_KEY,
|
||||
OAUTH2_CLIENT_CREDENTIALS
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public record FileBatchView(
|
||||
long batchId,
|
||||
long intakeId,
|
||||
long runId,
|
||||
String externalBatchId,
|
||||
String sourceRef,
|
||||
String fileName,
|
||||
FileFormat format,
|
||||
Long fileSizeBytes,
|
||||
Long recordCount,
|
||||
String sha256,
|
||||
LocalDateTime evidenceAt,
|
||||
String evidenceRef,
|
||||
String validationStatus,
|
||||
String handlingStatus,
|
||||
boolean retryable,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
public enum FileFormat {
|
||||
CSV,
|
||||
JSON,
|
||||
JSONL,
|
||||
PARQUET,
|
||||
ORC,
|
||||
XLSX
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
public enum FileIngestionStatus {
|
||||
DRAFT,
|
||||
READY,
|
||||
SUBMITTED,
|
||||
RUNNING,
|
||||
SUCCEEDED,
|
||||
FAILED,
|
||||
CANCELED,
|
||||
UNKNOWN
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface FileIntakeConfiguration extends AutoCloseable {
|
||||
String name();
|
||||
String dataDomainCode();
|
||||
FileSourceType sourceType();
|
||||
String sourceRef();
|
||||
FileApiConnector apiConnector();
|
||||
String endpoint();
|
||||
FileAuthMode authMode();
|
||||
char[] password();
|
||||
boolean passwordProvided();
|
||||
FilePaginationMode paginationMode();
|
||||
Integer rateLimitPerMinute();
|
||||
String incrementalMarker();
|
||||
Integer periodSeconds();
|
||||
String relativePath();
|
||||
String fileNamePattern();
|
||||
List<FileFormat> allowedFormats();
|
||||
Long maxFileSizeBytes();
|
||||
Long minRecordCount();
|
||||
Long maxRecordCount();
|
||||
Map<String, String> headers();
|
||||
String rawScript();
|
||||
String paginationField();
|
||||
String cursorResponseField();
|
||||
Integer maxPages();
|
||||
String responseContentField();
|
||||
Long targetStorageResourceId();
|
||||
Long targetStorageSpaceId();
|
||||
String targetObject();
|
||||
List<FileSchemaFieldCommand> schema();
|
||||
AggregateIngestionSourceScenario sourceScenario();
|
||||
AggregateIngestionRunMode runMode();
|
||||
AggregateScheduleType scheduleType();
|
||||
String scheduleCron();
|
||||
String scheduleTimezone();
|
||||
Long datasourceId();
|
||||
Long datasourceVersion();
|
||||
String sourceObject();
|
||||
CdcStartPosition cdcStartPosition();
|
||||
|
||||
@Override
|
||||
void close();
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record FileIntakeCreateCommand(
|
||||
String name,
|
||||
String dataDomainCode,
|
||||
FileSourceType sourceType,
|
||||
String sourceRef,
|
||||
FileApiConnector apiConnector,
|
||||
String endpoint,
|
||||
FileAuthMode authMode,
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) char[] password,
|
||||
FilePaginationMode paginationMode,
|
||||
Integer rateLimitPerMinute,
|
||||
String incrementalMarker,
|
||||
Integer periodSeconds,
|
||||
String relativePath,
|
||||
String fileNamePattern,
|
||||
List<FileFormat> allowedFormats,
|
||||
Long maxFileSizeBytes,
|
||||
Long minRecordCount,
|
||||
Long maxRecordCount,
|
||||
Map<String, String> headers,
|
||||
String rawScript,
|
||||
String paginationField,
|
||||
String cursorResponseField,
|
||||
Integer maxPages,
|
||||
String responseContentField,
|
||||
Long targetStorageResourceId,
|
||||
Long targetStorageSpaceId,
|
||||
String targetObject,
|
||||
List<FileSchemaFieldCommand> schema,
|
||||
AggregateIngestionSourceScenario sourceScenario,
|
||||
AggregateIngestionRunMode runMode,
|
||||
AggregateScheduleType scheduleType,
|
||||
String scheduleCron,
|
||||
String scheduleTimezone,
|
||||
Long datasourceId,
|
||||
Long datasourceVersion,
|
||||
String sourceObject,
|
||||
CdcStartPosition cdcStartPosition
|
||||
) implements FileIntakeConfiguration {
|
||||
|
||||
public FileIntakeCreateCommand {
|
||||
password = password == null ? null : password.clone();
|
||||
allowedFormats = allowedFormats == null ? null : List.copyOf(allowedFormats);
|
||||
headers = headers == null ? null : Map.copyOf(headers);
|
||||
schema = schema == null ? null : List.copyOf(schema);
|
||||
}
|
||||
|
||||
public FileIntakeCreateCommand(String name, String dataDomainCode,
|
||||
FileSourceType sourceType, String sourceRef, FileApiConnector apiConnector,
|
||||
String endpoint, FileAuthMode authMode, char[] password,
|
||||
FilePaginationMode paginationMode, Integer rateLimitPerMinute,
|
||||
String incrementalMarker, Integer periodSeconds, String relativePath,
|
||||
String fileNamePattern, List<FileFormat> allowedFormats,
|
||||
Long maxFileSizeBytes, Long minRecordCount, Long maxRecordCount,
|
||||
Map<String, String> headers, String rawScript) {
|
||||
this(name, dataDomainCode, sourceType, sourceRef, apiConnector, endpoint, authMode,
|
||||
password, paginationMode, rateLimitPerMinute, incrementalMarker, periodSeconds, relativePath,
|
||||
fileNamePattern, allowedFormats, maxFileSizeBytes, minRecordCount, maxRecordCount, headers,
|
||||
rawScript, null, null, null, null, null, null, null, List.of(),
|
||||
null, null, null, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
public FileIntakeCreateCommand(
|
||||
String name, String dataDomainCode, FileSourceType sourceType, String sourceRef,
|
||||
FileApiConnector apiConnector, String endpoint, FileAuthMode authMode, char[] password,
|
||||
FilePaginationMode paginationMode, Integer rateLimitPerMinute, String incrementalMarker,
|
||||
Integer periodSeconds, String relativePath, String fileNamePattern, List<FileFormat> allowedFormats,
|
||||
Long maxFileSizeBytes, Long minRecordCount, Long maxRecordCount, Map<String, String> headers,
|
||||
String rawScript, String paginationField, String cursorResponseField, Integer maxPages,
|
||||
String responseContentField, Long targetStorageResourceId, Long targetStorageSpaceId,
|
||||
String targetObject, List<FileSchemaFieldCommand> schema
|
||||
) {
|
||||
this(name, dataDomainCode, sourceType, sourceRef, apiConnector, endpoint, authMode, password,
|
||||
paginationMode, rateLimitPerMinute, incrementalMarker, periodSeconds, relativePath, fileNamePattern,
|
||||
allowedFormats, maxFileSizeBytes, minRecordCount, maxRecordCount, headers, rawScript,
|
||||
paginationField, cursorResponseField, maxPages, responseContentField, targetStorageResourceId,
|
||||
targetStorageSpaceId, targetObject, schema, null, null, null, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public char[] password() {
|
||||
return password == null ? null : password.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean passwordProvided() {
|
||||
return password != null && password.length > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (password != null) {
|
||||
Arrays.fill(password, '\0');
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FileIntakeCreateCommand[password=REDACTED]";
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record FileIntakePageView(List<FileIntakeView> rows, long total) {
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record FileIntakeUpdateCommand(
|
||||
long version,
|
||||
String name,
|
||||
String dataDomainCode,
|
||||
FileSourceType sourceType,
|
||||
String sourceRef,
|
||||
FileApiConnector apiConnector,
|
||||
String endpoint,
|
||||
FileAuthMode authMode,
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) char[] password,
|
||||
FilePaginationMode paginationMode,
|
||||
Integer rateLimitPerMinute,
|
||||
String incrementalMarker,
|
||||
Integer periodSeconds,
|
||||
String relativePath,
|
||||
String fileNamePattern,
|
||||
List<FileFormat> allowedFormats,
|
||||
Long maxFileSizeBytes,
|
||||
Long minRecordCount,
|
||||
Long maxRecordCount,
|
||||
Map<String, String> headers,
|
||||
String rawScript,
|
||||
String paginationField,
|
||||
String cursorResponseField,
|
||||
Integer maxPages,
|
||||
String responseContentField,
|
||||
Long targetStorageResourceId,
|
||||
Long targetStorageSpaceId,
|
||||
String targetObject,
|
||||
List<FileSchemaFieldCommand> schema,
|
||||
AggregateIngestionSourceScenario sourceScenario,
|
||||
AggregateIngestionRunMode runMode,
|
||||
AggregateScheduleType scheduleType,
|
||||
String scheduleCron,
|
||||
String scheduleTimezone,
|
||||
Long datasourceId,
|
||||
Long datasourceVersion,
|
||||
String sourceObject,
|
||||
CdcStartPosition cdcStartPosition
|
||||
) implements FileIntakeConfiguration {
|
||||
|
||||
public FileIntakeUpdateCommand {
|
||||
password = password == null ? null : password.clone();
|
||||
allowedFormats = allowedFormats == null ? null : List.copyOf(allowedFormats);
|
||||
headers = headers == null ? null : Map.copyOf(headers);
|
||||
schema = schema == null ? null : List.copyOf(schema);
|
||||
}
|
||||
|
||||
public FileIntakeUpdateCommand(long version, String name, String dataDomainCode,
|
||||
FileSourceType sourceType, String sourceRef, FileApiConnector apiConnector,
|
||||
String endpoint, FileAuthMode authMode, char[] password,
|
||||
FilePaginationMode paginationMode, Integer rateLimitPerMinute,
|
||||
String incrementalMarker, Integer periodSeconds, String relativePath,
|
||||
String fileNamePattern, List<FileFormat> allowedFormats,
|
||||
Long maxFileSizeBytes, Long minRecordCount, Long maxRecordCount,
|
||||
Map<String, String> headers, String rawScript) {
|
||||
this(version, name, dataDomainCode, sourceType, sourceRef, apiConnector, endpoint,
|
||||
authMode, password, paginationMode, rateLimitPerMinute, incrementalMarker, periodSeconds,
|
||||
relativePath, fileNamePattern, allowedFormats, maxFileSizeBytes, minRecordCount, maxRecordCount,
|
||||
headers, rawScript, null, null, null, null, null, null, null, List.of(),
|
||||
null, null, null, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
public FileIntakeUpdateCommand(
|
||||
long version, String name, String dataDomainCode, FileSourceType sourceType, String sourceRef,
|
||||
FileApiConnector apiConnector, String endpoint, FileAuthMode authMode, char[] password,
|
||||
FilePaginationMode paginationMode, Integer rateLimitPerMinute, String incrementalMarker,
|
||||
Integer periodSeconds, String relativePath, String fileNamePattern, List<FileFormat> allowedFormats,
|
||||
Long maxFileSizeBytes, Long minRecordCount, Long maxRecordCount, Map<String, String> headers,
|
||||
String rawScript, String paginationField, String cursorResponseField, Integer maxPages,
|
||||
String responseContentField, Long targetStorageResourceId, Long targetStorageSpaceId,
|
||||
String targetObject, List<FileSchemaFieldCommand> schema
|
||||
) {
|
||||
this(version, name, dataDomainCode, sourceType, sourceRef, apiConnector, endpoint, authMode, password,
|
||||
paginationMode, rateLimitPerMinute, incrementalMarker, periodSeconds, relativePath, fileNamePattern,
|
||||
allowedFormats, maxFileSizeBytes, minRecordCount, maxRecordCount, headers, rawScript,
|
||||
paginationField, cursorResponseField, maxPages, responseContentField, targetStorageResourceId,
|
||||
targetStorageSpaceId, targetObject, schema, null, null, null, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public char[] password() {
|
||||
return password == null ? null : password.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean passwordProvided() {
|
||||
return password != null && password.length > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (password != null) {
|
||||
Arrays.fill(password, '\0');
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FileIntakeUpdateCommand[password=REDACTED]";
|
||||
}
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** Authorized view. Sensitive endpoint and secretRef names are intentionally omitted. */
|
||||
public record FileIntakeView(
|
||||
long intakeId,
|
||||
long definitionId,
|
||||
long currentSnapshotId,
|
||||
String intakeCode,
|
||||
String name,
|
||||
long orgScopeId,
|
||||
String dataDomainCode,
|
||||
FileSourceType sourceType,
|
||||
String sourceRef,
|
||||
FileApiConnector apiConnector,
|
||||
boolean endpointConfigured,
|
||||
FileAuthMode authMode,
|
||||
boolean secretConfigured,
|
||||
FilePaginationMode paginationMode,
|
||||
Integer rateLimitPerMinute,
|
||||
String incrementalMarker,
|
||||
Integer periodSeconds,
|
||||
String relativePath,
|
||||
String fileNamePattern,
|
||||
List<FileFormat> allowedFormats,
|
||||
Long maxFileSizeBytes,
|
||||
Long minRecordCount,
|
||||
Long maxRecordCount,
|
||||
FileIngestionStatus status,
|
||||
long version,
|
||||
LocalDateTime capabilityCheckedAt,
|
||||
LocalDateTime capabilityExpiresAt,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt,
|
||||
String paginationField,
|
||||
String cursorResponseField,
|
||||
Integer maxPages,
|
||||
String responseContentField,
|
||||
Long targetStorageResourceId,
|
||||
Long targetStorageSpaceId,
|
||||
String targetObject,
|
||||
List<FileSchemaFieldCommand> schema,
|
||||
AggregateIngestionSourceScenario sourceScenario,
|
||||
AggregateIngestionRunMode runMode,
|
||||
AggregateScheduleType scheduleType,
|
||||
String scheduleCron,
|
||||
String scheduleTimezone,
|
||||
Long datasourceId,
|
||||
Long datasourceVersion,
|
||||
String sourceObject,
|
||||
CdcStartPosition cdcStartPosition,
|
||||
AggregateCapabilityStatus capabilityStatus
|
||||
) {
|
||||
|
||||
public FileIntakeView(
|
||||
long intakeId, long definitionId, long currentSnapshotId, String intakeCode, String name,
|
||||
long orgScopeId, String dataDomainCode, FileSourceType sourceType, String sourceRef,
|
||||
FileApiConnector apiConnector, boolean endpointConfigured, FileAuthMode authMode,
|
||||
boolean secretConfigured, FilePaginationMode paginationMode, Integer rateLimitPerMinute,
|
||||
String incrementalMarker, Integer periodSeconds, String relativePath, String fileNamePattern,
|
||||
List<FileFormat> allowedFormats, long maxFileSizeBytes, long minRecordCount, long maxRecordCount,
|
||||
FileIngestionStatus status, long version, LocalDateTime capabilityCheckedAt,
|
||||
LocalDateTime capabilityExpiresAt, LocalDateTime createdAt, LocalDateTime updatedAt,
|
||||
String paginationField, String cursorResponseField, Integer maxPages, String responseContentField,
|
||||
Long targetStorageResourceId, Long targetStorageSpaceId, String targetObject,
|
||||
List<FileSchemaFieldCommand> schema
|
||||
) {
|
||||
this(intakeId, definitionId, currentSnapshotId, intakeCode, name, orgScopeId, dataDomainCode,
|
||||
sourceType, sourceRef, apiConnector, endpointConfigured, authMode, secretConfigured,
|
||||
paginationMode, rateLimitPerMinute, incrementalMarker, periodSeconds, relativePath, fileNamePattern,
|
||||
allowedFormats, maxFileSizeBytes, minRecordCount, maxRecordCount, status, version,
|
||||
capabilityCheckedAt, capabilityExpiresAt, createdAt, updatedAt, paginationField,
|
||||
cursorResponseField, maxPages, responseContentField, targetStorageResourceId,
|
||||
targetStorageSpaceId, targetObject, schema,
|
||||
sourceType == FileSourceType.API_SAAS ? AggregateIngestionSourceScenario.API_PULL :
|
||||
AggregateIngestionSourceScenario.FILE_TRANSFER,
|
||||
sourceType == FileSourceType.API_SAAS && periodSeconds != null ?
|
||||
AggregateIngestionRunMode.SCHEDULED : AggregateIngestionRunMode.ON_DEMAND,
|
||||
sourceType == FileSourceType.API_SAAS && periodSeconds != null ? AggregateScheduleType.FIXED_PERIOD : null,
|
||||
null, null, null, null, null, null, AggregateCapabilityStatus.UNKNOWN);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
public enum FilePaginationMode {
|
||||
OFFSET_LIMIT,
|
||||
PAGE_SIZE,
|
||||
CURSOR,
|
||||
LINK_HEADER
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/** Internal, current-user source binding. Path fields must never be forwarded to a model. */
|
||||
public interface FilePreviewSourceDirectory {
|
||||
Source current(Selection selection);
|
||||
void validate(Selection selection, String expectedSha256, List<Mapping> mappings);
|
||||
|
||||
record Selection(long intakeId, long version, Long targetTableFileId) implements Serializable { }
|
||||
record Column(String name, String type, Boolean nullable, Integer precision, Integer scale)
|
||||
implements Serializable { }
|
||||
record Mapping(String sourceField, String targetField, String fieldType, boolean nullable)
|
||||
implements Serializable { }
|
||||
record Source(Selection selection, long actorId, long orgId, long snapshotId, String sourceRef,
|
||||
String relativePath, String fileNamePattern, String format, long maximumBytes,
|
||||
List<Column> targetColumns, String sha256) implements Serializable { }
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public record FileQuarantineActionView(
|
||||
long actionId,
|
||||
long batchId,
|
||||
String actionType,
|
||||
String reason,
|
||||
String originalSourceRef,
|
||||
String originalSha256,
|
||||
String originalExternalId,
|
||||
String externalActionId,
|
||||
String actionStatus,
|
||||
boolean retryable,
|
||||
LocalDateTime evidenceAt,
|
||||
String evidenceRef,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
public record FileReadyCommand(long version) {
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public record FileRunView(
|
||||
long runId,
|
||||
long intakeId,
|
||||
long definitionId,
|
||||
long snapshotId,
|
||||
String requestId,
|
||||
String batchNo,
|
||||
FileIngestionStatus status,
|
||||
String sourceStatus,
|
||||
String externalJobId,
|
||||
boolean retryable,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime startedAt,
|
||||
LocalDateTime completedAt,
|
||||
LocalDateTime createdAt,
|
||||
long version
|
||||
) {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
public record FileSchemaFieldCommand(
|
||||
String sourceField,
|
||||
String targetField,
|
||||
String fieldType,
|
||||
boolean nullable
|
||||
) {
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
/** Legacy source discriminator retained for storage and old clients. */
|
||||
public enum FileSourceType {
|
||||
API_SAAS,
|
||||
FTP,
|
||||
SHARED_DIRECTORY,
|
||||
OBJECT_STORAGE,
|
||||
DATABASE_CDC
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.fileingestion;
|
||||
|
||||
public record FileSubmitCommand(long version) {
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.golden;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/** Current-session, owner-authorized binding for a saved historical golden run. No execution methods. */
|
||||
public interface GoldenRunStageDirectory {
|
||||
String VERSION = "1.0.0";
|
||||
Binding current(String runId);
|
||||
record Binding(String runId, String snapshotId, long version, String batchNo, String requestId,
|
||||
String runType, String status, String updatedAt, String fingerprint) implements Serializable { }
|
||||
}
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.lakehouse;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FR-STORE-0325 through FR-STORE-0328 public, secret-free lakehouse layer contracts.
|
||||
*/
|
||||
public final class LakehouseLayerApi {
|
||||
|
||||
private LakehouseLayerApi() {
|
||||
}
|
||||
|
||||
public enum LayerType {
|
||||
ODS,
|
||||
DWD,
|
||||
DWS,
|
||||
ADS,
|
||||
SANDBOX
|
||||
}
|
||||
|
||||
public enum EngineType {
|
||||
HIVE,
|
||||
DORIS
|
||||
}
|
||||
|
||||
public enum StorageFormat {
|
||||
ORC,
|
||||
PARQUET,
|
||||
DORIS_NATIVE
|
||||
}
|
||||
|
||||
public enum Granularity {
|
||||
ROW,
|
||||
EVENT,
|
||||
SNAPSHOT,
|
||||
AGGREGATE
|
||||
}
|
||||
|
||||
public enum MappingStatus {
|
||||
CONFIRMED,
|
||||
REJECTED,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
/** FR-STORE-0326: derived from authorized Owner metadata, never an execution profile. */
|
||||
public record DirectoryMappingView(EngineType engineType, String catalogName, String namespaceName,
|
||||
String locationUri, String externalDirectoryId) { }
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record DirectoryRevalidateCommand(Long version) { }
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record AdmissionCommand(
|
||||
Granularity granularity,
|
||||
String namingPattern,
|
||||
BigDecimal minimumQualityScore,
|
||||
Integer lifecycleDays
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record LayerCreateCommand(
|
||||
String layerName,
|
||||
LayerType layerType,
|
||||
Long storageResourceId,
|
||||
Long storageSpaceId,
|
||||
EngineType engineType,
|
||||
StorageFormat storageFormat,
|
||||
String catalogName,
|
||||
String namespaceName,
|
||||
String locationUri,
|
||||
String externalDirectoryId,
|
||||
Boolean enabled,
|
||||
AdmissionCommand admission,
|
||||
List<Long> upstreamLayerIds
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record LayerUpdateCommand(
|
||||
String layerName,
|
||||
Long storageResourceId,
|
||||
Long storageSpaceId,
|
||||
EngineType engineType,
|
||||
StorageFormat storageFormat,
|
||||
String catalogName,
|
||||
String namespaceName,
|
||||
String locationUri,
|
||||
String externalDirectoryId,
|
||||
Boolean enabled,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record AdmissionUpdateCommand(
|
||||
AdmissionCommand admission,
|
||||
List<Long> upstreamLayerIds,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
|
||||
/** One atomic revision of an inactive layer; metadata and admission versions are independent. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record LayerDefinitionUpdateCommand(
|
||||
String layerName,Long storageResourceId,Long storageSpaceId,EngineType engineType,StorageFormat storageFormat,
|
||||
String catalogName,String namespaceName,String locationUri,String externalDirectoryId,Boolean enabled,
|
||||
Long version,AdmissionCommand admission,List<Long> upstreamLayerIds,Long admissionVersion
|
||||
) { }
|
||||
|
||||
/** Explicit selection only; omitted layers are never initialized. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record LayerInitializationCommand(
|
||||
Long storageResourceId,
|
||||
Long storageSpaceId,
|
||||
String namePrefix,
|
||||
List<LayerType> selectedLayers,
|
||||
Boolean enabled,
|
||||
AdmissionCommand admission
|
||||
) {
|
||||
}
|
||||
|
||||
public record LayerInitializationItemView(
|
||||
LayerType layerType,
|
||||
String layerName,
|
||||
String status,
|
||||
String requestId,
|
||||
Long layerId,
|
||||
String errorCode,
|
||||
String errorSummary
|
||||
) {
|
||||
}
|
||||
|
||||
public record LayerInitializationView(
|
||||
Long storageResourceId,
|
||||
Long storageSpaceId,
|
||||
String namespaceName,
|
||||
List<LayerInitializationItemView> items
|
||||
) {
|
||||
}
|
||||
|
||||
public record LayerView(
|
||||
Long layerId,
|
||||
String layerName,
|
||||
LayerType layerType,
|
||||
Long orgId,
|
||||
Long storageResourceId,
|
||||
Long storageSpaceId,
|
||||
EngineType engineType,
|
||||
StorageFormat storageFormat,
|
||||
String catalogName,
|
||||
String namespaceName,
|
||||
String locationUri,
|
||||
String externalDirectoryId,
|
||||
MappingStatus mappingStatus,
|
||||
String mappingErrorCode,
|
||||
String mappingErrorSummary,
|
||||
int mappingRetryCount,
|
||||
LocalDateTime lastValidatedAt,
|
||||
boolean enabled,
|
||||
long version,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record AdmissionView(
|
||||
Long admissionId,
|
||||
Long layerId,
|
||||
Granularity granularity,
|
||||
String namingPattern,
|
||||
BigDecimal minimumQualityScore,
|
||||
int lifecycleDays,
|
||||
long version,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record DependencyView(
|
||||
Long dependencyId,
|
||||
Long layerId,
|
||||
Long upstreamLayerId,
|
||||
String upstreamLayerName,
|
||||
LayerType upstreamLayerType,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record LayerDetailView(
|
||||
LayerView layer,
|
||||
AdmissionView admission,
|
||||
List<DependencyView> upstreamDependencies
|
||||
) {
|
||||
}
|
||||
|
||||
/** Correlates every mutating result with a persisted idempotency request. */
|
||||
public record OperationView<T>(
|
||||
String requestId,
|
||||
T result
|
||||
) {
|
||||
}
|
||||
}
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.opsdashboard;
|
||||
|
||||
import cn.aixunkeji.datagov.dataops.api.tasklog.TaskLogApi.Source;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** FR-OPS-0467 through FR-OPS-0470 evidence-only operations dashboard contracts. */
|
||||
public final class OpsDashboardApi {
|
||||
|
||||
private OpsDashboardApi() {
|
||||
}
|
||||
|
||||
public enum Capability { COLLECTION, DEVELOPMENT, QUALITY, METRIC, EXCHANGE, LIFECYCLE }
|
||||
|
||||
public enum DataState { AVAILABLE, UNKNOWN, NOT_ENABLED }
|
||||
|
||||
public enum HealthStatus { HEALTHY, ATTENTION, CRITICAL, UNKNOWN, NOT_ENABLED }
|
||||
|
||||
public enum HealthGrouping { SYSTEM, DATA_DOMAIN, MODULE }
|
||||
|
||||
public enum TrendGranularity { HOUR, DAY }
|
||||
|
||||
public record DashboardQuery(
|
||||
@JsonIgnore
|
||||
String projectRef,
|
||||
String dataDomainCode,
|
||||
LocalDateTime startedFrom,
|
||||
LocalDateTime startedTo
|
||||
) {
|
||||
}
|
||||
|
||||
public record CapabilityMetrics(
|
||||
Long runCount,
|
||||
Long terminalCount,
|
||||
Long succeededCount,
|
||||
Long failedCount,
|
||||
Long backlogCount,
|
||||
Long latencySampleCount,
|
||||
BigDecimal averageLatencyMs,
|
||||
BigDecimal throughputPerHour,
|
||||
BigDecimal successRate,
|
||||
BigDecimal errorRate
|
||||
) {
|
||||
}
|
||||
|
||||
public record CapabilityView(Capability capability, DataState state, CapabilityMetrics metrics) {
|
||||
}
|
||||
|
||||
public record GoldenReferenceView(DataState state, CapabilityMetrics metrics) {
|
||||
}
|
||||
|
||||
public record OverviewView(
|
||||
DashboardQuery query,
|
||||
List<CapabilityView> capabilities,
|
||||
GoldenReferenceView goldenReference,
|
||||
LocalDateTime calculatedAt
|
||||
) {
|
||||
public OverviewView {
|
||||
capabilities = capabilities == null ? List.of() : List.copyOf(capabilities);
|
||||
}
|
||||
}
|
||||
|
||||
public record HealthGroupView(
|
||||
String groupKey,
|
||||
String groupLabel,
|
||||
HealthStatus status,
|
||||
Long runCount,
|
||||
Long failedCount,
|
||||
Long unknownCount,
|
||||
Long backlogCount
|
||||
) {
|
||||
}
|
||||
|
||||
public record HealthMapView(
|
||||
DashboardQuery query,
|
||||
HealthGrouping grouping,
|
||||
DataState state,
|
||||
List<HealthGroupView> rows,
|
||||
long total,
|
||||
LocalDateTime calculatedAt
|
||||
) {
|
||||
public HealthMapView {
|
||||
rows = rows == null ? List.of() : List.copyOf(rows);
|
||||
}
|
||||
}
|
||||
|
||||
public record RecoveryStats(long sampleCount, BigDecimal averageMs) {
|
||||
}
|
||||
|
||||
public record TrendPoint(
|
||||
LocalDateTime bucketStart,
|
||||
LocalDateTime bucketEnd,
|
||||
long runCount,
|
||||
long terminalCount,
|
||||
BigDecimal successRate,
|
||||
BigDecimal errorRate,
|
||||
BigDecimal averageLatencyMs,
|
||||
BigDecimal throughputPerHour,
|
||||
long backlogCount,
|
||||
RecoveryStats recovery
|
||||
) {
|
||||
}
|
||||
|
||||
public record TrendView(
|
||||
DashboardQuery query,
|
||||
DataState state,
|
||||
TrendGranularity granularity,
|
||||
List<TrendPoint> rows,
|
||||
LocalDateTime calculatedAt
|
||||
) {
|
||||
public TrendView {
|
||||
rows = rows == null ? List.of() : List.copyOf(rows);
|
||||
}
|
||||
}
|
||||
|
||||
public record DutyEvent(
|
||||
Source source,
|
||||
Long runId,
|
||||
Long ownerObjectId,
|
||||
String ownerObjectName,
|
||||
@JsonIgnore
|
||||
String projectRef,
|
||||
String dataDomainCode,
|
||||
LocalDateTime occurredAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record DutyIndicator(DataState state, Long count) {
|
||||
}
|
||||
|
||||
public record DutyView(
|
||||
DashboardQuery query,
|
||||
DataState state,
|
||||
List<DutyEvent> events,
|
||||
long total,
|
||||
DutyIndicator unclaimedAlerts,
|
||||
DutyIndicator slaRisks,
|
||||
LocalDateTime calculatedAt
|
||||
) {
|
||||
public DutyView {
|
||||
events = events == null ? List.of() : List.copyOf(events);
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.opsdashboard;
|
||||
|
||||
import cn.aixunkeji.datagov.dataops.api.opsdashboard.OpsDashboardApi.*;
|
||||
import cn.aixunkeji.datagov.dataops.api.tasklog.TaskLogApi.Source;
|
||||
import cn.aixunkeji.datagov.dataops.api.tasklog.TaskLogApi.Status;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** Current Owner facts only. No execution, persisted model draft or operational observations. */
|
||||
public interface OpsDashboardAssistDirectory {
|
||||
String VERSION = "1.0.0";
|
||||
Evidence current(Selection selection);
|
||||
record Query(String projectRef, String dataDomainCode, LocalDateTime startedFrom, LocalDateTime startedTo, Capability capability) { }
|
||||
record Reference(String key, Source source, String runId, String fingerprint) { }
|
||||
record Run(String key, Source source, String runId, String ownerObjectId, Status status,
|
||||
LocalDateTime windowTime, String timeBasis, LocalDateTime startedAt, LocalDateTime completedAt,
|
||||
boolean errorRecorded, List<String> errorMarkers, String fingerprint) {
|
||||
public Run { errorMarkers = errorMarkers == null ? List.of() : List.copyOf(errorMarkers); }
|
||||
}
|
||||
record Snapshot(Query query, String projectFilter, String scopeFingerprint, String fingerprint,
|
||||
Capability capability, DataState state, CapabilityMetrics metrics, Long totalRuns,
|
||||
boolean truncated, List<Run> rows, String scopeNote) {
|
||||
public Snapshot { rows = rows == null ? List.of() : List.copyOf(rows); }
|
||||
}
|
||||
record Selection(Query query, String scopeFingerprint, String fingerprint, List<Reference> rows) {
|
||||
public Selection { rows = rows == null ? List.of() : List.copyOf(rows); }
|
||||
}
|
||||
record Evidence(Selection selection, Long totalRuns, boolean truncated, List<Run> rows, String scopeNote) {
|
||||
public Evidence { rows = rows == null ? List.of() : List.copyOf(rows); }
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.qualityrule;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class QualityRuleJobApi {
|
||||
private QualityRuleJobApi() { }
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record OrchestrateRequest(String name, List<Long> ruleIds,
|
||||
String cronExpression, String timeZone,
|
||||
Integer maxConcurrency, Integer retryCount,
|
||||
String failureStrategy) { }
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StartRequest(Long version, String reason) { }
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StopRequest(Long parentRunId, Long version, String reason) { }
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record RerunRequest(Long parentRunId, String failedNodeKey, Long version, String reason) { }
|
||||
}
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.runoperation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** FR-OPS-0475 through FR-OPS-0478 secret-safe run-operation contracts. */
|
||||
public final class RunOperationApi {
|
||||
|
||||
private RunOperationApi() {
|
||||
}
|
||||
|
||||
public enum Source { SCHEDULING, BATCH_INGESTION, FILE_INGESTION, M2_GOLDEN }
|
||||
|
||||
public enum TaskStatus { PENDING, SUBMITTED, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN }
|
||||
|
||||
public enum Action {
|
||||
STOP,
|
||||
RERUN_ALL,
|
||||
RERUN_FAILED,
|
||||
BACKFILL,
|
||||
RECOVER_CHECKPOINT,
|
||||
SKIP,
|
||||
FORCE_SUCCESS,
|
||||
RESET_PARAMETERS
|
||||
}
|
||||
|
||||
public enum OperationStatus {
|
||||
PENDING, SUBMITTED, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN, UNSUPPORTED
|
||||
}
|
||||
|
||||
public enum Priority { HIGHEST, HIGH, MEDIUM, LOW, LOWEST }
|
||||
|
||||
/** Fixed keys only; callers cannot submit free-form parameter names. */
|
||||
public enum ParameterKey { BUSINESS_DATE, SCHEDULE_DATE, EXECUTION_LABEL }
|
||||
|
||||
public record ActionAvailability(Action action, boolean allowed, String reason) {
|
||||
}
|
||||
|
||||
public record RunTaskSummary(
|
||||
Source source,
|
||||
Long runId,
|
||||
Long ownerObjectId,
|
||||
String ownerObjectName,
|
||||
Long orgId,
|
||||
@JsonIgnore
|
||||
String projectRef,
|
||||
String dataDomainCode,
|
||||
String taskType,
|
||||
TaskStatus status,
|
||||
String sourceStatus,
|
||||
String errorSummary,
|
||||
long taskVersion,
|
||||
LocalDateTime startedAt,
|
||||
LocalDateTime completedAt,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt,
|
||||
List<ActionAvailability> actions
|
||||
) {
|
||||
public RunTaskSummary {
|
||||
actions = actions == null ? List.of() : List.copyOf(actions);
|
||||
}
|
||||
}
|
||||
|
||||
public record PageView<T>(List<T> rows, long total) {
|
||||
public PageView {
|
||||
rows = rows == null ? List.of() : List.copyOf(rows);
|
||||
}
|
||||
}
|
||||
|
||||
public record DetailView(RunTaskSummary task, List<OperationView> history) {
|
||||
public DetailView {
|
||||
history = history == null ? List.of() : List.copyOf(history);
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record AiDiagnosisRequest(String requestId, Long expectedTaskVersion, String question) {
|
||||
public AiDiagnosisRequest(String requestId, Long expectedTaskVersion) { this(requestId, expectedTaskVersion, null); }
|
||||
}
|
||||
|
||||
public record AiDiagnosisView(
|
||||
String requestId,
|
||||
String status,
|
||||
String code,
|
||||
List<String> likelyCauses,
|
||||
List<String> evidenceBasis,
|
||||
List<String> checkSteps,
|
||||
List<String> limitations,
|
||||
String model,
|
||||
String providerVersion
|
||||
) {
|
||||
public AiDiagnosisView {
|
||||
likelyCauses = likelyCauses == null ? List.of() : List.copyOf(likelyCauses);
|
||||
evidenceBasis = evidenceBasis == null ? List.of() : List.copyOf(evidenceBasis);
|
||||
checkSteps = checkSteps == null ? List.of() : List.copyOf(checkSteps);
|
||||
limitations = limitations == null ? List.of() : List.copyOf(limitations);
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record ActionRequest(Long version, String reason, Boolean confirmed) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record RerunRequest(
|
||||
Action mode,
|
||||
String failedNodeKey,
|
||||
String failedNodeEvidenceRef,
|
||||
Long version,
|
||||
String reason,
|
||||
Boolean confirmed
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record BackfillRequest(
|
||||
LocalDate businessDateFrom,
|
||||
LocalDate businessDateTo,
|
||||
Long version,
|
||||
String reason,
|
||||
Boolean confirmed
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record RecoverRequest(
|
||||
String checkpointRef,
|
||||
Long version,
|
||||
String reason,
|
||||
Boolean confirmed
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record ParameterOverride(ParameterKey key, String value) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record ResetParametersRequest(
|
||||
Priority priority,
|
||||
Integer timeoutMinutes,
|
||||
Integer retryCount,
|
||||
String resourceGroupRef,
|
||||
List<ParameterOverride> parameterOverrides,
|
||||
Long version,
|
||||
String reason,
|
||||
Boolean confirmed
|
||||
) {
|
||||
public ResetParametersRequest {
|
||||
parameterOverrides = parameterOverrides == null ? List.of() : List.copyOf(parameterOverrides);
|
||||
}
|
||||
}
|
||||
|
||||
public record OperationView(
|
||||
Long requestId,
|
||||
Source source,
|
||||
Long runId,
|
||||
Long ownerObjectId,
|
||||
Action action,
|
||||
OperationStatus status,
|
||||
long ownerSnapshotVersion,
|
||||
String reasonSummary,
|
||||
String parameterSummary,
|
||||
String externalOperationId,
|
||||
String externalInstanceId,
|
||||
String sourceStatus,
|
||||
String evidenceRef,
|
||||
String evidenceSha256,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime observedAt,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt,
|
||||
long version
|
||||
) {
|
||||
}
|
||||
}
|
||||
+303
@@ -0,0 +1,303 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.scheduling;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** FR-DEV-0366 through FR-DEV-0370 secret-safe scheduling contracts. */
|
||||
public final class SchedulingApi {
|
||||
|
||||
private SchedulingApi() {
|
||||
}
|
||||
|
||||
public enum DefinitionStatus { DRAFT, READY }
|
||||
|
||||
public enum RunStatus { PENDING, SUBMITTED, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN, SKIPPED }
|
||||
|
||||
public enum RunAction { SUBMIT, BACKFILL, RERUN, STOP }
|
||||
|
||||
public enum NodeType { BATCH_JOB, CODE_OBJECT, TRANSFORMATION, QUALITY_RULE, CONDITION, DEPENDENT,
|
||||
METADATA_SCAN, STANDARD_VALIDATE, CLASSIFICATION_IDENTIFY, REMEDIATION_CREATE, ASSET_REGISTER, ASSET_UPDATE, ALERT_NOTIFY, LIFECYCLE_ACTION, MASKING }
|
||||
|
||||
public enum TriggerType { CRON, API, EVENT, DEPENDENT }
|
||||
|
||||
public enum ParameterSource { BUSINESS_DATE, SCHEDULE_DATE, RUN_ID }
|
||||
|
||||
public enum Priority { HIGHEST, HIGH, MEDIUM, LOW, LOWEST }
|
||||
|
||||
public enum FailureStrategy { END, CONTINUE }
|
||||
|
||||
public enum ConditionField { BUSINESS_DATE_WEEKDAY, PARENT_STATUS }
|
||||
|
||||
public enum ComparisonOperator { EQ, IN, NOT_IN }
|
||||
|
||||
public enum BranchOutcome { DEFAULT, TRUE, FALSE }
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record ConditionDefinition(
|
||||
ConditionField field,
|
||||
ComparisonOperator operator,
|
||||
List<String> values
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record DependencyDefinition(
|
||||
Long scheduleId,
|
||||
Integer businessDateOffsetDays
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record NodeDefinition(
|
||||
String nodeKey,
|
||||
String name,
|
||||
NodeType type,
|
||||
Long referenceId,
|
||||
ConditionDefinition condition,
|
||||
DependencyDefinition dependency,
|
||||
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY)
|
||||
java.util.Map<String, String> executionOptions
|
||||
) {
|
||||
public NodeDefinition(String nodeKey, String name, NodeType type, Long referenceId,
|
||||
ConditionDefinition condition, DependencyDefinition dependency) {
|
||||
this(nodeKey, name, type, referenceId, condition, dependency, null);
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record EdgeDefinition(
|
||||
String edgeKey,
|
||||
String sourceNodeKey,
|
||||
String targetNodeKey,
|
||||
BranchOutcome branchOutcome
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record TriggerDefinition(
|
||||
TriggerType type,
|
||||
String cronExpression,
|
||||
String timeZone,
|
||||
String structuredKey,
|
||||
String eventSource,
|
||||
DependencyDefinition dependency
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record ParameterDefinition(
|
||||
String name,
|
||||
ParameterSource source,
|
||||
String format,
|
||||
boolean required
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record CalendarDefinition(
|
||||
String timeZone,
|
||||
List<LocalDate> includedDates,
|
||||
List<LocalDate> excludedDates
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StrategyDefinition(
|
||||
Integer maxConcurrency,
|
||||
Priority priority,
|
||||
Integer timeoutMinutes,
|
||||
Integer retryCount,
|
||||
Integer retryIntervalSeconds,
|
||||
FailureStrategy failureStrategy
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record DefinitionCreateRequest(
|
||||
String name,
|
||||
String description,
|
||||
List<NodeDefinition> nodes,
|
||||
List<EdgeDefinition> edges,
|
||||
List<TriggerDefinition> triggers,
|
||||
List<ParameterDefinition> parameters,
|
||||
CalendarDefinition calendar,
|
||||
StrategyDefinition strategy
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record DefinitionUpdateRequest(
|
||||
String name,
|
||||
String description,
|
||||
List<NodeDefinition> nodes,
|
||||
List<EdgeDefinition> edges,
|
||||
List<TriggerDefinition> triggers,
|
||||
List<ParameterDefinition> parameters,
|
||||
CalendarDefinition calendar,
|
||||
StrategyDefinition strategy,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record VersionRequest(Long version, String expectedLayoutVersion) {
|
||||
public VersionRequest(Long version) { this(version, null); }
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record ParameterCalendarUpdateRequest(
|
||||
List<ParameterDefinition> parameters,
|
||||
CalendarDefinition calendar,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StrategyUpdateRequest(StrategyDefinition strategy, Long version) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record SubmitRequest(Long version, String reason) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record BackfillRequest(
|
||||
LocalDate businessDateFrom,
|
||||
LocalDate businessDateTo,
|
||||
String reason,
|
||||
String impactSummary,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record RerunRequest(
|
||||
Long parentRunId,
|
||||
String failedNodeKey,
|
||||
String reason,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StopRequest(Long parentRunId, String reason, Long version) {
|
||||
}
|
||||
|
||||
public record DefinitionSummaryView(
|
||||
Long scheduleId,
|
||||
String name,
|
||||
Long orgId,
|
||||
DefinitionStatus status,
|
||||
Long version,
|
||||
Long currentSnapshotId,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record DefinitionDetailView(
|
||||
DefinitionSummaryView summary,
|
||||
String description,
|
||||
List<NodeDefinition> nodes,
|
||||
List<EdgeDefinition> edges,
|
||||
List<TriggerDefinition> triggers,
|
||||
List<ParameterDefinition> parameters,
|
||||
CalendarDefinition calendar,
|
||||
StrategyDefinition strategy,
|
||||
String definitionSha256
|
||||
) {
|
||||
}
|
||||
|
||||
public record ValidationIssue(
|
||||
String code,
|
||||
String location,
|
||||
String message,
|
||||
String severity,
|
||||
String phase,
|
||||
String nodeKey,
|
||||
String edgeKey
|
||||
) {
|
||||
public ValidationIssue(String code, String location, String message) {
|
||||
this(code, location, message, "ERROR", "DEFINITION", null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public record NodeCapability(NodeType type, boolean executable, String message) {}
|
||||
|
||||
public record CapabilitiesView(String capabilityVersion, LocalDateTime observedAt,
|
||||
boolean adapterConfigured, List<NodeCapability> nodes,
|
||||
int maxNodes, int maxEdges, List<String> notices) {}
|
||||
|
||||
public record DefinitionReceipt(boolean found, DefinitionDetailView definition) {}
|
||||
|
||||
public record ValidationView(boolean valid, List<ValidationIssue> issues, String definitionSha256) {
|
||||
}
|
||||
|
||||
public record SnapshotView(
|
||||
Long snapshotId,
|
||||
Long scheduleId,
|
||||
Long definitionVersion,
|
||||
String snapshotSha256,
|
||||
LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record ExternalInstanceView(
|
||||
String externalInstanceId,
|
||||
LocalDate businessDate,
|
||||
String sourceStatus,
|
||||
RunStatus status,
|
||||
String evidenceRef,
|
||||
LocalDateTime observedAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record NodeEvidenceView(
|
||||
String nodeKey,
|
||||
NodeType nodeType,
|
||||
Long referenceId,
|
||||
String externalTaskCode,
|
||||
String externalTaskInstanceId,
|
||||
LocalDate businessDate,
|
||||
String sourceStatus,
|
||||
RunStatus status,
|
||||
String evidenceRef,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime observedAt,
|
||||
String evidenceKind,
|
||||
String externalInstanceId,
|
||||
String ownerVersion,
|
||||
String ownerSha256
|
||||
) {
|
||||
}
|
||||
|
||||
public record RunView(
|
||||
Long runId,
|
||||
Long scheduleId,
|
||||
Long snapshotId,
|
||||
Long parentRunId,
|
||||
RunAction action,
|
||||
RunStatus status,
|
||||
LocalDate businessDateFrom,
|
||||
LocalDate businessDateTo,
|
||||
String failedNodeKey,
|
||||
String externalProjectCode,
|
||||
String externalDefinitionCode,
|
||||
String externalInstanceId,
|
||||
String sourceStatus,
|
||||
String errorSummary,
|
||||
List<ExternalInstanceView> externalInstances,
|
||||
List<NodeEvidenceView> nodeEvidence,
|
||||
LocalDateTime lastSyncAt,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
|
||||
public record PageView<T>(List<T> rows, long total) {
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/** FR-STORE-0323 public request. Password is write-only; blank on update preserves it. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StorageAccessProfileRequest(
|
||||
String networkZone,
|
||||
String endpointHost,
|
||||
Integer endpointPort,
|
||||
String username,
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) char[] password,
|
||||
Boolean tlsEnabled,
|
||||
List<String> allowedCidrs,
|
||||
Long version
|
||||
) implements AutoCloseable {
|
||||
|
||||
public StorageAccessProfileRequest {
|
||||
password = password == null ? null : password.clone();
|
||||
allowedCidrs = allowedCidrs == null ? null : List.copyOf(allowedCidrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public char[] password() {
|
||||
return password == null ? null : password.clone();
|
||||
}
|
||||
|
||||
public boolean passwordProvided() {
|
||||
return password != null && password.length > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (password != null) {
|
||||
Arrays.fill(password, '\0');
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StorageAccessProfileRequest[networkZone=" + networkZone + ", endpointHost=" + endpointHost
|
||||
+ ", endpointPort=" + endpointPort + ", username=" + username + ", password=REDACTED"
|
||||
+ ", tlsEnabled=" + tlsEnabled + ", version=" + version + "]";
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** FR-STORE-0323 read model. Endpoint metadata is separate from secret material. */
|
||||
public record StorageAccessProfileView(
|
||||
Long profileId,
|
||||
Long resourceId,
|
||||
String networkZone,
|
||||
String endpointHost,
|
||||
int endpointPort,
|
||||
String username,
|
||||
boolean credentialConfigured,
|
||||
boolean tlsEnabled,
|
||||
List<String> allowedCidrs,
|
||||
long version,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** Public, secret-free projection of one immutable D-026 dimension observation. */
|
||||
public record StorageCapacityDimensionView(
|
||||
StorageTelemetryDimensionType dimension,
|
||||
StorageTelemetryMetricState metricStatus,
|
||||
String sourceType,
|
||||
String sourceIdentity,
|
||||
LocalDateTime observedAt,
|
||||
StorageTelemetryFreshness freshnessStatus,
|
||||
String safeErrorCode,
|
||||
String safeErrorSummary,
|
||||
Long totalBytes,
|
||||
Long usedBytes,
|
||||
Long availableBytes,
|
||||
Long valueBytes,
|
||||
BigDecimal valuePercent,
|
||||
String comparisonFingerprint,
|
||||
String algorithmVersion
|
||||
) {
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/** Immutable FR-STORE-0324 capacity observation or truthful failed/unknown probe. */
|
||||
public record StorageCapacitySnapshotView(
|
||||
Long snapshotId,
|
||||
Long resourceId,
|
||||
StorageTelemetryState status,
|
||||
String sourceStatus,
|
||||
String externalObservationId,
|
||||
Long totalBytes,
|
||||
Long usedBytes,
|
||||
Long availableBytes,
|
||||
BigDecimal usagePercent,
|
||||
Long growthBytes,
|
||||
Long hotBytes,
|
||||
Long fragmentedBytes,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
int retryCount,
|
||||
LocalDateTime observedAt,
|
||||
String requestId,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime observationWindowStart,
|
||||
Long previousSnapshotId,
|
||||
String contractVersion,
|
||||
List<StorageCapacityDimensionView> dimensions
|
||||
) {
|
||||
public StorageCapacitySnapshotView {
|
||||
dimensions = dimensions == null ? List.of() : List.copyOf(dimensions);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** D-028: registration and time-bound directory observation are separate facts. */
|
||||
public record StorageDirectoryObservation(String requestId, long resourceId, long spaceId,
|
||||
String status, String observedStatus, boolean stale, String externalDirectoryId,
|
||||
String errorCode, String errorSummary, LocalDateTime observedAt, LocalDateTime requestedAt) { }
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.Arrays;
|
||||
|
||||
/** Public write-only input for the independent SQL_RESULT_MATERIALIZE credential. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StorageMaterializationCredentialRequest(
|
||||
String username,
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) char[] password,
|
||||
Long version
|
||||
) implements AutoCloseable {
|
||||
public StorageMaterializationCredentialRequest { password = password == null ? null : password.clone(); }
|
||||
@Override public char[] password() { return password == null ? null : password.clone(); }
|
||||
@JsonAnySetter public void rejectUnknown(String field, Object value) {
|
||||
close();
|
||||
throw new IllegalArgumentException("落表写入配置包含不支持的字段");
|
||||
}
|
||||
@Override public void close() { if (password != null) Arrays.fill(password, '\0'); }
|
||||
@Override public String toString() { return "StorageMaterializationCredentialRequest[password=REDACTED]"; }
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** Secret-free public status for SQL result materialization credentials. */
|
||||
public record StorageMaterializationCredentialView(
|
||||
long resourceId,
|
||||
String username,
|
||||
boolean credentialConfigured,
|
||||
boolean reconfigurationRequired,
|
||||
Long version,
|
||||
LocalDateTime updatedAt
|
||||
) { }
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
/** Correlates every mutating response with the persisted idempotency request record. */
|
||||
public record StorageOperationView<T>(
|
||||
String requestId,
|
||||
T result
|
||||
) {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
/** Server-owned physical-creation and quota capability matrix for one resource. */
|
||||
public record StoragePhysicalCapabilityView(
|
||||
Long resourceId,
|
||||
StorageResourceType resourceType,
|
||||
boolean physicalCreateSupported,
|
||||
String physicalCreateStatus,
|
||||
String quotaExecutionStatus,
|
||||
String reason,
|
||||
long resourceVersion,
|
||||
Long accessVersion
|
||||
) {
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** Persisted request-first result. UNKNOWN is read-only and never causes an automatic CREATE replay. */
|
||||
public record StoragePhysicalOperationView(
|
||||
String requestId,
|
||||
String operationStatus,
|
||||
Long resourceId,
|
||||
Long orgId,
|
||||
String externalObjectId,
|
||||
Long resultSpaceId,
|
||||
Long quotaBytes,
|
||||
String quotaExecutionStatus,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime requestedAt,
|
||||
LocalDateTime observedAt,
|
||||
long version
|
||||
) {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/** Secret-free, non-mutating physical database preflight request. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StoragePhysicalPreflightRequest(
|
||||
String externalObjectId,
|
||||
Long resourceVersion,
|
||||
Long accessVersion
|
||||
) {
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** Non-mutating capability, scope, version, conflict and connectivity result. */
|
||||
public record StoragePhysicalPreflightView(
|
||||
Long resourceId,
|
||||
String externalObjectId,
|
||||
String status,
|
||||
String quotaExecutionStatus,
|
||||
String errorCode,
|
||||
String errorSummary,
|
||||
LocalDateTime observedAt
|
||||
) {
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/** Explicit CREATE_PHYSICAL request; endpoints, accounts and secret references are server owned. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StoragePhysicalSpaceCreateRequest(
|
||||
String name,
|
||||
String externalObjectId,
|
||||
/** Optional platform registration fact; null means UNKNOWN and must never be replaced with zero. */
|
||||
Long quotaBytes,
|
||||
Boolean enabled,
|
||||
Long resourceVersion,
|
||||
Long accessVersion
|
||||
) {
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.Arrays;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StorageQueryCredentialRequest(
|
||||
String username,
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) char[] password,
|
||||
Long version
|
||||
) implements AutoCloseable {
|
||||
public StorageQueryCredentialRequest { password = password == null ? null : password.clone(); }
|
||||
@Override public char[] password() { return password == null ? null : password.clone(); }
|
||||
@com.fasterxml.jackson.annotation.JsonAnySetter
|
||||
public void rejectUnknown(String field, Object value) { close(); throw new IllegalArgumentException("查询配置包含不支持的字段"); }
|
||||
@Override public void close() { if (password != null) Arrays.fill(password, '\0'); }
|
||||
@Override public String toString() { return "StorageQueryCredentialRequest[password=REDACTED]"; }
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public record StorageQueryCredentialView(
|
||||
long resourceId, String username, boolean credentialConfigured, boolean reconfigurationRequired,
|
||||
Long version, LocalDateTime updatedAt
|
||||
) { }
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/** FR-STORE-0321 public create command with a write-only managed connection profile. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StorageResourceCreateRequest(
|
||||
String name,
|
||||
StorageResourceType resourceType,
|
||||
String catalogName,
|
||||
Boolean enabled,
|
||||
StorageAccessProfileRequest connection
|
||||
) implements AutoCloseable {
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (connection != null) {
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StorageResourceCreateRequest[name=" + name + ", resourceType=" + resourceType
|
||||
+ ", catalogName=" + catalogName + ", enabled=" + enabled + ", connection=" + connection + "]";
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Same-page detail tabs required by FR-STORE-0322 through FR-STORE-0324. */
|
||||
public record StorageResourceDetailView(
|
||||
StorageResourceView resource,
|
||||
List<StorageSpaceView> spaces,
|
||||
StorageAccessProfileView accessProfile,
|
||||
List<StorageCapacitySnapshotView> capacitySnapshots
|
||||
) {
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
/** FR-STORE-0321 resource types admitted by the V1 storage boundary. */
|
||||
public enum StorageResourceType {
|
||||
HIVE,
|
||||
DORIS
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/** FR-STORE-0321 optimistic-lock update command. */
|
||||
@JsonIgnoreProperties(ignoreUnknown = false)
|
||||
public record StorageResourceUpdateRequest(
|
||||
String name,
|
||||
String externalInstanceId,
|
||||
String catalogName,
|
||||
Boolean enabled,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** Secret-material-free FR-STORE-0321 read model. */
|
||||
public record StorageResourceView(
|
||||
Long resourceId,
|
||||
String name,
|
||||
StorageResourceType resourceType,
|
||||
String externalInstanceId,
|
||||
String catalogName,
|
||||
boolean enabled,
|
||||
StorageTelemetryState telemetryStatus,
|
||||
String telemetryErrorCode,
|
||||
String telemetryErrorSummary,
|
||||
LocalDateTime lastObservedAt,
|
||||
Long scopeDeptId,
|
||||
long version,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
/** FR-STORE-0322 create command for a logical storage space mapping. */
|
||||
public record StorageSpaceCreateRequest(
|
||||
String name,
|
||||
StorageSpaceKind spaceKind,
|
||||
String externalObjectId,
|
||||
String locationUri,
|
||||
Long quotaBytes,
|
||||
Boolean enabled
|
||||
) {
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
/** FR-STORE-0322 logical spaces mapped to external objects without copying their truth. */
|
||||
public enum StorageSpaceKind {
|
||||
HIVE_DATABASE,
|
||||
HIVE_SCHEMA,
|
||||
OBJECT_BUCKET,
|
||||
DORIS_DATABASE,
|
||||
DORIS_RESOURCE_GROUP
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
/** FR-STORE-0322 optimistic-lock update command. */
|
||||
public record StorageSpaceUpdateRequest(
|
||||
String name,
|
||||
String externalObjectId,
|
||||
String locationUri,
|
||||
Long quotaBytes,
|
||||
Boolean enabled,
|
||||
Long version
|
||||
) {
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package cn.aixunkeji.datagov.dataops.api.storage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** FR-STORE-0322 logical mapping; Hive/Doris remains the external truth. */
|
||||
public record StorageSpaceView(
|
||||
Long spaceId,
|
||||
Long resourceId,
|
||||
String name,
|
||||
StorageSpaceKind spaceKind,
|
||||
String externalObjectId,
|
||||
String locationUri,
|
||||
Long quotaBytes,
|
||||
boolean enabled,
|
||||
long version,
|
||||
LocalDateTime updatedAt,
|
||||
String registrationOrigin
|
||||
) {
|
||||
public StorageSpaceView(Long spaceId, Long resourceId, String name, StorageSpaceKind spaceKind,
|
||||
String externalObjectId, String locationUri, Long quotaBytes, boolean enabled, long version, LocalDateTime updatedAt) {
|
||||
this(spaceId, resourceId, name, spaceKind, externalObjectId, locationUri, quotaBytes, enabled, version, updatedAt, "LEGACY");
|
||||
}
|
||||
}
|
||||
某些文件未显示,因为此 diff 中更改的文件太多 显示更多
在新工单中引用
屏蔽一个用户