Skip to content

Commit ba7329d

Browse files
committed
Fix checkstyle and catch UnsupportedOperationException
1 parent 1f2c1af commit ba7329d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

core/src/main/java/org/apache/iceberg/ManifestFiles.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,20 @@ private static ManifestFile copyManifestInternal(
341341
}
342342

343343
private static InputFile newInputFile(FileIO io, String path, long length) {
344-
boolean enabled = cachingEnabled(io);
344+
boolean enabled = false;
345+
346+
try {
347+
enabled = cachingEnabled(io);
348+
} catch (UnsupportedOperationException e) {
349+
// There is an issue reading io.properties(). Disable caching.
350+
enabled = false;
351+
}
345352

346353
if (enabled) {
347354
ContentCache cache = contentCache(io);
348-
Preconditions.checkNotNull(cache);
355+
Preconditions.checkNotNull(
356+
cache,
357+
"ContentCache creation failed. Check that all manifest caching configurations has valid value.");
349358
LOG.debug("FileIO-level cache stats: {}", CONTENT_CACHES.stats());
350359
return cache.tryCache(io, path, length);
351360
}

0 commit comments

Comments
 (0)