diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-10 20:23:53 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-10 20:25:24 +0100 |
commit | c272d764d842f04d864bcca5b57468ec7e8aad92 (patch) | |
tree | 5626b49fc39c09c479bd4867eaa1994e7b2bc194 /config-model | |
parent | 566108512ea68568354c6798180ff1a750c6b6aa (diff) |
GC dompression support in java.
Diffstat (limited to 'config-model')
4 files changed, 10 insertions, 57 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java index de9a39ea75d..60b06d3655c 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.document; -import com.yahoo.document.CompressionConfig; import com.yahoo.document.DataType; import com.yahoo.document.DataTypeName; import com.yahoo.document.DocumentType; @@ -158,7 +157,6 @@ public class SDDocumentType implements Cloneable, Serializable { */ public SDDocumentType(String name, Schema schema) { docType = new DocumentType(name); - docType.contentStruct().setCompressionConfig(new CompressionConfig()); validateId(schema); inherit(VESPA_DOCUMENT); } diff --git a/config-model/src/main/java/com/yahoo/vespa/configmodel/producers/DocumentManager.java b/config-model/src/main/java/com/yahoo/vespa/configmodel/producers/DocumentManager.java index 64b528ad858..8605389e1c2 100644 --- a/config-model/src/main/java/com/yahoo/vespa/configmodel/producers/DocumentManager.java +++ b/config-model/src/main/java/com/yahoo/vespa/configmodel/producers/DocumentManager.java @@ -117,13 +117,6 @@ public class DocumentManager { Datatype.Structtype.Builder structBuilder = new Datatype.Structtype.Builder(); builder.structtype(structBuilder); structBuilder.name(structType.getName()); - if (structType.getCompressionConfig().type.getCode() != 0) { - structBuilder. - compresstype(Datatype.Structtype.Compresstype.Enum.valueOf(structType.getCompressionConfig().type.toString())). - compresslevel(structType.getCompressionConfig().compressionLevel). - compressthreshold((int)structType.getCompressionConfig().threshold). - compressminsize((int)structType.getCompressionConfig().minsize); - } for (com.yahoo.document.Field field : structType.getFieldsThisTypeOnly()) { Datatype.Structtype.Field.Builder fieldBuilder = new Datatype.Structtype.Field.Builder(); structBuilder.field(fieldBuilder); diff --git a/config-model/src/main/java/com/yahoo/vespa/configmodel/producers/DocumentTypes.java b/config-model/src/main/java/com/yahoo/vespa/configmodel/producers/DocumentTypes.java index a89ef74a749..3b0b63f277e 100644 --- a/config-model/src/main/java/com/yahoo/vespa/configmodel/producers/DocumentTypes.java +++ b/config-model/src/main/java/com/yahoo/vespa/configmodel/producers/DocumentTypes.java @@ -136,13 +136,6 @@ public class DocumentTypes { DocumenttypesConfig.Documenttype.Datatype.Sstruct.Builder structBuilder = new DocumenttypesConfig.Documenttype.Datatype.Sstruct.Builder(); dataTypeBuilder.sstruct(structBuilder); structBuilder.name(type.getName()); - if (type.getCompressionConfig().type.getCode() != 0) { - structBuilder.compression(new DocumenttypesConfig.Documenttype.Datatype.Sstruct.Compression.Builder(). - type(DocumenttypesConfig.Documenttype.Datatype.Sstruct.Compression.Type.Enum.valueOf(type.getCompressionConfig().type.toString())). - level(type.getCompressionConfig().compressionLevel). - threshold((int) type.getCompressionConfig().threshold). - minsize((int) type.getCompressionConfig().minsize)); - } for (com.yahoo.document.Field field : type.getFields()) { DocumenttypesConfig.Documenttype.Datatype.Sstruct.Field.Builder builder = new DocumenttypesConfig.Documenttype.Datatype.Sstruct.Field.Builder(); diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj index d2894442ab9..ef5bb9298ed 100644 --- a/config-model/src/main/javacc/SDParser.jj +++ b/config-model/src/main/javacc/SDParser.jj @@ -154,26 +154,6 @@ public class SDParser { token_source.input_stream.getBeginColumn() + ".").initCause(e); } } - - /** - * Sets the compression threshold in each item in the compression config array. - * - * @param cfg The array of configs to modify. - * @param val The compression threshold to set. - */ - private void setCompressionThreshold(CompressionConfig cfg, int val) { - cfg.threshold = val; - } - - /** - * Sets the compression level in each item in the compression config array. - * - * @param cfg The array of configs to modify. - * @param val The compression level to set. - */ - private void setCompressionLevel(CompressionConfig cfg, int val) { - cfg.compressionLevel = val; - } } PARSER_END(SDParser) @@ -569,7 +549,7 @@ Object documentBody(SDDocumentType document, Schema schema) : } { ( annotation(schema, document) - | compression(document, null) + | compression(document) | headercfg(document) | bodycfg(document) | structInside(document, schema) @@ -590,7 +570,7 @@ void rawAsBase64(Schema schema) : */ void headercfg(SDDocumentType document) : { } { - <HEADER> lbrace() [compression(document, "header") (<NL>)*] <RBRACE> + <HEADER> lbrace() [compression(document) (<NL>)*] <RBRACE> } /** @@ -600,46 +580,35 @@ void headercfg(SDDocumentType document) : { } */ void bodycfg(SDDocumentType document) : { } { - <BODY> lbrace() [compression(document, "body") (<NL>)*] <RBRACE> + <BODY> lbrace() [compression(document) (<NL>)*] <RBRACE> } /** * Consumes a compression block. This can be set in both document header and -body block. * * @param document The document type to modify. - * @param name The name of the document block to modify. */ -void compression(SDDocumentType document, String name) : +void compression(SDDocumentType document) : { deployLogger.logApplicationPackage(Level.WARNING, "'compression' for a document is deprecated and ignored"); - CompressionConfig cfg = new CompressionConfig(CompressionType.LZ4); } { - <COMPRESSION> lbrace() (cfg = compressionItem(cfg) (<NL>)*)* <RBRACE> - { - if (name == null || name.equals("header")) { - document.getDocumentType().contentStruct().setCompressionConfig(cfg); - } - } + <COMPRESSION> lbrace() ( compressionItem() (<NL>)*)* <RBRACE> { } } /** * Consumes the body of a compression block. * - * @param cfg The compression config to modify. */ -CompressionConfig compressionItem(CompressionConfig cfg) : +void compressionItem() : { int val = -1; } { - ( ( <TYPE> <COLON> <LZ4> { cfg = new CompressionConfig(CompressionType.LZ4, cfg.compressionLevel, cfg.threshold); } ) - | (<COMPRESSIONTHRESHOLD> <COLON> val = integer()) { setCompressionThreshold(cfg, val); } - | (<COMPRESSIONLEVEL> <COLON> val = integer()) { setCompressionLevel(cfg, val); } - ) - { - return cfg; - } + ( ( <TYPE> <COLON> <LZ4> ) + | (<COMPRESSIONTHRESHOLD> <COLON> val = integer()) + | (<COMPRESSIONLEVEL> <COLON> val = integer()) + ) { } } /** |