summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2017-06-13 18:52:46 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2017-06-13 18:52:46 +0200
commit0155137e7d56730665d406c37aa75649e5a3418a (patch)
tree05100870215c7852cc27b6970b60c9ff5f77e763
parent4e5d87a9baa4176a1089f7afd1f433a8da275725 (diff)
parent6a64952133fc05136a0e445851b49bd0fc71c00e (diff)
Merge with master
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java1
-rw-r--r--config-model/src/main/resources/schema/content.rnc2
-rw-r--r--config-provisioning/src/main/resources/configdefinitions/node-repository.def2
-rw-r--r--dist/vespa.spec2
-rw-r--r--document/CMakeLists.txt1
-rw-r--r--document/src/tests/serialization/compression_test.cpp23
-rw-r--r--document/src/vespa/document/fieldvalue/serializablearray.cpp11
-rw-r--r--document/src/vespa/document/serialization/vespadocumentserializer.cpp1
-rw-r--r--document/src/vespa/document/util/CMakeLists.txt6
-rw-r--r--document/src/vespa/document/util/compressionconfig.h17
-rw-r--r--document/src/vespa/document/util/compressor.cpp72
-rw-r--r--document/src/vespa/document/util/compressor.h22
-rw-r--r--document/src/vespa/document/util/lz4compressor.cpp46
-rw-r--r--document/src/vespa/document/util/lz4compressor.h17
-rw-r--r--document/src/vespa/document/util/zstdcompressor.cpp34
-rw-r--r--document/src/vespa/document/util/zstdcompressor.h17
-rw-r--r--jdisc_http_service/docs/class-diagram.graffle1856
-rw-r--r--jdisc_http_service/docs/class-diagram.pngbin87451 -> 0 bytes
-rw-r--r--jdisc_http_service/docs/httpserver.html96
-rw-r--r--searchcore/src/tests/proton/summaryengine/summaryengine.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/config/proton.def6
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp8
-rw-r--r--searchlib/src/tests/docstore/chunk/chunk_test.cpp30
-rw-r--r--searchlib/src/vespa/searchlib/common/packets.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/docstore/chunkformat.cpp26
-rw-r--r--searchlib/src/vespa/searchlib/docstore/documentstore.cpp80
-rw-r--r--searchlib/src/vespa/searchlib/docstore/visitcache.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/grouping/sketch.h4
-rw-r--r--staging_vespalib/src/vespa/vespalib/data/databuffer.h6
-rw-r--r--vespalib/src/vespa/vespalib/util/optimized.h2
-rw-r--r--vespalog/src/vespa/log/bufferedlogger.cpp3
33 files changed, 305 insertions, 2108 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java b/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java
index 4db416bb57d..7c40acd91ee 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java
@@ -210,6 +210,7 @@ public class Tuning extends AbstractConfigProducer implements PartitionsConfig.P
public static class Compression {
public enum Type {
NONE("NONE"),
+ ZSTD("ZSTD"),
LZ4("LZ4");
public final String name;
diff --git a/config-model/src/main/resources/schema/content.rnc b/config-model/src/main/resources/schema/content.rnc
index a602d713eeb..9031e8128df 100644
--- a/config-model/src/main/resources/schema/content.rnc
+++ b/config-model/src/main/resources/schema/content.rnc
@@ -361,6 +361,6 @@ TuningIoOptionsLight = string "normal" | string "directio"
TuningIoOptionsFull = string "normal" | string "directio" | string "mmap" | string "mlock"
TuningCompression = element compression {
- element type { string "none" | string "lz4" }? &
+ element type { string "none" | string "lz4" | string "zstd" }? &
element level { xsd:nonNegativeInteger }?
}
diff --git a/config-provisioning/src/main/resources/configdefinitions/node-repository.def b/config-provisioning/src/main/resources/configdefinitions/node-repository.def
index d3a01456b9a..7a08ae63e44 100644
--- a/config-provisioning/src/main/resources/configdefinitions/node-repository.def
+++ b/config-provisioning/src/main/resources/configdefinitions/node-repository.def
@@ -3,4 +3,4 @@ namespace=config.provisioning
# Docker image to use in REST API responses. This must be a fully qualified name, including registry, but excluding
# version. Example: my-docker-registry.domain.tld:8080/dist/vespa
-dockerImage string
+dockerImage string default="dummyImage"
diff --git a/dist/vespa.spec b/dist/vespa.spec
index f4ea844737f..4c7cb56abc3 100644
--- a/dist/vespa.spec
+++ b/dist/vespa.spec
@@ -23,6 +23,7 @@ BuildRequires: devtoolset-6-binutils
BuildRequires: Judy-devel
BuildRequires: cmake3
BuildRequires: lz4-devel
+BuildRequires: libzstd-devel
BuildRequires: zlib-devel
BuildRequires: maven
BuildRequires: libicu-devel
@@ -39,6 +40,7 @@ BuildRequires: systemd
Requires: epel-release
Requires: Judy
Requires: lz4
+Requires: libzstd
Requires: zlib
Requires: libicu
Requires: llvm3.9
diff --git a/document/CMakeLists.txt b/document/CMakeLists.txt
index 4e8e6a0aab2..e9694390b4b 100644
--- a/document/CMakeLists.txt
+++ b/document/CMakeLists.txt
@@ -10,6 +10,7 @@ vespa_define_module(
EXTERNAL_DEPENDS
lz4
+ zstd
LIBS
src/vespa/document
diff --git a/document/src/tests/serialization/compression_test.cpp b/document/src/tests/serialization/compression_test.cpp
index 6b95f5e933f..6574b4ac34c 100644
--- a/document/src/tests/serialization/compression_test.cpp
+++ b/document/src/tests/serialization/compression_test.cpp
@@ -1,27 +1,44 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// Unit tests for annotation serialization.
-#include <vespa/log/log.h>
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/document/util/compressor.h>
+#include <vespa/vespalib/data/databuffer.h>
+#include <vespa/log/log.h>
LOG_SETUP("compression_test");
using namespace document;
+using namespace document::compression;
using namespace vespalib;
static vespalib::string _G_compressableText("AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
"AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
"AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
"AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
- "AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE");
+ "AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
+ "XYZABCDEFGHIJGJMNOPQRSTUVW"
+ "AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
+ "AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
+ "AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
+ "AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
+ "AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEE"
+ "XYZABCDEFGHIJGJMNOPQRSTUVW");
TEST("requireThatLZ4CompressFine") {
CompressionConfig cfg(CompressionConfig::Type::LZ4);
ConstBufferRef ref(_G_compressableText.c_str(), _G_compressableText.size());
DataBuffer compressed;
EXPECT_EQUAL(CompressionConfig::Type::LZ4, compress(cfg, ref, compressed, false));
+ EXPECT_EQUAL(66u, compressed.getDataLen());
+}
+
+TEST("requireThatZStdCompressFine") {
+ CompressionConfig cfg(CompressionConfig::Type::ZSTD);
+ ConstBufferRef ref(_G_compressableText.c_str(), _G_compressableText.size());
+ DataBuffer compressed;
+ EXPECT_EQUAL(CompressionConfig::Type::ZSTD, compress(cfg, ref, compressed, false));
+ EXPECT_EQUAL(64u, compressed.getDataLen());
}
TEST_MAIN() {
diff --git a/document/src/vespa/document/fieldvalue/serializablearray.cpp b/document/src/vespa/document/fieldvalue/serializablearray.cpp
index 6e83e42752f..ac1cabc82c0 100644
--- a/document/src/vespa/document/fieldvalue/serializablearray.cpp
+++ b/document/src/vespa/document/fieldvalue/serializablearray.cpp
@@ -2,14 +2,15 @@
#include "serializablearray.h"
#include <vespa/document/util/serializableexceptions.h>
#include <vespa/document/util/bytebuffer.h>
+#include <vespa/document/util/compressor.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/vespalib/data/databuffer.h>
-#include <vespa/document/util/compressor.h>
#include <vespa/log/log.h>
LOG_SETUP(".document.serializable-array");
using std::vector;
+using vespalib::make_string;
namespace document {
@@ -179,6 +180,7 @@ SerializableArray::clear(int id)
void
SerializableArray::deCompress() // throw (DeserializeException)
{
+ using document::compression::decompress;
// will only do this once
LOG_ASSERT(_compSerData);
@@ -201,15 +203,14 @@ SerializableArray::deCompress() // throw (DeserializeException)
false);
} catch (const std::runtime_error & e) {
throw DeserializeException(
- vespalib::make_string( "Document was compressed with code unknown code %d", _serializedCompression),
+ make_string( "Document was compressed with code unknown code %d", _serializedCompression),
VESPA_STRLOC);
}
if (unCompressed.getDataLen() != (size_t)_uncompressedLength) {
throw DeserializeException(
- vespalib::make_string(
- "Did not decompress to the expected length: had %" PRIu64 ", wanted %d, got %" PRIu64,
- _compSerData->getRemaining(), _uncompressedLength, unCompressed.getDataLen()),
+ make_string("Did not decompress to the expected length: had %zu, wanted %d, got %zu",
+ _compSerData->getRemaining(), _uncompressedLength, unCompressed.getDataLen()),
VESPA_STRLOC);
}
assert(newSerialization->getBuffer() == unCompressed.getData());
diff --git a/document/src/vespa/document/serialization/vespadocumentserializer.cpp b/document/src/vespa/document/serialization/vespadocumentserializer.cpp
index ed4ea31a5f2..1810b9fb631 100644
--- a/document/src/vespa/document/serialization/vespadocumentserializer.cpp
+++ b/document/src/vespa/document/serialization/vespadocumentserializer.cpp
@@ -263,6 +263,7 @@ vespalib::ConstBufferRef
compressStream(const CompressionConfig &config, nbostream &stream,
vespalib::DataBuffer & compressed_data)
{
+ using compression::compress;
vespalib::ConstBufferRef buf(stream.c_str(), stream.size());
if (config.useCompression() && bigEnough(stream.size(), config)) {
CompressionConfig::Type compressedType = compress(config, vespalib::ConstBufferRef(stream.c_str(), stream.size()), compressed_data, false);
diff --git a/document/src/vespa/document/util/CMakeLists.txt b/document/src/vespa/document/util/CMakeLists.txt
index dbb67d6a913..2179b1307d3 100644
--- a/document/src/vespa/document/util/CMakeLists.txt
+++ b/document/src/vespa/document/util/CMakeLists.txt
@@ -1,11 +1,13 @@
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
vespa_add_library(document_util OBJECT
SOURCES
- stringutil.cpp
bytebuffer.cpp
- serializable.cpp
compressor.cpp
+ lz4compressor.cpp
+ zstdcompressor.cpp
printable.cpp
+ serializable.cpp
+ stringutil.cpp
DEPENDS
AFTER
document_documentconfig
diff --git a/document/src/vespa/document/util/compressionconfig.h b/document/src/vespa/document/util/compressionconfig.h
index fa20bc38578..413bdc1fb3b 100644
--- a/document/src/vespa/document/util/compressionconfig.h
+++ b/document/src/vespa/document/util/compressionconfig.h
@@ -7,16 +7,16 @@
namespace document {
-
struct CompressionConfig {
enum Type {
- NONE = 0,
- HISTORIC_1 = 1,
- HISTORIC_2 = 2,
- HISTORIC_3 = 3,
- HISTORIC_4 = 4,
- UNCOMPRESSABLE = 5,
- LZ4 = 6
+ NONE = 0,
+ HISTORIC_1 = 1,
+ HISTORIC_2 = 2,
+ HISTORIC_3 = 3,
+ HISTORIC_4 = 4,
+ UNCOMPRESSABLE = 5,
+ LZ4 = 6,
+ ZSTD = 7
};
CompressionConfig()
@@ -47,6 +47,7 @@ struct CompressionConfig {
case 4: return HISTORIC_4;
case 5: return UNCOMPRESSABLE;
case 6: return LZ4;
+ case 7: return ZSTD;
default: return NONE;
}
}
diff --git a/document/src/vespa/document/util/compressor.cpp b/document/src/vespa/document/util/compressor.cpp
index 02a2029b3eb..cd45017dd69 100644
--- a/document/src/vespa/document/util/compressor.cpp
+++ b/document/src/vespa/document/util/compressor.cpp
@@ -1,56 +1,17 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include "compressor.h"
+
+#include "lz4compressor.h"
+#include "zstdcompressor.h"
#include <vespa/vespalib/util/memory.h>
#include <vespa/vespalib/util/stringfmt.h>
-#include <stdexcept>
-#include <lz4.h>
-#include <lz4hc.h>
+#include <vespa/vespalib/data/databuffer.h>
using vespalib::alloc::Alloc;
using vespalib::ConstBufferRef;
using vespalib::DataBuffer;
using vespalib::make_string;
-namespace document
-{
-
-size_t LZ4Compressor::adjustProcessLen(uint16_t, size_t len) const { return LZ4_compressBound(len); }
-size_t LZ4Compressor::adjustUnProcessLen(uint16_t, size_t len) const { return len; }
-
-bool
-LZ4Compressor::process(const CompressionConfig& config, const void * inputV, size_t inputLen, void * outputV, size_t & outputLenV)
-{
- const char * input(static_cast<const char *>(inputV));
- char * output(static_cast<char *>(outputV));
- int sz(-1);
- int maxOutputLen = LZ4_compressBound(inputLen);
- if (config.compressionLevel > 6) {
- Alloc state = Alloc::alloc(LZ4_sizeofStateHC());
- sz = LZ4_compress_HC_extStateHC(state.get(), input, output, inputLen, maxOutputLen, config.compressionLevel);
- } else {
- Alloc state = Alloc::alloc(LZ4_sizeofState());
- sz = LZ4_compress_fast_extState(state.get(), input, output, inputLen, maxOutputLen, 1);
- }
- if (sz != 0) {
- outputLenV = sz;
- }
- assert(sz != 0);
- return (sz != 0);
-
-}
-
-bool
-LZ4Compressor::unprocess(const void * inputV, size_t inputLen, void * outputV, size_t & outputLenV)
-{
- const char * input(static_cast<const char *>(inputV));
- char * output(static_cast<char *>(outputV));
- int sz = LZ4_decompress_safe(input, output, inputLen, outputLenV);
- if (sz > 0) {
- outputLenV = sz;
- }
- assert(sz > 0);
- return (sz > 0);
-}
+namespace document::compression {
CompressionConfig::Type
compress(ICompressor & compressor, const CompressionConfig & compression, const ConstBufferRef & org, DataBuffer & dest)
@@ -78,6 +39,12 @@ docompress(const CompressionConfig & compression, const ConstBufferRef & org, Da
type = compress(lz4, compression, org, dest);
}
break;
+ case CompressionConfig::ZSTD:
+ {
+ ZStdCompressor zstd;
+ type = compress(zstd, compression, org, dest);
+ }
+ break;
case CompressionConfig::NONE:
default:
break;
@@ -138,6 +105,12 @@ decompress(const CompressionConfig::Type & type, size_t uncompressedLen, const C
decompress(lz4, uncompressedLen, org, dest, allowSwap);
}
break;
+ case CompressionConfig::ZSTD:
+ {
+ ZStdCompressor zstd;
+ decompress(zstd, uncompressedLen, org, dest, allowSwap);
+ }
+ break;
case CompressionConfig::NONE:
case CompressionConfig::UNCOMPRESSABLE:
if (allowSwap) {
@@ -154,4 +127,15 @@ decompress(const CompressionConfig::Type & type, size_t uncompressedLen, const C
}
}
+size_t computeMaxCompressedsize(CompressionConfig::Type type, size_t payloadSize) {
+ if (type == CompressionConfig::LZ4) {
+ document::LZ4Compressor lz4;
+ return lz4.adjustProcessLen(0, payloadSize);
+ } else if (type == CompressionConfig::ZSTD) {
+ document::ZStdCompressor zstd;
+ return zstd.adjustProcessLen(0, payloadSize);
+ }
+ return payloadSize;
+}
+
}
diff --git a/document/src/vespa/document/util/compressor.h b/document/src/vespa/document/util/compressor.h
index 1b857d050ac..a8d4803e038 100644
--- a/document/src/vespa/document/util/compressor.h
+++ b/document/src/vespa/document/util/compressor.h
@@ -1,12 +1,12 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/document/util/compressionconfig.h>
-#include <vespa/vespalib/data/databuffer.h>
+#include "compressionconfig.h"
#include <vespa/vespalib/util/buffer.h>
-namespace document
-{
+namespace vespalib { class DataBuffer; }
+
+namespace document {
class ICompressor
{
@@ -15,17 +15,9 @@ public:
virtual bool process(const CompressionConfig& config, const void * input, size_t inputLen, void * output, size_t & outputLen) = 0;
virtual bool unprocess(const void * input, size_t inputLen, void * output, size_t & outputLen) = 0;
virtual size_t adjustProcessLen(uint16_t options, size_t len) const = 0;
- virtual size_t adjustUnProcessLen(uint16_t options, size_t len) const = 0;
};
-class LZ4Compressor : public ICompressor
-{
-public:
- bool process(const CompressionConfig& config, const void * input, size_t inputLen, void * output, size_t & outputLen) override;
- bool unprocess(const void * input, size_t inputLen, void * output, size_t & outputLen) override;
- size_t adjustProcessLen(uint16_t options, size_t len) const override;
- size_t adjustUnProcessLen(uint16_t options, size_t len) const override;
-};
+namespace compression {
/**
* Will try to compress a buffer according to the config. If the criteria can not
@@ -51,5 +43,9 @@ CompressionConfig::Type compress(const CompressionConfig & compression, const ve
*/
void decompress(const CompressionConfig::Type & compression, size_t uncompressedLen, const vespalib::ConstBufferRef & org, vespalib::DataBuffer & dest, bool allowSwap);
+
+size_t computeMaxCompressedsize(CompressionConfig::Type type, size_t uncompressedSize);
+
}
+}
diff --git a/document/src/vespa/document/util/lz4compressor.cpp b/document/src/vespa/document/util/lz4compressor.cpp
new file mode 100644
index 00000000000..9b41df239a9
--- /dev/null
+++ b/document/src/vespa/document/util/lz4compressor.cpp
@@ -0,0 +1,46 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "lz4compressor.h"
+#include <vespa/vespalib/util/alloc.h>
+#include <lz4.h>
+#include <lz4hc.h>
+#include <cassert>
+
+using vespalib::alloc::Alloc;
+
+namespace document {
+
+size_t LZ4Compressor::adjustProcessLen(uint16_t, size_t len) const { return LZ4_compressBound(len); }
+
+bool
+LZ4Compressor::process(const CompressionConfig& config, const void * inputV, size_t inputLen, void * outputV, size_t & outputLenV)
+{
+ const char * input(static_cast<const char *>(inputV));
+ char * output(static_cast<char *>(outputV));
+ int sz(-1);
+ int maxOutputLen = LZ4_compressBound(inputLen);
+ if (config.compressionLevel > 6) {
+ Alloc state = Alloc::alloc(LZ4_sizeofStateHC());
+ sz = LZ4_compress_HC_extStateHC(state.get(), input, output, inputLen, maxOutputLen, config.compressionLevel);
+ } else {
+ Alloc state = Alloc::alloc(LZ4_sizeofState());
+ sz = LZ4_compress_fast_extState(state.get(), input, output, inputLen, maxOutputLen, 1);
+ }
+ assert(sz != 0);
+ outputLenV = sz;
+ return (sz != 0);
+
+}
+
+bool
+LZ4Compressor::unprocess(const void * inputV, size_t inputLen, void * outputV, size_t & outputLenV)
+{
+ const char * input(static_cast<const char *>(inputV));
+ char * output(static_cast<char *>(outputV));
+ int sz = LZ4_decompress_safe(input, output, inputLen, outputLenV);
+ assert(sz > 0);
+ outputLenV = sz;
+ return (sz > 0);
+}
+
+}
diff --git a/document/src/vespa/document/util/lz4compressor.h b/document/src/vespa/document/util/lz4compressor.h
new file mode 100644
index 00000000000..aa1726cd639
--- /dev/null
+++ b/document/src/vespa/document/util/lz4compressor.h
@@ -0,0 +1,17 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#pragma once
+
+#include "compressor.h"
+
+namespace document {
+
+class LZ4Compressor : public ICompressor
+{
+public:
+ bool process(const CompressionConfig& config, const void * input, size_t inputLen, void * output, size_t & outputLen) override;
+ bool unprocess(const void * input, size_t inputLen, void * output, size_t & outputLen) override;
+ size_t adjustProcessLen(uint16_t options, size_t len) const override;
+};
+
+}
+
diff --git a/document/src/vespa/document/util/zstdcompressor.cpp b/document/src/vespa/document/util/zstdcompressor.cpp
new file mode 100644
index 00000000000..bb13d8009c1
--- /dev/null
+++ b/document/src/vespa/document/util/zstdcompressor.cpp
@@ -0,0 +1,34 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "zstdcompressor.h"
+#include <vespa/vespalib/util/alloc.h>
+#include <zstd.h>
+#include <cassert>
+
+using vespalib::alloc::Alloc;
+
+namespace document {
+
+size_t ZStdCompressor::adjustProcessLen(uint16_t, size_t len) const { return ZSTD_compressBound(len); }
+
+bool
+ZStdCompressor::process(const CompressionConfig& config, const void * inputV, size_t inputLen, void * outputV, size_t & outputLenV)
+{
+ size_t maxOutputLen = ZSTD_compressBound(inputLen);
+ size_t sz = ZSTD_compress(outputV, maxOutputLen, inputV, inputLen, config.compressionLevel);
+ assert( ! ZSTD_isError(sz) );
+ outputLenV = sz;
+ return ! ZSTD_isError(sz);
+
+}
+
+bool
+ZStdCompressor::unprocess(const void * inputV, size_t inputLen, void * outputV, size_t & outputLenV)
+{
+ size_t sz = ZSTD_decompress(outputV, outputLenV, inputV, inputLen);
+ assert( ! ZSTD_isError(sz) );
+ outputLenV = sz;
+ return ! ZSTD_isError(sz);
+}
+
+}
diff --git a/document/src/vespa/document/util/zstdcompressor.h b/document/src/vespa/document/util/zstdcompressor.h
new file mode 100644
index 00000000000..5c52c144651
--- /dev/null
+++ b/document/src/vespa/document/util/zstdcompressor.h
@@ -0,0 +1,17 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#pragma once
+
+#include "compressor.h"
+
+namespace document {
+
+class ZStdCompressor : public ICompressor
+{
+public:
+ bool process(const CompressionConfig& config, const void * input, size_t inputLen, void * output, size_t & outputLen) override;
+ bool unprocess(const void * input, size_t inputLen, void * output, size_t & outputLen) override;
+ size_t adjustProcessLen(uint16_t options, size_t len) const override;
+};
+
+}
+
diff --git a/jdisc_http_service/docs/class-diagram.graffle b/jdisc_http_service/docs/class-diagram.graffle
deleted file mode 100644
index 938459c6571..00000000000
--- a/jdisc_http_service/docs/class-diagram.graffle
+++ /dev/null
@@ -1,1856 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>ActiveLayerIndex</key>
- <integer>0</integer>
- <key>ApplicationVersion</key>
- <array>
- <string>com.omnigroup.OmniGrafflePro</string>
- <string>139.7.0.167456</string>
- </array>
- <key>AutoAdjust</key>
- <true/>
- <key>BackgroundGraphic</key>
- <dict>
- <key>Bounds</key>
- <string>{{0, 0}, {558.99999713897705, 783}}</string>
- <key>Class</key>
- <string>SolidGraphic</string>
- <key>ID</key>
- <integer>2</integer>
- <key>Style</key>
- <dict>
- <key>shadow</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- </dict>
- </dict>
- <key>BaseZoom</key>
- <integer>0</integer>
- <key>CanvasOrigin</key>
- <string>{0, 0}</string>
- <key>ColumnAlign</key>
- <integer>1</integer>
- <key>ColumnSpacing</key>
- <real>36</real>
- <key>CreationDate</key>
- <string>2012-06-18 12:41:37 +0000</string>
- <key>Creator</key>
- <string>Einar Rosenvinge</string>
- <key>DisplayScale</key>
- <string>1.000 cm = 1.000 cm</string>
- <key>GraphDocumentVersion</key>
- <integer>8</integer>
- <key>GraphicsList</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{404.66666889190674, 39.999999999999936}, {151.17318725585938, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>ID</key>
- <integer>114</integer>
- <key>Magnets</key>
- <array>
- <string>{0, 1}</string>
- <string>{0, -1}</string>
- <string>{1, 0}</string>
- <string>{-1, 0}</string>
- </array>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>1</string>
- <key>r</key>
- <string>0</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 J2SE API}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>TableGroup</string>
- <key>Graphics</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{404.66666889190674, 18.66666666666665}, {151.17318725585938, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>109</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>1</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 Netty API}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- </array>
- <key>ID</key>
- <integer>108</integer>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{404.66666666666731, 7.9472862957175039e-08}, {151.17318725585938, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>ID</key>
- <integer>107</integer>
- <key>Magnets</key>
- <array>
- <string>{0, 1}</string>
- <string>{0, -1}</string>
- <string>{1, 0}</string>
- <string>{-1, 0}</string>
- </array>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>1</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>0</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 jDISC core API}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{328.46341597965198, 296.25884156306495}, {29.333332061767578, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>106</integer>
- <key>Line</key>
- <dict>
- <key>ID</key>
- <integer>105</integer>
- <key>Offset</key>
- <real>6.6666665077209473</real>
- <key>Position</key>
- <real>0.91559326648712158</real>
- <key>RotationType</key>
- <integer>0</integer>
- </dict>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 1}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>52</integer>
- </dict>
- <key>ID</key>
- <integer>105</integer>
- <key>Points</key>
- <array>
- <string>{225.55682373046864, 284.810302734375}</string>
- <string>{352.43905966196957, 312.07829430296113}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>StickArrow</string>
- <key>Legacy</key>
- <true/>
- <key>LineType</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>104</integer>
- </dict>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{101.99999999999997, 277.810302734375}, {123.55682373046864, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>ID</key>
- <integer>104</integer>
- <key>Magnets</key>
- <array>
- <string>{0, 1}</string>
- <string>{0, -1}</string>
- <string>{1, 0}</string>
- <string>{-1, 0}</string>
- </array>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>1</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 ChannelPipeline}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{166.25436339285309, 474.88842165638926}, {29.333332061767578, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>103</integer>
- <key>Line</key>
- <dict>
- <key>ID</key>
- <integer>102</integer>
- <key>Offset</key>
- <real>6.6666665077209473</real>
- <key>Position</key>
- <real>0.78203368186950684</real>
- <key>RotationType</key>
- <integer>0</integer>
- </dict>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 1}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>89</integer>
- </dict>
- <key>ID</key>
- <integer>102</integer>
- <key>Points</key>
- <array>
- <string>{291.52424638132226, 513.75253787937902}</string>
- <string>{148.21246360738095, 481.32189037141075}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>StickArrow</string>
- <key>Legacy</key>
- <true/>
- <key>LineType</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>58</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>95</integer>
- </dict>
- <key>ID</key>
- <integer>96</integer>
- <key>Points</key>
- <array>
- <string>{116.77841269969511, 466.71157835576878}</string>
- <string>{116.77840998702608, 420.16666668003933}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>Arrow</string>
- <key>Legacy</key>
- <true/>
- <key>LineType</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>89</integer>
- </dict>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{58.945077896118171, 405.66666666666708}, {115.66666412353516, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>ID</key>
- <integer>95</integer>
- <key>Magnets</key>
- <array>
- <string>{0, 1}</string>
- <string>{0, -1}</string>
- <string>{1, 0}</string>
- <string>{-1, 0}</string>
- </array>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>1</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>0</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 Request}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>TableGroup</string>
- <key>Graphics</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{68.3333333333334, 467.21157836914102}, {96.890159606933594, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>89</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 HttpRequest}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- </array>
- <key>ID</key>
- <integer>88</integer>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>86</integer>
- </dict>
- <key>ID</key>
- <integer>87</integer>
- <key>Points</key>
- <array>
- <string>{350.25724339020428, 513.73666184812191}</string>
- <string>{432.54926154576208, 492.26520134230651}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>Arrow</string>
- <key>Legacy</key>
- <true/>
- <key>Pattern</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>58</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>TableGroup</string>
- <key>Graphics</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{429.24670918782579, 464.13918876647955}, {115.08661651611328, 28}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>86</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>1</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>0</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 &lt;&lt;interface&gt;&gt;\
-ResponseHandler}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- </array>
- <key>ID</key>
- <integer>85</integer>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>80</integer>
- </dict>
- <key>ID</key>
- <integer>81</integer>
- <key>Points</key>
- <array>
- <string>{388.98464357649044, 311.73041212162735}</string>
- <string>{421.12154403577119, 242.99627753494852}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>Arrow</string>
- <key>Legacy</key>
- <true/>
- <key>LineType</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>52</integer>
- </dict>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{298.33331664403278, 228.54334004720087}, {246, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>ID</key>
- <integer>80</integer>
- <key>Magnets</key>
- <array>
- <string>{0, 1}</string>
- <string>{0, -1}</string>
- <string>{1, 0}</string>
- <string>{-1, 0}</string>
- </array>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>1</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 IdleStateAwareChannelUpstreamHandler}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>10</integer>
- </dict>
- <key>ID</key>
- <integer>27</integer>
- <key>Points</key>
- <array>
- <string>{129.27841644847507, 130.04334003445351}</string>
- <string>{129.27841313680011, 80.666667938232422}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>Arrow</string>
- <key>Legacy</key>
- <true/>
- <key>LineType</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>69</integer>
- </dict>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{71.445081075032547, 66.666667938232422}, {115.66666412353516, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>ID</key>
- <integer>10</integer>
- <key>Magnets</key>
- <array>
- <string>{0, 1}</string>
- <string>{0, -1}</string>
- <string>{1, 0}</string>
- <string>{-1, 0}</string>
- </array>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>1</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>0</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 AbstractResource}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>78</integer>
- </dict>
- <key>ID</key>
- <integer>79</integer>
- <key>Points</key>
- <array>
- <string>{185.26276724928567, 130.48075966792658}</string>
- <string>{297.8372493866778, 116.27917789513803}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>Arrow</string>
- <key>Legacy</key>
- <true/>
- <key>Pattern</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>69</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>TableGroup</string>
- <key>Graphics</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{298.3333059188999, 92.666666666666913}, {151.17318725585938, 28}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>78</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>1</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 &lt;&lt;interface&gt;&gt;\
-ChannelPipelineFactory}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- </array>
- <key>ID</key>
- <integer>77</integer>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>75</integer>
- </dict>
- <key>ID</key>
- <integer>76</integer>
- <key>Points</key>
- <array>
- <string>{402.97819417613408, 311.99312587103537}</string>
- <string>{465.1473485992222, 286.41782928501391}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>Arrow</string>
- <key>Legacy</key>
- <true/>
- <key>Pattern</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>52</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>TableGroup</string>
- <key>Graphics</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{454.91339111328136, 258.22751967112259}, {89.419929504394531, 28}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>75</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>1</string>
- <key>r</key>
- <string>0</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 &lt;&lt;interface&gt;&gt;\
-Runnable}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- </array>
- <key>ID</key>
- <integer>74</integer>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>34</integer>
- </dict>
- <key>ID</key>
- <integer>9</integer>
- <key>Points</key>
- <array>
- <string>{143.15706944536032, 130.31230832708621}</string>
- <string>{250.79491585172687, 74.231022194055214}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>Arrow</string>
- <key>Legacy</key>
- <true/>
- <key>Pattern</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>69</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>TableGroup</string>
- <key>Graphics</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{226.66667683919275, 45.999999999999929}, {102.88706970214844, 28}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>34</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>1</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>0</string>
- </dict>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 &lt;&lt;interface&gt;&gt;\
-ServerProvider}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- </array>
- <key>ID</key>
- <integer>33</integer>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{344.6666666666668, 438.85001627604163}, {17, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>YES</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>63</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 1}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>Wrap</key>
- <string>NO</string>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{308.27841186523432, 496.00000000000023}, {29.333332061767578, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>62</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 1..*}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>58</integer>
- </dict>
- <key>ID</key>
- <integer>61</integer>
- <key>Points</key>
- <array>
- <string>{364.20702685721608, 438.63027009978003}</string>
- <string>{326.6915789284576, 513.41623846111793}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>0</string>
- <key>Legacy</key>
- <true/>
- <key>LineType</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>54</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>TableGroup</string>
- <key>Graphics</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{226.66666603088379, 513.86289469401004}, {192.55682373046875, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>58</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 RequestContext}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{226.66666603088379, 527.86289469401004}, {192.55682373046875, 42}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>59</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 HttpRequest request\
-ContentChannel requestContent\
-ContentChannel responseContent}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{226.66666603088379, 569.86289469401004}, {192.55682373046875, 28}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>60</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 connect()\
-handleResponse(Response)}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- </array>
- <key>GridH</key>
- <array>
- <integer>58</integer>
- <integer>59</integer>
- <integer>60</integer>
- <array/>
- </array>
- <key>ID</key>
- <integer>57</integer>
- </dict>
- <dict>
- <key>Class</key>
- <string>TableGroup</string>
- <key>Graphics</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{226.66666666666663, 312.183349609375}, {317.66665649414062, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>52</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 ChannelContext}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{226.66666666666652, 326.183349609375}, {317.66665649414062, 28}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>53</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 LinkedBlockingQueue&lt;ResponsePart&gt; responseOutputs\
-Channel serverChannel}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{226.66666666666663, 354.183349609375}, {317.66665649414062, 84}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>54</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 channelConnected()\
-messageReceived()\
-exceptionCaught()\
-channelDisconnected()\
-channelIdle()\
-run()}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- </array>
- <key>GridH</key>
- <array>
- <integer>52</integer>
- <integer>53</integer>
- <integer>54</integer>
- <array/>
- </array>
- <key>ID</key>
- <integer>51</integer>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{158.97158196265923, 262.43389980796718}, {29.333332061767578, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>47</integer>
- <key>Line</key>
- <dict>
- <key>ID</key>
- <integer>16</integer>
- <key>Offset</key>
- <real>12.666667938232422</real>
- <key>Position</key>
- <real>0.93361091613769531</real>
- <key>RotationType</key>
- <integer>0</integer>
- </dict>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 0..*}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>104</integer>
- </dict>
- <key>ID</key>
- <integer>16</integer>
- <key>Points</key>
- <array>
- <string>{144.7864237041758, 242.98231480726633}</string>
- <string>{163.77841186523429, 277.810302734375}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>StickArrow</string>
- <key>Legacy</key>
- <true/>
- <key>LineType</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>71</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>TableGroup</string>
- <key>Graphics</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{33.000005086262888, 130.54334004720062}, {192.55682373046875, 14}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>69</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
-
-\f0\b\fs24 \cf0 HttpServer}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{33.000005086262888, 144.54334004720062}, {192.55682373046875, 42}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>70</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 Channel serverChannel\
-Executor channelWorkerExecutor\
-HttpServerConfig config}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{33.000005086262888, 186.54334004720062}, {192.55682373046875, 56}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FitText</key>
- <string>Vertical</string>
- <key>Flow</key>
- <string>Resize</string>
- <key>ID</key>
- <integer>71</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>GradientCenter</key>
- <string>{-0.29411799999999999, -0.264706}</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Align</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
-
-\f0\fs24 \cf0 start()\
-close()\
-destroy()\
-getPipeline()}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- </dict>
- </array>
- <key>GridH</key>
- <array>
- <integer>69</integer>
- <integer>70</integer>
- <integer>71</integer>
- <array/>
- </array>
- <key>ID</key>
- <integer>68</integer>
- </dict>
- </array>
- <key>GridInfo</key>
- <dict/>
- <key>GuidesLocked</key>
- <string>NO</string>
- <key>GuidesVisible</key>
- <string>YES</string>
- <key>HPages</key>
- <integer>1</integer>
- <key>ImageCounter</key>
- <integer>1</integer>
- <key>KeepToScale</key>
- <false/>
- <key>Layers</key>
- <array>
- <dict>
- <key>Lock</key>
- <string>NO</string>
- <key>Name</key>
- <string>Layer 1</string>
- <key>Print</key>
- <string>YES</string>
- <key>View</key>
- <string>YES</string>
- </dict>
- </array>
- <key>LayoutInfo</key>
- <dict>
- <key>Animate</key>
- <string>NO</string>
- <key>circoMinDist</key>
- <real>18</real>
- <key>circoSeparation</key>
- <real>0.0</real>
- <key>layoutEngine</key>
- <string>dot</string>
- <key>neatoSeparation</key>
- <real>0.0</real>
- <key>twopiSeparation</key>
- <real>0.0</real>
- </dict>
- <key>LinksVisible</key>
- <string>NO</string>
- <key>MagnetsVisible</key>
- <string>NO</string>
- <key>MasterSheets</key>
- <array/>
- <key>ModificationDate</key>
- <string>2012-06-19 09:20:43 +0000</string>
- <key>Modifier</key>
- <string>Einar Rosenvinge</string>
- <key>NotesVisible</key>
- <string>NO</string>
- <key>Orientation</key>
- <integer>2</integer>
- <key>OriginVisible</key>
- <string>NO</string>
- <key>PageBreaks</key>
- <string>YES</string>
- <key>PrintInfo</key>
- <dict>
- <key>NSBottomMargin</key>
- <array>
- <string>float</string>
- <string>41</string>
- </array>
- <key>NSHorizonalPagination</key>
- <array>
- <string>coded</string>
- <string>BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG</string>
- </array>
- <key>NSLeftMargin</key>
- <array>
- <string>float</string>
- <string>18</string>
- </array>
- <key>NSPaperSize</key>
- <array>
- <string>size</string>
- <string>{594.99999713897705, 842}</string>
- </array>
- <key>NSPrintReverseOrientation</key>
- <array>
- <string>int</string>
- <string>0</string>
- </array>
- <key>NSRightMargin</key>
- <array>
- <string>float</string>
- <string>18</string>
- </array>
- <key>NSTopMargin</key>
- <array>
- <string>float</string>
- <string>18</string>
- </array>
- </dict>
- <key>PrintOnePage</key>
- <false/>
- <key>ReadOnly</key>
- <string>NO</string>
- <key>RowAlign</key>
- <integer>1</integer>
- <key>RowSpacing</key>
- <real>36</real>
- <key>SheetTitle</key>
- <string>Canvas 1</string>
- <key>SmartAlignmentGuidesActive</key>
- <string>YES</string>
- <key>SmartDistanceGuidesActive</key>
- <string>YES</string>
- <key>UniqueID</key>
- <integer>1</integer>
- <key>UseEntirePage</key>
- <false/>
- <key>VPages</key>
- <integer>1</integer>
- <key>WindowInfo</key>
- <dict>
- <key>CurrentSheet</key>
- <integer>0</integer>
- <key>ExpandedCanvases</key>
- <array>
- <dict>
- <key>name</key>
- <string>Canvas 1</string>
- </dict>
- </array>
- <key>Frame</key>
- <string>{{246, 375}, {1064, 803}}</string>
- <key>ListView</key>
- <true/>
- <key>OutlineWidth</key>
- <integer>142</integer>
- <key>RightSidebar</key>
- <false/>
- <key>ShowRuler</key>
- <true/>
- <key>Sidebar</key>
- <true/>
- <key>SidebarWidth</key>
- <integer>120</integer>
- <key>VisibleRegion</key>
- <string>{{-25, 0}, {610, 442.66666666666669}}</string>
- <key>Zoom</key>
- <real>1.5</real>
- <key>ZoomValues</key>
- <array>
- <array>
- <string>Canvas 1</string>
- <real>1.5</real>
- <real>0.25</real>
- </array>
- </array>
- </dict>
-</dict>
-</plist>
diff --git a/jdisc_http_service/docs/class-diagram.png b/jdisc_http_service/docs/class-diagram.png
deleted file mode 100644
index ebccfd75bf9..00000000000
--- a/jdisc_http_service/docs/class-diagram.png
+++ /dev/null
Binary files differ
diff --git a/jdisc_http_service/docs/httpserver.html b/jdisc_http_service/docs/httpserver.html
deleted file mode 100644
index 128174b4cfb..00000000000
--- a/jdisc_http_service/docs/httpserver.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <title>HTTP Server Architecture</title>
- <style type="text/css">
- body {
- font: 13px/1.231 arial,helvetica,clean,sans-serif;
- *font-size: small;
- *font: x-small;
- }
- select,input,button,textarea {
- font: 99% arial,helvetica,clean,sans-serif;
- }
- table{
- font-size: inherit;
- font: 100%;
- }
- pre,code,kbd,samp,tt {
- font-family: monospace;
- *font-size: 108%;
- line-height: 100%;
- }
- </style>
-</head>
-<body>
-<p>The HTTP server is started by calling <code>HttpServer.start()</code>, which in turn calls <code>ServerBootstrap.bind()</code>
- provided by
- Netty.</p>
-
-<img src="class-diagram.png" alt="Class diagram">
-
-<p>Since our HttpServer implements <code>ChannelPipelineFactory</code> (provided by jetty), its
- <code>getPipeline()</code> method is called for every new channel that is connected. There is hence a one-to-many
- relationship between a <code>HttpServer</code> and a pipeline (and a one-to-one relationship between an actual
- channel and a pipeline).</p>
-
-<p>The pipeline is responsible for decoding (and possibly deflating etc.) every new request that is received on a
- channel. The final element in the pipeline is a <code>ChannelContext</code>, which is the jDISC class for handling
- requests on a channel.</p>
-
-<p>The <code>ChannelContext</code> implements <code>SimpleChannelUpstreamHandler</code> (provided by Jetty), which has
- simple callback methods for various event types. <br/>Examples:</p>
-
-<ul>
- <li><code>channelConnected()</code></li>
- <li><code>channelDisconnected()</code></li>
- <li><code>messageReceived()</code></li>
-</ul>
-
-<p>Since <code>ChannelContext</code> supports HTTP keep-alive and HTTP pipelining, it needs to keep track of multiple
- requests made on the channel, and their order.</p>
-
-<p>In <code>messageReceived()</code> it will:</p>
-<ul>
- <li>Determine if the element received is a new HTTP request, or a chunk belonging to the previous one.</li>
- <li>If it's a request, create a DISC <code>Request</code> object for it, and call <code>Request.connect()</code>,
- which will in turn give it to the actual application, through the use of
- <code>RequestHandler.handleRequest()</code>.
- </li>
- <li>If it's a chunk, fetch the previously added <code>RequestContext</code>, and use it to write the data received
- into the <code>ContentChannel</code>.
- </li>
-</ul>
-
-<p><code>RequestContext</code> keeps track of a request and its input and output <code>ContentChannel</code>s, and
- related objects. Since <code>RequestContext</code> is a <code>ResponseHandler</code>, it is responsible for
- instantiating and returning a <code>ContentChannel</code> when an application calls <code>handleResponse()</code>.
- Two types are supported, one that supports HTTP response chunking, and one that does not. The type used is chosen
- automatically based on HTTP version, headers etc.</p>
-
-<p>Since the jDISC API is fully asynchronous, operations can occur in any order. This is very extensively tested in the
- HTTP server implementation. For instance, an application (<code>RequestHandler</code>) may choose to respond and
- close the output <code>ContentChannel</code> immediately upon receiving the request, before the body of the request
- has been written into the input <code>ContentChannel</code> of the <code>RequestHandler</code>. All such cases are
- tested and properly handled.</p>
-
-<p>As one can see from the illustration, <code>ChannelContext</code> is also a <code>Runnable</code>, i.e. it keeps one
- thread per channel. The HTTP server has two modes of operation, <code>optimizeForPipeline</code> <code>true</code>
- or <code>false</code> in <code>HttpServerConfig</code>.</p>
-
-<p>If <code>optimizeForPipeline</code> is set to <code>true</code>, response chunks are enqueued on a blocking queue in
- <code>ChannelContext</code> when <code>ContentChannel.write()</code> is called. The <code>ChannelContext</code>
- thread is responsible for actually writing them, and closing the channel when appropriate. Since the HTTP server
- supports pipelining, and writes from an application may occur in any order, special care is taken to write response
- chunks in the correct order.</p>
-
-<p>If <code>optimizeForPipeline</code> is set to <code>false</code>, a call to <code>ContentChannel.write()</code> will
- lead to an actual write on the wire, iff. the given chunk to be written is the next in line. Otherwise this is a
- no-op. This also means that a <code>ContentChannel.write()</code> may lead to a cascade of writes that have been
- enqueued since they were out-of-order when their <code>write()</code> was called. The <code>ChannelContext</code>
- thread still takes care of channel closing in most cases.</p>
-</body>
-</html>
diff --git a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
index 69af759db40..3262d571c56 100644
--- a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
+++ b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
@@ -381,7 +381,7 @@ verifyReply(size_t count, document::CompressionConfig::Type encoding, size_t org
DataBuffer uncompressed;
ConstBufferRef blob(ret[2]._data._buf, ret[2]._data._len);
- document::decompress(CompressionConfig::toType(ret[0]._intval8), ret[1]._intval32, blob, uncompressed, false);
+ compression::decompress(CompressionConfig::toType(ret[0]._intval8), ret[1]._intval32, blob, uncompressed, false);
EXPECT_EQUAL(orgSize, uncompressed.getDataLen());
vespalib::Slime summaries;
@@ -402,7 +402,7 @@ verifyRPC(size_t count,
CompressionConfig config(requestCompression, 9, 100);
DataBuffer compressed(const_cast<char *>(buf.get().data), buf.get().size);
- CompressionConfig::Type type = document::compress(config, ConstBufferRef(buf.get().data, buf.get().size), compressed, true);
+ CompressionConfig::Type type = compression::compress(config, ConstBufferRef(buf.get().data, buf.get().size), compressed, true);
EXPECT_EQUAL(type, requestCompression);
FRT_RPCRequest * request = new FRT_RPCRequest();
diff --git a/searchcore/src/vespa/searchcore/config/proton.def b/searchcore/src/vespa/searchcore/config/proton.def
index 58ff711aa60..deb091b42da 100644
--- a/searchcore/src/vespa/searchcore/config/proton.def
+++ b/searchcore/src/vespa/searchcore/config/proton.def
@@ -210,21 +210,21 @@ summary.cache.allowvisitcaching bool default=false restart
summary.cache.initialentries long default=0 restart
## Control compression type of the summary while in the cache.
-summary.cache.compression.type enum {NONE, LZ4} default=LZ4 restart
+summary.cache.compression.type enum {NONE, LZ4, ZSTD} default=LZ4 restart
## Control compression level of the summary while in cache.
summary.cache.compression.level int default=9 restart
## Control compression type of the summary while in memory during compaction
## NB So far only stragey=LOG honours it.
-summary.log.compact.compression.type enum {NONE, LZ4} default=LZ4 restart
+summary.log.compact.compression.type enum {NONE, LZ4, ZSTD} default=LZ4 restart
## Control compression level of the summary while in memory during compaction
summary.log.compact.compression.level int default=9 restart
## Control compression type of the summary
## NB So far only stragey=LOG honours it.
-summary.log.chunk.compression.type enum {NONE, LZ4} default=LZ4 restart
+summary.log.chunk.compression.type enum {NONE, LZ4, ZSTD} default=LZ4 restart
## Control compression level of the summary
summary.log.chunk.compression.level int default=9 restart
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp
index 343c051cb5c..014e861f4fa 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp
@@ -117,6 +117,8 @@ deriveCompression(const T & config) {
document::CompressionConfig compression;
if (config.type == T::LZ4) {
compression.type = document::CompressionConfig::LZ4;
+ } else if (config.type == T::ZSTD) {
+ compression.type = document::CompressionConfig::ZSTD;
}
compression.compressionLevel = config.level;
return compression;
@@ -160,6 +162,8 @@ SummaryManager::SummaryManager(vespalib::ThreadExecutor & executor,
summary.compact2buckets ? bucketizer : search::IBucketizer::SP()));
}
+SummaryManager::~SummaryManager() {}
+
void
SummaryManager::putDocument(uint64_t syncToken, const Document & doc, search::DocumentIdT lid)
{
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h
index 3c2b6a204e7..bb5f4354845 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h
@@ -82,6 +82,7 @@ public:
const search::common::FileHeaderContext &fileHeaderContext,
search::transactionlog::SyncProxy &tlSyncer,
const std::shared_ptr<search::IBucketizer> & bucketizer);
+ ~SummaryManager();
void putDocument(uint64_t syncToken, const document::Document & doc,
search::DocumentIdT lid);
diff --git a/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp b/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp
index cc10a3aab43..8dcd1381b20 100644
--- a/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp
+++ b/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp
@@ -4,9 +4,9 @@
#include <vespa/searchlib/util/slime_output_raw_buf_adapter.h>
#include <vespa/searchlib/common/packets.h>
#include <vespa/fnet/frt/rpcrequest.h>
+#include <vespa/vespalib/data/databuffer.h>
#include <vespa/log/log.h>
-
LOG_SETUP(".proton.summaryengine.docsum_by_slime");
namespace proton {
@@ -90,12 +90,14 @@ DocsumByRPC::DocsumByRPC(DocsumBySlime & slimeDocsumServer) :
void
DocsumByRPC::getDocsums(FRT_RPCRequest & req)
{
+ using document::compression::decompress;
+ using document::compression::compress;
FRT_Values &arg = *req.GetParams();
uint8_t encoding = arg[0]._intval8;
uint32_t uncompressedSize = arg[1]._intval32;
DataBuffer uncompressed(arg[2]._data._buf, arg[2]._data._len);
ConstBufferRef blob(arg[2]._data._buf, arg[2]._data._len);
- document::decompress(CompressionConfig::toType(encoding), uncompressedSize, blob, uncompressed, true);
+ decompress(CompressionConfig::toType(encoding), uncompressedSize, blob, uncompressed, true);
assert(uncompressedSize == uncompressed.getDataLen());
vespalib::Slime summariesToGet;
BinaryFormat::decode(Memory(uncompressed.getData(), uncompressed.getDataLen()), summariesToGet);
@@ -108,7 +110,7 @@ DocsumByRPC::getDocsums(FRT_RPCRequest & req)
BinaryFormat::encode(*summaries, output);
ConstBufferRef buf(rbuf.GetDrainPos(), rbuf.GetUsedLen());
DataBuffer compressed(rbuf.GetWritableDrainPos(0), rbuf.GetUsedLen());
- CompressionConfig::Type type = document::compress(getCompressionConfig(), buf, compressed, true);
+ CompressionConfig::Type type = compress(getCompressionConfig(), buf, compressed, true);
FRT_Values &ret = *req.GetReturn();
ret.AddInt8(type);
diff --git a/searchlib/src/tests/docstore/chunk/chunk_test.cpp b/searchlib/src/tests/docstore/chunk/chunk_test.cpp
index 7411fc668f8..4687f45acde 100644
--- a/searchlib/src/tests/docstore/chunk/chunk_test.cpp
+++ b/searchlib/src/tests/docstore/chunk/chunk_test.cpp
@@ -68,4 +68,34 @@ TEST("require that Chunk formats does not change between releases")
testChunkFormat(v2, 34, "34 015BA32DE7000000220000000010ABCDEF987654321000000000000000074D000694");
}
+constexpr const char * MY_LONG_STRING = "This is medium long string that hopefully will compress to something where lz4, zstandard and none"
+" will make a difference. The intentions is to verify that we trigger all compresssions possible and are able to decompress them too."
+" I guess that we need a considerable length in order to get the rather inefficient lz4 compression triger. ZStandard compression"
+" should trigger a lot earlier";
+
+void verifyChunkCompression(CompressionConfig::Type cfgType, const void * buf, size_t sz, size_t expectedLen) {
+ uint64_t MAGIC_CONTENT(0xabcdef9876543210);
+ ChunkFormatV2 chunk(10);
+ chunk.getBuffer() << MAGIC_CONTENT;
+ chunk.getBuffer().write(buf, sz);
+ vespalib::DataBuffer buffer;
+ CompressionConfig cfg(cfgType);
+ chunk.pack(7, buffer, cfg);
+ EXPECT_EQUAL(expectedLen, buffer.getDataLen());
+ vespalib::nbostream is(buffer.getData(), buffer.getDataLen());
+ ChunkFormat::UP deserialized = ChunkFormat::deserialize(buffer.getData(), buffer.getDataLen(), false);
+ uint64_t magic(0);
+ deserialized->getBuffer() >> magic;
+ EXPECT_EQUAL(MAGIC_CONTENT, magic);
+ std::vector<char> v(sz);
+ deserialized->getBuffer().read(&v[0], sz);
+ EXPECT_EQUAL(0, memcmp(buf, &v[0], sz));
+}
+
+TEST("require that V2 can create and handle lz4, zstd, and none") {
+ verifyChunkCompression(CompressionConfig::NONE, MY_LONG_STRING, strlen(MY_LONG_STRING), 421);
+ verifyChunkCompression(CompressionConfig::LZ4, MY_LONG_STRING, strlen(MY_LONG_STRING), 360);
+ verifyChunkCompression(CompressionConfig::ZSTD, MY_LONG_STRING, strlen(MY_LONG_STRING), 282);
+}
+
TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchlib/src/vespa/searchlib/common/packets.cpp b/searchlib/src/vespa/searchlib/common/packets.cpp
index d705d3a2240..667334bf64e 100644
--- a/searchlib/src/vespa/searchlib/common/packets.cpp
+++ b/searchlib/src/vespa/searchlib/common/packets.cpp
@@ -7,6 +7,7 @@
#include <vespa/document/util/compressor.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/data/slime/slime.h>
+#include <vespa/vespalib/data/databuffer.h>
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.common.fs4packets");
@@ -150,7 +151,7 @@ FS4PersistentPacketStreamer::Decode(FNET_DataBuffer *src, uint32_t plen, uint32_
uint32_t uncompressed_size = src->ReadInt32();
ConstBufferRef org(src->GetData(), plen - sizeof(uint32_t));
vespalib::DataBuffer uncompressed(uncompressed_size);
- document::decompress(compressionType, uncompressed_size, org, uncompressed, false);
+ document::compression::decompress(compressionType, uncompressed_size, org, uncompressed, false);
FNET_DataBuffer buf(uncompressed.getData(), uncompressed.getDataLen());
decodePacket(packet, buf, uncompressed_size, pcode);
src->DataToDead(plen - sizeof(uint32_t));
@@ -191,7 +192,7 @@ FS4PersistentPacketStreamer::Encode(FNET_Packet *packet, uint32_t chid, FNET_Dat
CompressionConfig config(_compressionType, _compressionLevel, 90);
ConstBufferRef org(dst->GetData() + packet_start + header_len, body_len);
vespalib::DataBuffer compressed(org.size());
- CompressionConfig::Type r = document::compress(config, org, compressed, false);
+ CompressionConfig::Type r = document::compression::compress(config, org, compressed, false);
if (r != CompressionConfig::NONE) {
dst->DataToFree(body_len + header_len);
// sizeof(data + header + uncompressed_size) - sizeof(uint32_t)
@@ -454,7 +455,7 @@ FS4Packet_PreSerialized::FS4Packet_PreSerialized(FNET_Packet & packet)
90);
ConstBufferRef org(tmp.GetData(), tmp.GetDataLen());
vespalib::DataBuffer compressed(org.size());
- _compressionType = document::compress(config, org, compressed, false);
+ _compressionType = document::compression::compress(config, org, compressed, false);
if (_compressionType != CompressionConfig::NONE) {
_data.WriteInt32Fast(body_len);
_data.WriteBytes(compressed.getData(), compressed.getDataLen());
diff --git a/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp b/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp
index 5aef795b8bd..204c7b07acb 100644
--- a/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp
@@ -8,6 +8,10 @@ namespace search {
using vespalib::make_string;
using vespalib::Exception;
+using document::compression::compress;
+using document::compression::decompress;
+using document::compression::computeMaxCompressedsize;
+using document::CompressionConfig;
ChunkException::ChunkException(const vespalib::stringref & msg, const vespalib::stringref & location) :
Exception(make_string("Illegal chunk: %s", msg.c_str()), location)
@@ -15,7 +19,7 @@ ChunkException::ChunkException(const vespalib::stringref & msg, const vespalib::
}
void
-ChunkFormat::pack(uint64_t lastSerial, vespalib::DataBuffer & compressed, const document::CompressionConfig & compression)
+ChunkFormat::pack(uint64_t lastSerial, vespalib::DataBuffer & compressed, const CompressionConfig & compression)
{
vespalib::nbostream & os = _dataBuf;
os << lastSerial;
@@ -29,7 +33,7 @@ ChunkFormat::pack(uint64_t lastSerial, vespalib::DataBuffer & compressed, const
const size_t oldPos(compressed.getDataLen());
compressed.writeInt8(compression.type);
compressed.writeInt32(os.size());
- document::CompressionConfig::Type type(document::compress(compression, vespalib::ConstBufferRef(os.c_str(), os.size()), compressed, false));
+ CompressionConfig::Type type(compress(compression, vespalib::ConstBufferRef(os.c_str(), os.size()), compressed, false));
if (compression.type != type) {
compressed.getData()[oldPos] = type;
}
@@ -42,28 +46,22 @@ ChunkFormat::pack(uint64_t lastSerial, vespalib::DataBuffer & compressed, const
}
size_t
-ChunkFormat::getMaxPackSize(const document::CompressionConfig & compression) const
+ChunkFormat::getMaxPackSize(const CompressionConfig & compression) const
{
const size_t OVERHEAD(0);
const size_t MINSIZE(1 + 1 + 4 + 4 + includeSerializedSize() ? 4 : 0); // version + type + real length + crc + lastserial
const size_t formatSpecificSize(getHeaderSize());
size_t rawSize(MINSIZE + formatSpecificSize + OVERHEAD);
const size_t payloadSize(_dataBuf.size() + 8);
- // This is a little dirty -> need interface.
- if (compression.type == document::CompressionConfig::LZ4) {
- document::LZ4Compressor lz4;
- rawSize += lz4.adjustProcessLen(0, payloadSize);
- } else {
- rawSize += payloadSize;
- }
- return rawSize;
+ return rawSize + computeMaxCompressedsize(compression.type, payloadSize);
}
void
ChunkFormat::verifyCompression(uint8_t type)
{
- if ((type != document::CompressionConfig::LZ4) &&
- (type != document::CompressionConfig::NONE)) {
+ if ((type != CompressionConfig::LZ4) &&
+ (type != CompressionConfig::ZSTD) &&
+ (type != CompressionConfig::NONE)) {
throw ChunkException(make_string("Unknown compressiontype %d", type), VESPA_STRLOC);
}
}
@@ -145,7 +143,7 @@ ChunkFormat::deserializeBody(vespalib::nbostream & is)
// This is a dirty trick to fool some odd sanity checking in DataBuffer::swap
vespalib::DataBuffer uncompressed(const_cast<char *>(is.peek()), (size_t)0);
vespalib::ConstBufferRef data(is.peek(), is.size() - sizeof(uint32_t));
- document::decompress(document::CompressionConfig::Type(type), uncompressedLen, data, uncompressed, true);
+ decompress(CompressionConfig::Type(type), uncompressedLen, data, uncompressed, true);
assert(uncompressed.getData() == uncompressed.getDead());
if (uncompressed.getData() != data.c_str()) {
const size_t sz(uncompressed.getDataLen());
diff --git a/searchlib/src/vespa/searchlib/docstore/documentstore.cpp b/searchlib/src/vespa/searchlib/docstore/documentstore.cpp
index 744eb07c5f5..d154250d6a1 100644
--- a/searchlib/src/vespa/searchlib/docstore/documentstore.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/documentstore.cpp
@@ -8,6 +8,11 @@
#include <vespa/vespalib/data/databuffer.h>
#include <vespa/document/util/compressor.h>
+using document::DocumentTypeRepo;
+using document::CompressionConfig;
+using document::compression::compress;
+using document::compression::decompress;
+
namespace search {
namespace {
@@ -15,13 +20,13 @@ namespace {
class DocumentVisitorAdapter : public IBufferVisitor
{
public:
- DocumentVisitorAdapter(const document::DocumentTypeRepo & repo, IDocumentVisitor & visitor) :
+ DocumentVisitorAdapter(const DocumentTypeRepo & repo, IDocumentVisitor & visitor) :
_repo(repo),
_visitor(visitor)
{ }
void visit(uint32_t lid, vespalib::ConstBufferRef buf) override;
private:
- const document::DocumentTypeRepo & _repo;
+ const DocumentTypeRepo & _repo;
IDocumentVisitor & _visitor;
};
@@ -45,7 +50,7 @@ public:
using Alloc = vespalib::alloc::Alloc;
typedef std::unique_ptr<Value> UP;
- Value() : _compressedSize(0), _uncompressedSize(0), _compression(document::CompressionConfig::NONE) {}
+ Value() : _compressedSize(0), _uncompressedSize(0), _compression(CompressionConfig::NONE) {}
Value(Value &&rhs) :
_compressedSize(rhs._compressedSize),
@@ -69,12 +74,12 @@ public:
return *this;
}
- void setCompression(document::CompressionConfig::Type comp, size_t uncompressedSize) {
+ void setCompression(CompressionConfig::Type comp, size_t uncompressedSize) {
_compression = comp;
_uncompressedSize = uncompressedSize;
}
- document::CompressionConfig::Type getCompression() const { return _compression; }
+ CompressionConfig::Type getCompression() const { return _compression; }
size_t getUncompressedSize() const { return _uncompressedSize; }
@@ -82,13 +87,13 @@ public:
* Compress buffer into temporary buffer and copy temporary buffer to
* value along with compression config.
*/
- void set(vespalib::DataBuffer &&buf, ssize_t len, const document::CompressionConfig &compression);
+ void set(vespalib::DataBuffer &&buf, ssize_t len, const CompressionConfig &compression);
/**
* Decompress value into temporary buffer and deserialize document from
* the temporary buffer.
*/
- document::Document::UP deserializeDocument(const document::DocumentTypeRepo &repo);
+ document::Document::UP deserializeDocument(const DocumentTypeRepo &repo);
size_t size() const { return _compressedSize; }
bool empty() const { return size() == 0; }
@@ -98,36 +103,32 @@ public:
private:
size_t _compressedSize;
size_t _uncompressedSize;
- document::CompressionConfig::Type _compression;
+ CompressionConfig::Type _compression;
Alloc _buf;
};
class BackingStore {
public:
- BackingStore(IDataStore &store, const document::CompressionConfig &compression) :
+ BackingStore(IDataStore &store, const CompressionConfig &compression) :
_backingStore(store),
_compression(compression) { }
bool read(DocumentIdT key, Value &value) const;
- void visit(const IDocumentStore::LidVector &lids, const document::DocumentTypeRepo &repo, IDocumentVisitor &visitor) const;
+ void visit(const IDocumentStore::LidVector &lids, const DocumentTypeRepo &repo, IDocumentVisitor &visitor) const;
void write(DocumentIdT, const Value &) {}
void erase(DocumentIdT) {}
- const document::CompressionConfig &getCompression(void) const { return _compression; }
+ const CompressionConfig &getCompression(void) const { return _compression; }
private:
IDataStore &_backingStore;
- const document::CompressionConfig _compression;
+ const CompressionConfig _compression;
};
void
-Value::set(vespalib::DataBuffer &&buf,
- ssize_t len,
- const document::CompressionConfig &compression) {
+Value::set(vespalib::DataBuffer &&buf, ssize_t len, const CompressionConfig &compression) {
//Underlying buffer must be identical to allow swap.
vespalib::DataBuffer compressed(buf.getData(), 0u);
- document::CompressionConfig::Type type =
- document::compress(compression,
- vespalib::ConstBufferRef(buf.getData(), len),
- compressed, true);
+ CompressionConfig::Type type = compress(compression, vespalib::ConstBufferRef(buf.getData(), len),
+ compressed, true);
_compressedSize = compressed.getDataLen();
if (buf.getData() == compressed.getData()) {
// Uncompressed so we can just steal the underlying buffer.
@@ -135,28 +136,25 @@ Value::set(vespalib::DataBuffer &&buf,
} else {
compressed.stealBuffer().swap(_buf);
}
- assert(((type == document::CompressionConfig::NONE) &&
+ assert(((type == CompressionConfig::NONE) &&
(len == ssize_t(_compressedSize))) ||
- ((type != document::CompressionConfig::NONE) &&
+ ((type != CompressionConfig::NONE) &&
(len > ssize_t(_compressedSize))));
setCompression(type, len);
}
document::Document::UP
-Value::deserializeDocument(const document::DocumentTypeRepo &repo) {
+Value::deserializeDocument(const DocumentTypeRepo &repo) {
vespalib::DataBuffer uncompressed((char *) _buf.get(), (size_t) 0);
- document::decompress(getCompression(),
- getUncompressedSize(),
- vespalib::ConstBufferRef(*this, size()),
- uncompressed, true);
+ decompress(getCompression(), getUncompressedSize(), vespalib::ConstBufferRef(*this, size()), uncompressed, true);
vespalib::nbostream is(uncompressed.getData(), uncompressed.getDataLen());
return document::Document::UP(new document::Document(repo, is));
}
void
-BackingStore::visit(const IDocumentStore::LidVector &lids, const document::DocumentTypeRepo &repo,
+BackingStore::visit(const IDocumentStore::LidVector &lids, const DocumentTypeRepo &repo,
IDocumentVisitor &visitor) const {
DocumentVisitorAdapter adapter(repo, visitor);
_backingStore.read(lids, adapter);
@@ -213,7 +211,7 @@ DocumentStore::useCache() const {
}
void
-DocumentStore::visit(const LidVector & lids, const document::DocumentTypeRepo &repo, IDocumentVisitor & visitor) const
+DocumentStore::visit(const LidVector & lids, const DocumentTypeRepo &repo, IDocumentVisitor & visitor) const
{
if (useCache() && _config.allowVisitCaching() && visitor.allowVisitCaching()) {
docstore::BlobSet blobSet = _visitCache->read(lids).getBlobSet();
@@ -227,7 +225,7 @@ DocumentStore::visit(const LidVector & lids, const document::DocumentTypeRepo &r
}
document::Document::UP
-DocumentStore::read(DocumentIdT lid, const document::DocumentTypeRepo &repo) const
+DocumentStore::read(DocumentIdT lid, const DocumentTypeRepo &repo) const
{
document::Document::UP retval;
Value value;
@@ -305,25 +303,23 @@ DocumentStore::getLastFlushTime() const
template <class Visitor>
class DocumentStore::WrapVisitor : public IDataStoreVisitor
{
- Visitor &_visitor;
- const document::DocumentTypeRepo &_repo;
- const document::CompressionConfig &_compression;
- IDocumentStore &_ds;
- uint64_t _syncToken;
+ Visitor &_visitor;
+ const DocumentTypeRepo &_repo;
+ const CompressionConfig &_compression;
+ IDocumentStore &_ds;
+ uint64_t _syncToken;
public:
void visit(uint32_t lid, const void *buffer, size_t sz) override;
WrapVisitor(Visitor &visitor,
- const document::DocumentTypeRepo &repo,
- const document::CompressionConfig &compresion,
+ const DocumentTypeRepo &repo,
+ const CompressionConfig &compresion,
IDocumentStore &ds,
uint64_t syncToken);
inline void rewrite(uint32_t lid, const document::Document &doc);
-
inline void rewrite(uint32_t lid);
-
inline void visitRemove(uint32_t lid);
};
@@ -429,8 +425,8 @@ DocumentStore::WrapVisitor<Visitor>::visit(uint32_t lid,
template <class Visitor>
DocumentStore::WrapVisitor<Visitor>::
WrapVisitor(Visitor &visitor,
- const document::DocumentTypeRepo &repo,
- const document::CompressionConfig &compression,
+ const DocumentTypeRepo &repo,
+ const CompressionConfig &compression,
IDocumentStore &ds,
uint64_t syncToken)
: _visitor(visitor),
@@ -445,7 +441,7 @@ WrapVisitor(Visitor &visitor,
void
DocumentStore::accept(IDocumentStoreReadVisitor &visitor,
IDocumentStoreVisitorProgress &visitorProgress,
- const document::DocumentTypeRepo &repo)
+ const DocumentTypeRepo &repo)
{
WrapVisitor<IDocumentStoreReadVisitor> wrap(visitor, repo,
_store->getCompression(),
@@ -460,7 +456,7 @@ DocumentStore::accept(IDocumentStoreReadVisitor &visitor,
void
DocumentStore::accept(IDocumentStoreRewriteVisitor &visitor,
IDocumentStoreVisitorProgress &visitorProgress,
- const document::DocumentTypeRepo &repo)
+ const DocumentTypeRepo &repo)
{
WrapVisitor<IDocumentStoreRewriteVisitor> wrap(visitor,
repo,
diff --git a/searchlib/src/vespa/searchlib/docstore/visitcache.cpp b/searchlib/src/vespa/searchlib/docstore/visitcache.cpp
index e78ef81d127..c68aa00994f 100644
--- a/searchlib/src/vespa/searchlib/docstore/visitcache.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/visitcache.cpp
@@ -90,7 +90,7 @@ CompressedBlobSet::CompressedBlobSet(const document::CompressionConfig &compress
if ( ! _positions.empty() ) {
DataBuffer compressed;
ConstBufferRef org = uncompressed.getBuffer();
- _compression = document::compress(compression, org, compressed, false);
+ _compression = document::compression::compress(compression, org, compressed, false);
_buffer.resize(compressed.getDataLen());
memcpy(_buffer, compressed.getData(), compressed.getDataLen());
}
@@ -99,10 +99,12 @@ CompressedBlobSet::CompressedBlobSet(const document::CompressionConfig &compress
BlobSet
CompressedBlobSet::getBlobSet() const
{
+ using document::compression::decompress;
// These are frequent lage allocations that are to expensive to mmap.
DataBuffer uncompressed(0, 1, Alloc::alloc(0, 16 * MemoryAllocator::HUGEPAGE_SIZE));
if ( ! _positions.empty() ) {
- document::decompress(_compression, getBufferSize(_positions), ConstBufferRef(_buffer.c_str(), _buffer.size()), uncompressed, false);
+ decompress(_compression, getBufferSize(_positions),
+ ConstBufferRef(_buffer.c_str(), _buffer.size()), uncompressed, false);
}
return BlobSet(_positions, uncompressed.stealBuffer());
}
diff --git a/searchlib/src/vespa/searchlib/grouping/sketch.h b/searchlib/src/vespa/searchlib/grouping/sketch.h
index 76d42e71e75..bb7db02d81c 100644
--- a/searchlib/src/vespa/searchlib/grouping/sketch.h
+++ b/searchlib/src/vespa/searchlib/grouping/sketch.h
@@ -209,7 +209,7 @@ compress_buckets_into(char *buffer, uint32_t size) const {
vespalib::ConstBufferRef org(&bucket[0], BUCKET_COUNT);
vespalib::DataBuffer compress_buffer(buffer, size);
document::CompressionConfig::Type r =
- document::compress(config, org, compress_buffer, false);
+ document::compression::compress(config, org, compress_buffer, false);
assert(compress_buffer.getDead() == buffer);
if (r == document::CompressionConfig::LZ4) {
assert(compress_buffer.getDataLen() < BUCKET_COUNT);
@@ -228,7 +228,7 @@ decompress_buckets_from(char *buffer, uint32_t size) {
} else {
vespalib::ConstBufferRef compressed(buffer, size);
vespalib::DataBuffer uncompressed(reinterpret_cast<char *>(&bucket[0]), BUCKET_COUNT);
- document::decompress(document::CompressionConfig::LZ4, BUCKET_COUNT, compressed, uncompressed, false);
+ document::compression::decompress(document::CompressionConfig::LZ4, BUCKET_COUNT, compressed, uncompressed, false);
}
}
template <int BucketBits, typename HashT>
diff --git a/staging_vespalib/src/vespa/vespalib/data/databuffer.h b/staging_vespalib/src/vespa/vespalib/data/databuffer.h
index 5b5b65bc70b..f7707a3ea56 100644
--- a/staging_vespalib/src/vespa/vespalib/data/databuffer.h
+++ b/staging_vespalib/src/vespa/vespalib/data/databuffer.h
@@ -1,10 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <string.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
+#include <cstring>
+#include <cassert>
#include <vespa/vespalib/util/alloc.h>
namespace vespalib {
diff --git a/vespalib/src/vespa/vespalib/util/optimized.h b/vespalib/src/vespa/vespalib/util/optimized.h
index 71c6cb42874..f4fd1376033 100644
--- a/vespalib/src/vespa/vespalib/util/optimized.h
+++ b/vespalib/src/vespa/vespalib/util/optimized.h
@@ -4,7 +4,7 @@
#pragma once
-#include <stdint.h>
+#include <cstdint>
namespace vespalib {
diff --git a/vespalog/src/vespa/log/bufferedlogger.cpp b/vespalog/src/vespa/log/bufferedlogger.cpp
index 6fca39abfbb..106a9bc1dba 100644
--- a/vespalog/src/vespa/log/bufferedlogger.cpp
+++ b/vespalog/src/vespa/log/bufferedlogger.cpp
@@ -10,11 +10,9 @@
#include <boost/multi_index/sequenced_index.hpp>
#include <iomanip>
-#include <iostream>
#include <sstream>
#include <vector>
#include <cstdarg>
-#include <ctime>
namespace ns_log {
@@ -381,5 +379,4 @@ BufferedLogger::setTimer(std::unique_ptr<Timer> timer)
_backing->_timer = std::move(timer);
}
-
} // ns_log