summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-04-24 10:19:44 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2019-04-24 12:59:15 +0200
commit82643b519b995d654aca59ed86bdc72c1de4d8df (patch)
tree93c65c647f7903db15a22b5c3c0c2b1a049a9a37 /document
parent341a8d2b09937c2c713c3db724457656977fe671 (diff)
GC unused code
Diffstat (limited to 'document')
-rw-r--r--document/abi-spec.json3
-rw-r--r--document/src/main/java/com/yahoo/document/json/JsonReader.java1
-rw-r--r--document/src/main/java/com/yahoo/document/serialization/DocumentSerializerFactory.java8
-rw-r--r--document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializerHead.java2
-rw-r--r--document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java68
-rwxr-xr-xdocument/src/test/java/com/yahoo/vespaxmlparser/VespaXMLReaderTestCase.java1
6 files changed, 3 insertions, 80 deletions
diff --git a/document/abi-spec.json b/document/abi-spec.json
index d4db3026b27..81cf5509a57 100644
--- a/document/abi-spec.json
+++ b/document/abi-spec.json
@@ -4436,8 +4436,7 @@
"public static com.yahoo.document.serialization.DocumentSerializer createHead(com.yahoo.io.GrowableByteBuffer)",
"public static com.yahoo.document.serialization.DocumentSerializer create6(com.yahoo.io.GrowableByteBuffer)",
"public static com.yahoo.document.serialization.DocumentSerializer create6()",
- "public static com.yahoo.document.serialization.DocumentSerializer create42(com.yahoo.io.GrowableByteBuffer)",
- "public static com.yahoo.document.serialization.DocumentSerializer create42()"
+ "public static com.yahoo.document.serialization.DocumentSerializer create42(com.yahoo.io.GrowableByteBuffer)"
],
"fields": []
},
diff --git a/document/src/main/java/com/yahoo/document/json/JsonReader.java b/document/src/main/java/com/yahoo/document/json/JsonReader.java
index b7818b06b03..d512fd3a6d1 100644
--- a/document/src/main/java/com/yahoo/document/json/JsonReader.java
+++ b/document/src/main/java/com/yahoo/document/json/JsonReader.java
@@ -4,7 +4,6 @@ package com.yahoo.document.json;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
-import com.google.common.annotations.Beta;
import com.yahoo.document.DocumentId;
import com.yahoo.document.DocumentOperation;
import com.yahoo.document.DocumentType;
diff --git a/document/src/main/java/com/yahoo/document/serialization/DocumentSerializerFactory.java b/document/src/main/java/com/yahoo/document/serialization/DocumentSerializerFactory.java
index 54ec4e2fcca..23266566e1c 100644
--- a/document/src/main/java/com/yahoo/document/serialization/DocumentSerializerFactory.java
+++ b/document/src/main/java/com/yahoo/document/serialization/DocumentSerializerFactory.java
@@ -42,12 +42,4 @@ public class DocumentSerializerFactory {
return new VespaDocumentSerializer42(buf);
}
- /**
- * Creates a serializer for the document format that was created on Vespa 4.2.
- */
- @SuppressWarnings("deprecation")
- public static DocumentSerializer create42() {
- return new VespaDocumentSerializer42();
- }
-
}
diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializerHead.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializerHead.java
index a763db33e7a..58c50f047f9 100644
--- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializerHead.java
+++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializerHead.java
@@ -5,7 +5,6 @@ import com.yahoo.document.DataType;
import com.yahoo.document.DocumentTypeManager;
import com.yahoo.document.TensorDataType;
import com.yahoo.document.datatypes.TensorFieldValue;
-import com.yahoo.document.json.readers.TensorRemoveUpdateReader;
import com.yahoo.document.update.TensorAddUpdate;
import com.yahoo.document.update.TensorModifyUpdate;
import com.yahoo.document.update.TensorRemoveUpdate;
@@ -18,7 +17,6 @@ import com.yahoo.tensor.TensorType;
*
* @author baldersheim
*/
-@SuppressWarnings("deprecation")
public class VespaDocumentDeserializerHead extends VespaDocumentDeserializer6 {
public VespaDocumentDeserializerHead(DocumentTypeManager manager, GrowableByteBuffer buffer) {
diff --git a/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java b/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java
index a24f1abd22b..e0213b4c88d 100644
--- a/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java
+++ b/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java
@@ -56,7 +56,7 @@ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader {
/**
* Skips the initial "vespafeed" tag.
*/
- void readInitial() throws Exception {
+ private void readInitial() throws Exception {
boolean found = false;
while (reader.hasNext()) {
@@ -93,7 +93,6 @@ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader {
private Document doc;
private DocumentId remove;
private DocumentUpdate docUpdate;
- private FeedOperation feedOperation;
private TestAndSetCondition condition;
public Operation() {
@@ -105,7 +104,6 @@ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader {
doc = null;
remove = null;
docUpdate = null;
- feedOperation = null;
condition = null;
}
@@ -140,10 +138,6 @@ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader {
this.docUpdate = docUpdate;
}
- public FeedOperation getFeedOperation() {
- return feedOperation;
- }
-
public void setCondition(TestAndSetCondition condition) {
this.condition = condition;
}
@@ -159,42 +153,10 @@ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader {
", doc=" + doc +
", remove=" + remove +
", docUpdate=" + docUpdate +
- ", feedOperation=" + feedOperation +
'}';
}
}
- public static class FeedOperation {
-
- private String name;
- private Integer generation;
- private Integer increment;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Integer getGeneration() {
- return generation;
- }
-
- public void setGeneration(int generation) {
- this.generation = generation;
- }
-
- public Integer getIncrement() {
- return increment;
- }
-
- public void setIncrement(int increment) {
- this.increment = increment;
- }
- }
-
/**
* <p>Reads all operations from the XML stream and puts into a list. Note
* that if the XML stream is large, this may cause out of memory errors, so
@@ -203,7 +165,7 @@ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader {
* @return The list of all read operations.
*/
public List<Operation> readAll() throws Exception {
- List<Operation> list = new ArrayList<Operation>();
+ List<Operation> list = new ArrayList<>();
while (true) {
Operation op = new Operation();
read(op);
@@ -283,30 +245,4 @@ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader {
}
}
- public void read(FeedOperation fo) throws XMLStreamException {
- while (reader.hasNext()) {
- int type = reader.next();
-
- if (type == XMLStreamReader.START_ELEMENT) {
- if ("name".equals(reader.getName().toString())) {
- fo.setName(reader.getElementText().toString());
- skipToEnd("name");
- } else if ("generation".equals(reader.getName().toString())) {
- fo.setGeneration(Integer.parseInt(reader.getElementText().toString()));
- skipToEnd("generation");
- } else if ("increment".equals(reader.getName().toString())) {
- String text = reader.getElementText();
- if ("autodetect".equals(text)) {
- fo.setIncrement(-1);
- } else {
- fo.setIncrement(Integer.parseInt(text));
- }
- skipToEnd("increment");
- }
- } else if (type == XMLStreamReader.END_ELEMENT) {
- return;
- }
- }
- }
-
}
diff --git a/document/src/test/java/com/yahoo/vespaxmlparser/VespaXMLReaderTestCase.java b/document/src/test/java/com/yahoo/vespaxmlparser/VespaXMLReaderTestCase.java
index 1aad59f4c56..29567177642 100755
--- a/document/src/test/java/com/yahoo/vespaxmlparser/VespaXMLReaderTestCase.java
+++ b/document/src/test/java/com/yahoo/vespaxmlparser/VespaXMLReaderTestCase.java
@@ -810,7 +810,6 @@ public class VespaXMLReaderTestCase {
assertEquals(VespaXMLFeedReader.OperationType.DOCUMENT, op.getType());
assertNull(op.getRemove());
assertNull(op.getDocumentUpdate());
- assertNull(op.getFeedOperation());
assertNotNull(op.getDocument());
Document doc = op.getDocument();