This is an automated email from the ASF dual-hosted git repository.
amoghj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/main by this push:
new e9364faabc API: Add SupportsRecoveryOperations mixin for FileIO
(#10711)
e9364faabc is described below
commit e9364faabcc67eef6c61af2ecdf7bcf9a3fef602
Author: Amogh Jahagirdar <[email protected]>
AuthorDate: Mon Aug 5 14:36:20 2024 -0700
API: Add SupportsRecoveryOperations mixin for FileIO (#10711)
---
.../iceberg/io/SupportsRecoveryOperations.java | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git
a/api/src/main/java/org/apache/iceberg/io/SupportsRecoveryOperations.java
b/api/src/main/java/org/apache/iceberg/io/SupportsRecoveryOperations.java
new file mode 100644
index 0000000000..c402d2e68e
--- /dev/null
+++ b/api/src/main/java/org/apache/iceberg/io/SupportsRecoveryOperations.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg.io;
+
+/**
+ * This interface is intended as an extension for FileIO implementations to
provide additional
+ * best-effort recovery operations that can be useful for repairing corrupted
tables where there are
+ * reachable files missing from disk. (e.g. a live manifest points to data
file entry which no
+ * longer exists on disk)
+ */
+public interface SupportsRecoveryOperations {
+
+ /**
+ * Perform a best-effort recovery of a file at a given path
+ *
+ * @param path Absolute path of file to attempt recovery for
+ * @return true if recovery was successful, false otherwise
+ */
+ boolean recoverFile(String path);
+}