Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter committed Oct 24, 2024
1 parent 96ac6db commit 5ad9ddf
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;

Expand Down Expand Up @@ -2436,9 +2437,12 @@ public void write(DataOutput out) throws IOException {

ByteArrayOutputStream bytesStream = new ByteArrayOutputStream();
try (ZipOutputStream zipStream = new ZipOutputStream(bytesStream)) {
ZipEntry entry = new ZipEntry("restore_job");
zipStream.putNextEntry(entry);
try (DataOutputStream stream = new DataOutputStream(zipStream)) {
writeOthers(stream);
}
zipStream.closeEntry();
}
Text text = new Text(bytesStream.toByteArray());
if (text.getLength() > (100 << 20)) {
Expand Down Expand Up @@ -2534,9 +2538,11 @@ public void readFields(DataInput in) throws IOException {

ByteArrayInputStream bytesStream = new ByteArrayInputStream(text.getBytes());
try (ZipInputStream zipStream = new ZipInputStream(bytesStream)) {
zipStream.getNextEntry();
try (DataInputStream stream = new DataInputStream(zipStream)) {
readOthers(stream);
}
zipStream.closeEntry();
}
} else {
readOthers(in);
Expand Down

0 comments on commit 5ad9ddf

Please sign in to comment.