[#39] Fix loading large objects in chunks
All checks were successful
DCO / DCO (pull_request) Successful in 29s
Verify code phase / Verify code (pull_request) Successful in 1m26s

Signed-off-by: Ori Bruk <o.bruk@yadro.com>
This commit is contained in:
Ori Bruk 2025-02-11 17:14:30 +03:00
parent 33f7198ace
commit 532db56f1b
5 changed files with 42 additions and 4 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@ target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
**/.flattened-pom.xml
### IntelliJ IDEA ###
.idea/modules.xml

8
CHANGELOG.md Normal file
View file

@ -0,0 +1,8 @@
# Changelog
## [0.5.0] - 2025-02-11
### Fixed
- Loading large objects in chunks.
- .gitignore
- pom revision

View file

@ -166,8 +166,10 @@ public class ObjectClientImpl extends ContextAccessor implements ObjectClient {
// send the last part and create linkObject
if (CollectionUtils.isNotEmpty(sentObjectIds)) {
var largeObjectHeader =
new ObjectHeader(header.getContainerId(), ObjectType.REGULAR, attributes, fullLength, null);
var largeObjectHeader = new ObjectHeader(
header.getContainerId(), ObjectType.REGULAR, attributes, fullLength, header.getVersion()
);
largeObjectHeader.setOwnerId(header.getOwnerId());
split.setParentHeader(largeObjectHeader);

View file

@ -105,7 +105,10 @@ public class ObjectToolsImpl extends ContextAccessor implements ToolsClient {
split.setParent(ObjectIdMapper.toModel(parentObjectId));
}
grpcSplit.setPrevious(ObjectIdMapper.toGrpcMessage(split.getPrevious())).build();
if (nonNull(split.getPrevious())) {
grpcSplit.setPrevious(ObjectIdMapper.toGrpcMessage(split.getPrevious())).build();
}
return grpcHeader.toBuilder().setSplit(grpcSplit.build()).build();
}

26
pom.xml
View file

@ -17,7 +17,7 @@
</modules>
<properties>
<revision>0.4.0</revision>
<revision>0.5.0</revision>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
@ -128,6 +128,30 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<updatePomFile>true</updatePomFile>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>