Avoid Copy of Bytes in Protobuf BinaryWriter
- Lingua principale
- Java
- Stelle
- 3.1k
- Fork
- 1.6k
- Merge medio
- 3g 12h
- PR unite (30g)
- 33
Descrizione
```java
class BinaryWriter extends FieldWriter {
@Override
final void writeRawValue(Object value) {
ByteString byteString = (ByteString) value;
Binary binary = Binary.fromConstantByteArray(byteString.toByteArray());
recordConsumer.addBinary(binary);
}
}
```
`toByteArray()` creates a copy of the buffer. There is already support with Parquet and Protobuf to pass instead a ByteBuffer which avoids the copy.
**Reporter**: [David Mollitor](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=belugabehr) / @belugabehr
**Assignee**: [David Mollitor](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=belugabehr) / @belugabehr
#### Related issues:
- [Move Support for ByteBuffer into TTransport](https://issues.apache.org/jira/browse/THRIFT-5288) (is blocked by)
**Note**: *This issue was originally created as [PARQUET-1918](https://issues.apache.org/jira/browse/PARQUET-1918). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start at BinaryWriter.writeRawValue, where ByteString.toByteArray() is used, and review the existing Parquet and Protobuf ByteBuffer support. Check the related THRIFT-5288 issue because the requested support is blocked there. Done means the binary value can be passed without copying the ByteString buffer.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- backend
- Tipo di issue
- Refactoring
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100