Avoid Copy of Bytes in Protobuf BinaryWriter
- Langage dominant
- Java
- Étoiles
- 3.1k
- Forks
- 1.6k
- Merge moyen
- 3 j 12 h
- PR mergées (30 j)
- 33
Description
```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.*
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- backend
- Type d'issue
- Refactorisation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100