public class FailSafeConsistencyGuard extends Object implements ConsistencyGuard
ConsistencyGuard.FileVisibility| Modifier and Type | Field and Description |
|---|---|
protected ConsistencyGuardConfig |
consistencyGuardConfig |
protected HoodieStorage |
storage |
| Constructor and Description |
|---|
FailSafeConsistencyGuard(HoodieStorage storage,
ConsistencyGuardConfig consistencyGuardConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkFilesVisibility(int retryNum,
StoragePath dir,
List<String> files,
ConsistencyGuard.FileVisibility event)
Helper to check for file visibility based on
ConsistencyGuard.FileVisibility event. |
protected boolean |
checkFileVisibility(StoragePath filePath,
ConsistencyGuard.FileVisibility visibility)
Helper to check of file visibility.
|
protected List<String> |
getFilesWithoutSchemeAndAuthority(List<String> files)
Generate file names without scheme and authority.
|
void |
waitForFilesVisibility(String dirPath,
List<String> files,
ConsistencyGuard.FileVisibility event)
Helper function to wait for all files belonging to single directory to appear.
|
void |
waitTillAllFilesAppear(String dirPath,
List<String> files) |
void |
waitTillAllFilesDisappear(String dirPath,
List<String> files) |
void |
waitTillFileAppears(StoragePath filePath) |
void |
waitTillFileDisappears(StoragePath filePath) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwaitTillprotected final HoodieStorage storage
protected final ConsistencyGuardConfig consistencyGuardConfig
public FailSafeConsistencyGuard(HoodieStorage storage, ConsistencyGuardConfig consistencyGuardConfig)
public void waitTillFileAppears(StoragePath filePath) throws TimeoutException
waitTillFileAppears in interface ConsistencyGuardTimeoutExceptionpublic void waitTillFileDisappears(StoragePath filePath) throws TimeoutException
waitTillFileDisappears in interface ConsistencyGuardTimeoutExceptionpublic void waitTillAllFilesAppear(String dirPath, List<String> files) throws TimeoutException
waitTillAllFilesAppear in interface ConsistencyGuardTimeoutExceptionpublic void waitTillAllFilesDisappear(String dirPath, List<String> files) throws TimeoutException
waitTillAllFilesDisappear in interface ConsistencyGuardTimeoutExceptionpublic void waitForFilesVisibility(String dirPath, List<String> files, ConsistencyGuard.FileVisibility event) throws TimeoutException
dirPath - Dir Pathfiles - Files to appear/disappearevent - Appear/DisappearTimeoutExceptionprotected boolean checkFileVisibility(StoragePath filePath, ConsistencyGuard.FileVisibility visibility) throws IOException
filePath - File Pathvisibility - VisibilityIOException - -protected boolean checkFilesVisibility(int retryNum,
StoragePath dir,
List<String> files,
ConsistencyGuard.FileVisibility event)
ConsistencyGuard.FileVisibility event.retryNum - retry attempt count.dir - directory of interest in which list of files are checked for visibilityfiles - List of files to check for visibilityevent - ConsistencyGuard.FileVisibility event of interest.true if condition succeeded. else false.Copyright © 2024 The Apache Software Foundation. All rights reserved.