@Override public void prune() { serializationBuffer.pruneBuffer(); subSerializer.prune(); }
/** * This is used to send LatencyMarks to a random target channel. */ public void randomEmit(T record) throws IOException, InterruptedException { serializer.serializeRecord(record); if (copyFromSerializerToTargetChannel(rng.nextInt(numChannels))) { serializer.prune(); } }
/** * This is used to send LatencyMarks to a random target channel. */ public void randomEmit(T record) throws IOException, InterruptedException { serializer.serializeRecord(record); if (copyFromSerializerToTargetChannel(rng.nextInt(numChannels))) { serializer.prune(); } }
private void emit(T record, int[] targetChannels) throws IOException, InterruptedException { serializer.serializeRecord(record); boolean pruneAfterCopying = false; for (int channel : targetChannels) { if (copyFromSerializerToTargetChannel(channel)) { pruneAfterCopying = true; } } // Make sure we don't hold onto the large intermediate serialization buffer for too long if (pruneAfterCopying) { serializer.prune(); } }
private void emit(T record, int[] targetChannels) throws IOException, InterruptedException { serializer.serializeRecord(record); boolean pruneAfterCopying = false; for (int channel : targetChannels) { if (copyFromSerializerToTargetChannel(channel)) { pruneAfterCopying = true; } } // Make sure we don't hold onto the large intermediate serialization buffer for too long if (pruneAfterCopying) { serializer.prune(); } }
@Override public void emitRecord(T record, int targetChannel, boolean isBroadcast, boolean flushAlways) throws IOException, InterruptedException { serializationDelegate.setInstance(record); serializer.serializeRecord(serializationDelegate); if (isBroadcast) { tryFinishCurrentBufferBuilder(targetChannel, true); } if (copyFromSerializerToTargetChannel(targetChannel, isBroadcast, flushAlways)) { serializer.prune(); } if (isBroadcast) { tryFinishCurrentBufferBuilder(targetChannel, true); } }
@Override public void emitRecord(T record, int[] targetChannels, boolean isBroadcast, boolean flushAlways) throws IOException, InterruptedException { serializationDelegate.setInstance(record); serializer.serializeRecord(serializationDelegate); boolean pruneAfterCopying = false; if (isBroadcast) { pruneAfterCopying = copyFromSerializerToTargetChannel(0, true, flushAlways); } else { for (int channel : targetChannels) { if (copyFromSerializerToTargetChannel(channel, false, flushAlways)) { pruneAfterCopying = true; } } } // Make sure we don't hold onto the large intermediate serialization buffer for too long if (pruneAfterCopying) { serializer.prune(); } }