[HUDI-3037] Add back remote view storage config for flink (#4338)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user