Skip to content

Commit

Permalink
Use ByteStreams::NullOS and check catalog tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cdouglas committed Dec 16, 2024
1 parent 0399001 commit 8536297
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.azure.storage.file.datalake.options.FileParallelUploadOptions;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UncheckedIOException;
import java.util.function.Supplier;
import org.apache.iceberg.azure.AzureProperties;
Expand Down Expand Up @@ -98,19 +97,7 @@ public CAS prepare(Supplier<InputStream> source) {
final byte[] buffer = new byte[8192];
try (InputStream in = source.get();
FileChecksumOutputStream chk =
new FileChecksumOutputStream(
new OutputStream() {
@Override
public void write(int b) {
// TODO: no NullOutputStream?
}

@Override
public void write(byte[] b, int off, int len) {
// do nothing
}
},
checksum)) {
new FileChecksumOutputStream(ByteStreams.nullOutputStream(), checksum)) {
ByteStreams.copy(in, chk);
} catch (IOException e) {
throw new UncheckedIOException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static void initStorage() {
uniqTestRun = UUID.randomUUID().toString();
LOG.info("TEST RUN: {}", uniqTestRun);
AzureSAS creds =
AzureSAS.readCreds(new File("/IdeaProjects/.cloud/azure/lstnsgym-20250228.json"));
AzureSAS.readCreds(new File("/home/chris/work/.cloud/azure/lstnsgym-20250228.json"));
if (creds != null) {
azureProperties = Maps.newHashMap();
azureProperties.put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static void initStorage() throws IOException {
uniqTestRun = UUID.randomUUID().toString();
LOG.info("TEST RUN: {}", uniqTestRun);
AzureSAS creds =
AzureSAS.readCreds(new File("/IdeaProjects/.cloud/azure/lstnsgym-20250228.json"));
AzureSAS.readCreds(new File("/home/chris/work/.cloud/azure/lstnsgym-20250228.json"));
if (creds != null) {
azureProperties = Maps.newHashMap();
azureProperties.put(
Expand Down
15 changes: 1 addition & 14 deletions gcp/src/main/java/org/apache/iceberg/gcp/gcs/GCSOutputFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.cloud.storage.Storage;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UncheckedIOException;
import java.util.function.Supplier;
import org.apache.iceberg.exceptions.AlreadyExistsException;
Expand Down Expand Up @@ -89,19 +88,7 @@ public CAS prepare(Supplier<InputStream> source) {
final byte[] buffer = new byte[8192];
try (InputStream in = source.get();
FileChecksumOutputStream chk =
new FileChecksumOutputStream(
new OutputStream() {
@Override
public void write(int b) {
// TODO: no NullOutputStream?
}

@Override
public void write(byte[] b, int off, int len) {
// do nothing
}
},
checksum)) {
new FileChecksumOutputStream(ByteStreams.nullOutputStream(), checksum)) {
ByteStreams.copy(in, chk);
} catch (IOException e) {
throw new UncheckedIOException(e);
Expand Down

0 comments on commit 8536297

Please sign in to comment.