Search in sources :

Example 1 with ZeroCopyByteArrayOutputStream

use of org.apache.druid.io.ZeroCopyByteArrayOutputStream in project druid by druid-io.

the class IndexMergerV9 method makeColumn.

private void makeColumn(final FileSmoosher v9Smoosher, final String columnName, final ColumnDescriptor serdeficator) throws IOException {
    ZeroCopyByteArrayOutputStream specBytes = new ZeroCopyByteArrayOutputStream();
    SERIALIZER_UTILS.writeString(specBytes, mapper.writeValueAsString(serdeficator));
    try (SmooshedWriter channel = v9Smoosher.addWithSmooshedWriter(columnName, specBytes.size() + serdeficator.getSerializedSize())) {
        specBytes.writeTo(channel);
        serdeficator.writeTo(channel, v9Smoosher);
    }
}
Also used : ZeroCopyByteArrayOutputStream(org.apache.druid.io.ZeroCopyByteArrayOutputStream) SmooshedWriter(org.apache.druid.java.util.common.io.smoosh.SmooshedWriter)

Aggregations

ZeroCopyByteArrayOutputStream (org.apache.druid.io.ZeroCopyByteArrayOutputStream)1 SmooshedWriter (org.apache.druid.java.util.common.io.smoosh.SmooshedWriter)1