/** * Produces a string representation of the method currently being serviced * by this Handler. * @return A human-readable string representation of the method call. */ @Override public long getRPCPacketLength() { if (getState() != State.RUNNING || packet == null) { // no RPC is currently running, or we don't have an RPC's packet info return -1L; } return packet.getSerializedSize(); }
/** * @return Size on the wire when the two messages are written with writeDelimitedTo */ public static int getTotalSizeWhenWrittenDelimited(Message... messages) { int totalSize = 0; for (Message m : messages) { if (m == null) { continue; } totalSize += m.getSerializedSize(); totalSize += CodedOutputStream.computeRawVarint32Size(m.getSerializedSize()); } Preconditions.checkArgument(totalSize < Integer.MAX_VALUE); return totalSize; }
resultVintSize = 0; if (header != null) { headerSerializedSize = header.getSerializedSize(); headerVintSize = CodedOutputStream.computeUInt32SizeNoTag(headerSerializedSize); resultSerializedSize = result.getSerializedSize(); resultVintSize = CodedOutputStream.computeUInt32SizeNoTag(resultSerializedSize);
long responseSize = result.getSerializedSize(); if (call.isClientCellBlockSupported()) {
/** * @return Size on the wire when the two messages are written with writeDelimitedTo */ public static int getTotalSizeWhenWrittenDelimited(Message... messages) { int totalSize = 0; for (Message m : messages) { if (m == null) { continue; } totalSize += m.getSerializedSize(); totalSize += CodedOutputStream.computeRawVarint32Size(m.getSerializedSize()); } Preconditions.checkArgument(totalSize < Integer.MAX_VALUE); return totalSize; }
/** * @return Size on the wire when the two messages are written with writeDelimitedTo */ public static int getTotalSizeWhenWrittenDelimited(Message... messages) { int totalSize = 0; for (Message m : messages) { if (m == null) { continue; } totalSize += m.getSerializedSize(); totalSize += CodedOutputStream.computeRawVarint32Size(m.getSerializedSize()); } Preconditions.checkArgument(totalSize < Integer.MAX_VALUE); return totalSize; }