public final int size() { return out.size(); }
public final int size() { return out.size(); }
/** * @return the number of bytes written to this stream */ long bytesWritten() { if (mOutputStream == null) { return 0; } return mOutputStream.size(); }
public int getPendingBytes() { return buf.size(); } }
public final int size() { return out.size(); }
/** * Get size of stream. * * @return bytes written so far in the stream. Note this is a int, not a long as you would exect. This because the underlying * DataInputStream has a design flaw. */ public final int size() { return dis.size(); }
/** * Get size of stream. * * @return bytes written so far in the stream. Note this is a int, not a long as you would exect. This because the underlying * DataInputStream has a design flaw. */ public final int size() { return dis.size(); }
public int getDataOutputStreamSize() { return out.size(); }
public final int size() { return out.size(); }
/** * Writes the Cell to this block * @param cell * @throws IOException */ void write(Cell cell) throws IOException{ expectState(State.WRITING); int posBeforeEncode = this.userDataStream.size(); this.unencodedDataSizeWritten += this.dataBlockEncoder.encode(cell, dataBlockEncodingCtx, this.userDataStream); this.encodedDataSizeWritten += this.userDataStream.size() - posBeforeEncode; }
@Override public synchronized void flush() throws IOException { if (mIsClosed || mDataOutputStream.size() == 0) { // There is nothing to flush. return; } try { mDataOutputStream.flush(); } catch (IOException e) { mRotateLogForNextWrite = true; throw new IOException(ExceptionMessage.JOURNAL_FLUSH_FAILURE.getMessageWithUrl( RuntimeConstants.ALLUXIO_DEBUG_DOCS_URL, mCurrentLog, e.getMessage()), e); } boolean overSize = mDataOutputStream.size() >= mMaxLogSize; if (overSize || !mUfs.supportsFlush()) { // (1) The log file is oversize, needs to be rotated. Or // (2) Underfs is S3 or OSS, flush on S3OutputStream/OSSOutputStream will only flush to // local temporary file, // call close and complete the log to sync the journal entry to S3/OSS. if (overSize) { LOG.info("Rotating log file. size: {} maxSize: {}", mDataOutputStream.size(), mMaxLogSize); } mRotateLogForNextWrite = true; } }
@Override public void writeUTF(String str) throws IOException { final DataOutputStream dos = new DataOutputStream(rf.new RemoteFileOutputStream(fp)); try { dos.writeUTF(str); } finally { dos.close(); } fp += dos.size(); }
public void flush() throws IOException { int onDiskDataSize = 0; if (startOffset >= 0) { onDiskDataSize = out.size() - startOffset; } out.writeInt(rowsOffsetBAOS.size() / 4); if (rowsOffsetBAOS.size() > 0) { out.write(rowsOffsetBAOS.getBuffer(), 0, rowsOffsetBAOS.size()); } out.writeInt(onDiskDataSize); if (LOG.isTraceEnabled()) { LOG.trace("RowNumber: " + rowsOffsetBAOS.size() / 4 + ", onDiskDataSize: " + onDiskDataSize + ", totalOnDiskSize: " + (out.size() - startOffset)); } }
/** * Close the transfer object. */ public void close() { if (writableChannel != null) { try { if (out.size() > 4) flush(); } catch (IOException e) { DbException.traceThrowable(e); } finally { conn = null; session = null; writableChannel = null; } } }
compressingStream.flush(); return compressedStream.size(); } finally { nullOutputStream.close();
serializeAsWritable(dos, t); dos.flush(); assertEquals(FixedFileTrailer.getTrailerSize(version), dos.size());