protected long syncSlots(final FSDataOutputStream stream, final ByteSlot[] slots, final int offset, final int count) throws IOException { long totalSynced = 0; for (int i = 0; i < count; ++i) { final ByteSlot data = slots[offset + i]; data.writeTo(stream); totalSynced += data.size(); } syncStream(stream); sendPostSyncSignal(); if (LOG.isTraceEnabled()) { LOG.trace("Sync slots=" + count + '/' + syncMaxSlot + ", flushed=" + StringUtils.humanSize(totalSynced)); } return totalSynced; }
protected long syncSlots(final FSDataOutputStream stream, final ByteSlot[] slots, final int offset, final int count) throws IOException { long totalSynced = 0; for (int i = 0; i < count; ++i) { final ByteSlot data = slots[offset + i]; data.writeTo(stream); totalSynced += data.size(); } syncStream(stream); sendPostSyncSignal(); if (LOG.isTraceEnabled()) { LOG.trace("Sync slots=" + count + '/' + syncMaxSlot + ", flushed=" + StringUtils.humanSize(totalSynced)); } return totalSynced; }
protected long syncSlots(final FSDataOutputStream stream, final ByteSlot[] slots, final int offset, final int count) throws IOException { long totalSynced = 0; for (int i = 0; i < count; ++i) { final ByteSlot data = slots[offset + i]; data.writeTo(stream); totalSynced += data.size(); } syncStream(stream); sendPostSyncSignal(); if (LOG.isTraceEnabled()) { LOG.trace("Sync slots=" + count + '/' + syncMaxSlot + ", flushed=" + StringUtils.humanSize(totalSynced)); } return totalSynced; }
protected long syncSlots(FSDataOutputStream stream, ByteSlot[] slots, int offset, int count) throws IOException { long totalSynced = 0; for (int i = 0; i < count; ++i) { ByteSlot data = slots[offset + i]; data.writeTo(stream); totalSynced += data.size(); } if (useHsync) { stream.hsync(); } else { stream.hflush(); } sendPostSyncSignal(); if (LOG.isTraceEnabled()) { LOG.trace("Sync slots=" + count + '/' + slots.length + ", flushed=" + StringUtils.humanSize(totalSynced)); } return totalSynced; }