Repository: tez Updated Branches: refs/heads/master 2050f50e9 -> 2e52635d9
TEZ-1309. Use hflush instead of hsync in recovery log. (hitesh) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/2e52635d Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/2e52635d Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/2e52635d Branch: refs/heads/master Commit: 2e52635d9b42fc6fe9c64c6d4336d9180fedb05d Parents: 2050f50 Author: Hitesh Shah <[email protected]> Authored: Thu Jul 24 13:12:28 2014 -0700 Committer: Hitesh Shah <[email protected]> Committed: Thu Jul 24 13:12:28 2014 -0700 ---------------------------------------------------------------------- .../tez/dag/history/recovery/RecoveryService.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/2e52635d/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java b/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java index db0dcf1..3552c04 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java @@ -157,7 +157,7 @@ public class RecoveryService extends AbstractService { if (summaryStream != null) { try { LOG.info("Closing Summary Stream"); - summaryStream.hsync(); + summaryStream.hflush(); summaryStream.close(); } catch (IOException ioe) { LOG.warn("Error when closing summary stream", ioe); @@ -166,7 +166,7 @@ public class RecoveryService extends AbstractService { for (Entry<TezDAGID, FSDataOutputStream> entry : outputStreamMap.entrySet()) { try { LOG.info("Closing Output Stream for DAG " + entry.getKey()); - entry.getValue().hsync(); + entry.getValue().hflush(); entry.getValue().close(); } catch (IOException ioe) { LOG.warn("Error when closing output stream", ioe); @@ -222,11 +222,11 @@ public class RecoveryService extends AbstractService { try { SummaryEvent summaryEvent = (SummaryEvent) event.getHistoryEvent(); handleSummaryEvent(dagId, eventType, summaryEvent); - summaryStream.hsync(); + summaryStream.hflush(); if (summaryEvent.writeToRecoveryImmediately()) { handleRecoveryEvent(event); doFlush(outputStreamMap.get(event.getDagID()), - appContext.getClock().getTime(), true); + appContext.getClock().getTime()); } else { if (LOG.isDebugEnabled()) { LOG.debug("Queueing Non-immediate Summary/Recovery event of type" @@ -388,16 +388,12 @@ public class RecoveryService extends AbstractService { if (!doFlush) { return; } - doFlush(outputStream, currentTime, false); + doFlush(outputStream, currentTime); } private void doFlush(FSDataOutputStream outputStream, - long currentTime, boolean sync) throws IOException { - if (sync) { - outputStream.hsync(); - } else { - outputStream.hflush(); - } + long currentTime) throws IOException { + outputStream.hflush(); if (LOG.isDebugEnabled()) { LOG.debug("Flushing output stream"
