recordSerializer.serializeRecord(delegate); BufferBuilder bufferBuilder = createBufferBuilder(bufferSize); recordSerializer.copyToBufferBuilder(bufferBuilder);
/** * 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(); } }
@Override public void add(T record, int[] targetPartitions) throws IOException, InterruptedException { serializationDelegate.setInstance(record); recordSerializer.serializeRecord(serializationDelegate); for (int partition : targetPartitions) { copyToTargetFile(partition); } }
@Override public void writeRecord(T record) throws IOException { serializationDelegate.setInstance(record); recordSerializer.serializeRecord(serializationDelegate); copyToFile(); }
@Override public void add(T record, int targetPartition) throws IOException, InterruptedException { serializationDelegate.setInstance(record); recordSerializer.serializeRecord(serializationDelegate); copyToTargetFile(targetPartition); }
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 copyRecord(DataInputView serializedRecord) throws IOException { checkState(!isWritingFinished, ""); copySerializationDelegate.setInputView(serializedRecord); recordSerializer.serializeRecord(copySerializationDelegate); copyToFile(); }
@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(); } }
subSerializationDelegate.setBuffer(nextBufferForInternalSer); try { subSerializer.serializeRecord(subSerializationDelegate); } catch (IOException e) {