Search in sources :

Example 1 with SlimeConfigResponse

use of com.yahoo.vespa.config.protocol.SlimeConfigResponse in project vespa by vespa-engine.

the class LZ4ConfigResponseFactory method createResponse.

@Override
public ConfigResponse createResponse(ConfigPayload payload, InnerCNode defFile, long generation) {
    Utf8Array rawPayload = payload.toUtf8Array(true);
    String configMd5 = ConfigUtils.getMd5(rawPayload);
    CompressionInfo info = CompressionInfo.create(CompressionType.LZ4, rawPayload.getByteLength());
    Utf8Array compressed = new Utf8Array(compressor.compress(rawPayload.getBytes()));
    return new SlimeConfigResponse(compressed, defFile, generation, configMd5, info);
}
Also used : SlimeConfigResponse(com.yahoo.vespa.config.protocol.SlimeConfigResponse) CompressionInfo(com.yahoo.vespa.config.protocol.CompressionInfo) Utf8Array(com.yahoo.text.Utf8Array)

Example 2 with SlimeConfigResponse

use of com.yahoo.vespa.config.protocol.SlimeConfigResponse in project vespa by vespa-engine.

the class UncompressedConfigResponseFactory method createResponse.

@Override
public ConfigResponse createResponse(ConfigPayload payload, InnerCNode defFile, long generation) {
    Utf8Array rawPayload = payload.toUtf8Array(true);
    String configMd5 = ConfigUtils.getMd5(rawPayload);
    CompressionInfo info = CompressionInfo.create(CompressionType.UNCOMPRESSED, rawPayload.getByteLength());
    return new SlimeConfigResponse(rawPayload, defFile, generation, configMd5, info);
}
Also used : SlimeConfigResponse(com.yahoo.vespa.config.protocol.SlimeConfigResponse) CompressionInfo(com.yahoo.vespa.config.protocol.CompressionInfo) Utf8Array(com.yahoo.text.Utf8Array)

Aggregations

Utf8Array (com.yahoo.text.Utf8Array)2 CompressionInfo (com.yahoo.vespa.config.protocol.CompressionInfo)2 SlimeConfigResponse (com.yahoo.vespa.config.protocol.SlimeConfigResponse)2