@Override public void append(ByteBuffer body, boolean immutable) throws IOException { if (immutable) { bodies.add(body); } else { bodies.add(ByteBuffers.copy(body)); } }
void append(ILoggingEvent event) throws IOException { // If the event is already a LoggingEvent, we don't need to re-encode. if (event instanceof LoggingEvent) { ByteBuffer encoded = ((LoggingEvent) event).getEncoded(); if (encoded != null) { // TODO: CDAP-8735 Remove the copying after upgraded to Avro 1.7.4+ dataFileWriter.appendEncoded(ByteBuffers.copy(encoded)); } else { dataFileWriter.append(((LoggingEvent) event).getRecord()); } return; } dataFileWriter.append(serializer.toGenericRecord(event)); }
void append(ILoggingEvent event) throws IOException { // If the event is already a LoggingEvent, we don't need to re-encode. if (event instanceof LoggingEvent) { ByteBuffer encoded = ((LoggingEvent) event).getEncoded(); if (encoded != null) { // TODO: CDAP-8735 Remove the copying after upgraded to Avro 1.7.4+ dataFileWriter.appendEncoded(ByteBuffers.copy(encoded)); } else { dataFileWriter.append(((LoggingEvent) event).getRecord()); } return; } dataFileWriter.append(serializer.toGenericRecord(event)); }