Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,9 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
public static final boolean DFS_PROTECTED_SUBDIRECTORIES_ENABLE_DEFAULT =
false;

public static final String DFS_FSCK_HTTP_TIMEOUT_KEY = "dfs.fsck.http.timeout.ms";
public static final String DFS_FSCK_HTTP_TIMEOUT_KEY_DEFAULT = 60000;

// dfs.client.retry confs are moved to HdfsClientConfigKeys.Retry
@Deprecated
public static final String DFS_CLIENT_RETRY_POLICY_ENABLED_KEY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,22 @@ public DFSck(Configuration conf, PrintStream out) throws IOException {
super(conf);
this.ugi = UserGroupInformation.getCurrentUser();
this.out = out;
int httpTimeOut = getHttpTimeOut(conf);
this.connectionFactory = URLConnectionFactory
.newDefaultURLConnectionFactory(conf);
.newDefaultURLConnectionFactory(httpTimeOut, httpTimeOut, conf);
this.isSpnegoEnabled = UserGroupInformation.isSecurityEnabled();
}

/**
* try to get httpTimeOut parameter from conf
*/
private int getHttpTimeOut(Configuration conf) {
int httpTimeOut = conf.getInt(
DFSConfigKeys.DFS_FSCK_HTTP_TIMEOUT_KEY,
DFSConfigKeys.DFS_FSCK_HTTP_TIMEOUT_KEY_DEFAULT);
return httpTimeOut <= 0 ? DFSConfigKeys.DFS_FSCK_HTTP_TIMEOUT_KEY_DEFAULT : httpTimeOut;
}

/**
* Print fsck usage information
*/
Expand Down