Skip to content

Commit edf45fc

Browse files
committed
Adds unit on time variables.
1 parent a1e01f7 commit edf45fc

File tree

1 file changed

+8
-8
lines changed
  • hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/driver/impl

1 file changed

+8
-8
lines changed

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/driver/impl/StateStoreMySQLImpl.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public <T extends BaseRecord> boolean putAll(
222222
@Override
223223
public <T extends BaseRecord> boolean removeAll(Class<T> clazz) throws IOException {
224224
verifyDriverReady();
225-
long start = Time.monotonicNow();
225+
long startTimeMs = Time.monotonicNow();
226226
StateStoreMetrics metrics = getMetrics();
227227
boolean success = true;
228228
String tableName = getAndValidateTableNameForClass(clazz);
@@ -236,11 +236,11 @@ public <T extends BaseRecord> boolean removeAll(Class<T> clazz) throws IOExcepti
236236
}
237237

238238
if (metrics != null) {
239-
long time = Time.monotonicNow() - start;
239+
long durationMs = Time.monotonicNow() - startTimeMs;
240240
if (success) {
241-
metrics.addRemove(time);
241+
metrics.addRemove(durationMs);
242242
} else {
243-
metrics.addFailure(time);
243+
metrics.addFailure(durationMs);
244244
}
245245
}
246246
return success;
@@ -254,7 +254,7 @@ public <T extends BaseRecord> int remove(Class<T> clazz, Query<T> query) throws
254254
return 0;
255255
}
256256

257-
long start = Time.monotonicNow();
257+
long startTimeMs = Time.monotonicNow();
258258
StateStoreMetrics metrics = getMetrics();
259259
int removed = 0;
260260
// Get the current records
@@ -277,18 +277,18 @@ public <T extends BaseRecord> int remove(Class<T> clazz, Query<T> query) throws
277277
if (!success) {
278278
LOG.error("Cannot remove records {} query {}", clazz, query);
279279
if (metrics != null) {
280-
metrics.addFailure(monotonicNow() - start);
280+
metrics.addFailure(monotonicNow() - startTimeMs);
281281
}
282282
}
283283
} catch (IOException e) {
284284
LOG.error("Cannot remove records {} query {}", clazz, query, e);
285285
if (metrics != null) {
286-
metrics.addFailure(monotonicNow() - start);
286+
metrics.addFailure(monotonicNow() - startTimeMs);
287287
}
288288
}
289289

290290
if (removed > 0 && metrics != null) {
291-
metrics.addRemove(monotonicNow() - start);
291+
metrics.addRemove(monotonicNow() - startTimeMs);
292292
}
293293
return removed;
294294
}

0 commit comments

Comments
 (0)