1
0

[HUDI-3037] Add back remote view storage config for flink (#4338)

This commit is contained in:
Danny Chan
2021-12-17 13:57:53 +08:00
committed by GitHub
parent 7e7ad1558c
commit d0087d4040
10 changed files with 214 additions and 13 deletions

View File

@@ -239,6 +239,7 @@ public class PriorityBasedFileSystemView implements SyncableFileSystemView, Seri
public void reset() {
preferredView.reset();
secondaryView.reset();
errorOnPreferredView = false;
}
@Override
@@ -255,6 +256,7 @@ public class PriorityBasedFileSystemView implements SyncableFileSystemView, Seri
public void sync() {
preferredView.sync();
secondaryView.sync();
errorOnPreferredView = false;
}
@Override

View File

@@ -21,7 +21,8 @@ package org.apache.hudi.common.util;
import org.apache.hudi.exception.HoodieException;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.InetSocketAddress;
import java.net.Socket;
/**
* A utility class for network.
@@ -29,10 +30,13 @@ import java.net.ServerSocket;
public class NetworkUtils {
public static synchronized String getHostname() {
ServerSocket s = null;
Socket s = null;
try {
s = new ServerSocket(0);
return s.getInetAddress().getHostAddress();
s = new Socket();
// see https://stackoverflow.com/questions/9481865/getting-the-ip-address-of-the-current-machine-using-java
// for details.
s.connect(new InetSocketAddress("google.com", 80));
return s.getLocalAddress().getHostAddress();
} catch (IOException e) {
throw new HoodieException("Unable to find server port", e);
} finally {