Skip to content

Commit

Permalink
ImlCopy: metadata -> step (#1415)
Browse files Browse the repository at this point in the history
* ImlCopy: metadata -> step

Signed-off-by: qGYdXbY2 <[email protected]>

* TargetType Space

Signed-off-by: qGYdXbY2 <[email protected]>

---------

Signed-off-by: qGYdXbY2 <[email protected]>
  • Loading branch information
qGYdXbY2 authored Dec 11, 2024
1 parent eda8220 commit 8bd1cbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static CompilationStepGraph compileSteps(String sourceId, String targetId

CopySpacePost postCopySpace = new CopySpacePost().withSpaceId(targetSpaceId)
.withJobId(jobId)
.withTargetType(targetType);
.withOutputMetadata(Map.of(targetType, targetSpaceId));

startGraph.addExecution(postCopySpace);

Expand All @@ -141,7 +141,7 @@ public CompilationStepGraph compile(Job job) {
job.getId(),
((DatasetDescription.Space<?>) job.getSource()).getFilters(),
((DatasetDescription.Space<?>) job.getSource()).getVersionRef(),
job.getTarget().getClass().getSimpleName() );
"Space" );

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ public class CopySpacePost extends SpaceBasedStep<CopySpacePost> {
@JsonView({Internal.class, Static.class})
private long copiedByteSize = 0;

@JsonView({Internal.class, Static.class})
private String targetType = "Space";

public long getCopiedByteSize() {
return copiedByteSize;
}
Expand All @@ -99,20 +96,6 @@ public long getFetchedVersion() {
return fetchedVersion;
}

public String getTargetType() {
return targetType;
}

public void setTargetType(String targetType) {
this.targetType = targetType;
}

public CopySpacePost withTargetType(String targetType) {
setTargetType( targetType );
return this;
}


@Override
public List<Load> getNeededResources() {
try {
Expand Down Expand Up @@ -203,7 +186,6 @@ public void execute() throws Exception {
infoLog(STEP_EXECUTE, this,String.format("Get stats for version %d - %s", fetchedVersion, getSpaceId() ));

FeatureStatistics statistics = getCopiedFeatures(fetchedVersion);
statistics.withMetadata( getTargetType(), getSpaceId() ); // key = [Layer(iml)|Space(xyz)]

infoLog(STEP_EXECUTE, this,"Job Statistics: bytes=" + statistics.getByteSize() + " rows=" + statistics.getFeatureCount());
registerOutputs(List.of(statistics), true);
Expand Down

0 comments on commit 8bd1cbf

Please sign in to comment.