Skip to content

Commit

Permalink
fix chekstyle.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiezhineng committed Dec 6, 2023
1 parent db52c34 commit bb46dbd
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ public void setup() throws IOException {

conf.setLong(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, blockSize);
conf.setInt(DFSConfigKeys.DFS_NAMENODE_REPLICATION_MAX_STREAMS_KEY, 0);

conf.setInt(DFSConfigKeys.DFS_DATANODE_SOCKET_WRITE_TIMEOUT_KEY, 1000);
// SET CONFIG FOR HDFS CLIENT
conf.setInt(HdfsClientConfigKeys.DFS_CLIENT_SOCKET_TIMEOUT_KEY, 1000);

if (ErasureCodeNative.isNativeCodeLoaded()) {
conf.set(
Expand Down Expand Up @@ -160,20 +157,23 @@ public void testPreadTimeout() throws Exception {
}

private void testReadFileWithAttempt(int attempt) throws Exception {
// set dfs client config
cluster.getConfiguration(0)
.setInt(HdfsClientConfigKeys.StripedRead.DATANODE_MAX_ATTEMPTS,
attempt);
DistributedFileSystem fs =
cluster.getConfiguration(0)
.setInt(HdfsClientConfigKeys.DFS_CLIENT_SOCKET_TIMEOUT_KEY, 1000);
DistributedFileSystem newFs =
(DistributedFileSystem) cluster.getNewFileSystemInstance(0);
try(DFSStripedInputStream in = new DFSStripedInputStream(fs.getClient(),
try(DFSStripedInputStream in = new DFSStripedInputStream(newFs.getClient(),
filePath.toString(), false, ecPolicy, null)){
int bufLen = 1024 * 100;
byte[] buf = new byte[bufLen];
int readTotal = 0;
in.seek(readTotal);
int nread = in.read(buf, 0, bufLen);
// Simulated time-consuming processing operations, such as UDF.
Thread.sleep(2000);
Thread.sleep(10000);
in.seek(nread);
// StripeRange 6MB
bufLen = 1024 * 1024 * 6;
Expand Down

0 comments on commit bb46dbd

Please sign in to comment.