Skip to content
Merged
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
1 change: 1 addition & 0 deletions dynamometer-workload/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
dependencies {
compile deps.hadoop.common
compile deps.hadoop.hdfs
compile deps.hadoop.'mapreduce-client-core'

testCompile deps.hadoop.minicluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.hdfs.DFSClient;
import org.apache.hadoop.hdfs.DynoDFSUtil;
import org.apache.hadoop.hdfs.DistributedFileSystem;
import org.apache.hadoop.hdfs.protocol.HdfsFileStatus;
import org.apache.hadoop.mapreduce.Counter;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.counters.GenericCounter;
Expand Down Expand Up @@ -50,6 +54,7 @@ public class AuditReplayThread extends Thread {
private Exception exception;
private long startTimestampMs;
private FileSystem fs;
private DFSClient dfsClient;
private boolean createBlocks;

// Counters are not thread-safe so we store a local mapping in our thread
Expand All @@ -65,6 +70,7 @@ public class AuditReplayThread extends Thread {
createBlocks = mapperConf.getBoolean(AuditReplayMapper.CREATE_BLOCKS_KEY,
AuditReplayMapper.CREATE_BLOCKS_DEFAULT);
fs = FileSystem.get(URI.create(namenodeURI), mapperConf);
dfsClient = DynoDFSUtil.getDFSClient((DistributedFileSystem) fs);
LOG.info("Start timestamp: " + startTimestampMs);
for (REPLAYCOUNTERS rc : REPLAYCOUNTERS.values()) {
replayCountersMap.put(rc, new GenericCounter());
Expand Down Expand Up @@ -185,15 +191,15 @@ private boolean replayLog(String command, String src, String dst) {
break;

case LISTSTATUS:
fs.listStatus(new Path(src));
dfsClient.listPaths(src, HdfsFileStatus.EMPTY_NAME);
break;

case APPEND:
fs.append(new Path(src));
return true;

case DELETE:
fs.delete(new Path(src), false);
fs.delete(new Path(src), true);
break;

case OPEN:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright 2017 LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
* See LICENSE in the project root for license information.
*/
package org.apache.hadoop.hdfs;

public class DynoDFSUtil {

public static DFSClient getDFSClient(DistributedFileSystem dfs) {
return dfs.dfs;
}

}