Skip to content

Commit 516cf46

Browse files
committed
MAPREDUCE-7522. Fix SpotBugs issues in hadoop-mapreduce-client-app module.
1 parent 3f1dc7d commit 516cf46

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapred/TaskAttemptListenerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class TaskAttemptListenerImpl extends CompositeService
8686
private Server server;
8787
protected TaskHeartbeatHandler taskHeartbeatHandler;
8888
private RMHeartbeatHandler rmHeartbeatHandler;
89-
private long commitWindowMs;
89+
private volatile long commitWindowMs;
9090
private InetSocketAddress address;
9191
private ConcurrentMap<WrappedJvmID, org.apache.hadoop.mapred.Task>
9292
jvmIDToActiveAttemptMap

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public class JobHistoryEventHandler extends AbstractService
108108
private Path stagingDirPath = null;
109109
private Path doneDirPrefixPath = null; // folder for completed jobs
110110

111-
private int maxUnflushedCompletionEvents;
112-
private int postJobCompletionMultiplier;
111+
private volatile int maxUnflushedCompletionEvents;
112+
private volatile int postJobCompletionMultiplier;
113113
private long flushTimeout;
114114
private int minQueueSizeForBatchingFlushes; // TODO: Rename
115115

@@ -121,7 +121,7 @@ public class JobHistoryEventHandler extends AbstractService
121121
protected BlockingQueue<JobHistoryEvent> eventQueue =
122122
new LinkedBlockingQueue<JobHistoryEvent>();
123123

124-
protected boolean handleTimelineEvent = false;
124+
protected volatile boolean handleTimelineEvent = false;
125125
protected AsyncDispatcher atsEventDispatcher = null;
126126
protected Thread eventHandlingThread;
127127

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ public class MRAppMaster extends CompositeService {
233233
@VisibleForTesting
234234
protected volatile boolean isLastAMRetry = false;
235235
//Something happened and we should shut down right after we start up.
236-
boolean errorHappenedShutDown = false;
236+
volatile boolean errorHappenedShutDown = false;
237237
private String shutDownMessage = null;
238238
JobStateInternal forcedState = null;
239239
private final ScheduledExecutorService logSyncer;
240240

241-
private long recoveredJobStartTime = -1L;
242-
private static boolean mainStarted = false;
241+
private volatile long recoveredJobStartTime = -1L;
242+
private static volatile boolean mainStarted = false;
243243

244244
@VisibleForTesting
245245
protected AtomicBoolean successfullyUnregistered =

0 commit comments

Comments
 (0)