1
0
Эх сурвалжийг харах

Remove unused deprecated serialization code (#63166)

Christoph Büscher 5 жил өмнө
parent
commit
00592b330e

+ 0 - 7
plugins/examples/custom-suggester/src/main/java/org/elasticsearch/example/customsuggester/CustomSuggestion.java

@@ -35,8 +35,6 @@ import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constru
 
 public class CustomSuggestion extends Suggest.Suggestion<CustomSuggestion.Entry> {
 
-    public static final int TYPE = 999;
-
     public static final ParseField DUMMY = new ParseField("dummy");
 
     private String dummy;
@@ -62,11 +60,6 @@ public class CustomSuggestion extends Suggest.Suggestion<CustomSuggestion.Entry>
         return CustomSuggestionBuilder.SUGGESTION_NAME;
     }
 
-    @Override
-    public int getWriteableType() {
-        return TYPE;
-    }
-
     /**
      * A meaningless value used to test that plugin suggesters can add fields to their Suggestion types
      *

+ 0 - 11
server/src/main/java/org/elasticsearch/search/suggest/Suggest.java

@@ -240,17 +240,6 @@ public class Suggest implements Iterable<Suggest.Suggestion<? extends Entry<? ex
             entries.add(entry);
         }
 
-        /**
-         * Returns a integer representing the type of the suggestion. This is used for
-         * internal serialization over the network.
-         *
-         * This class is now serialized as a NamedWriteable and this method only remains for backwards compatibility
-         */
-        @Deprecated
-        public int getWriteableType() {
-            return TYPE;
-        }
-
         @Override
         public Iterator<T> iterator() {
             return entries.iterator();

+ 0 - 8
server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java

@@ -66,9 +66,6 @@ import static org.elasticsearch.search.suggest.Suggest.COMPARATOR;
  */
 public final class CompletionSuggestion extends Suggest.Suggestion<CompletionSuggestion.Entry> {
 
-    @Deprecated
-    public static final int TYPE = 4;
-
     private boolean skipDuplicates;
 
     /**
@@ -234,11 +231,6 @@ public final class CompletionSuggestion extends Suggest.Suggestion<CompletionSug
         }
     }
 
-    @Override
-    public int getWriteableType() {
-        return TYPE;
-    }
-
     @Override
     protected Entry newEntry(StreamInput in) throws IOException {
         return new Entry(in);

+ 0 - 8
server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestion.java

@@ -40,9 +40,6 @@ import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optiona
  */
 public class PhraseSuggestion extends Suggest.Suggestion<PhraseSuggestion.Entry> {
 
-    @Deprecated
-    public static final int TYPE = 3;
-
     public PhraseSuggestion(String name, int size) {
         super(name, size);
     }
@@ -56,11 +53,6 @@ public class PhraseSuggestion extends Suggest.Suggestion<PhraseSuggestion.Entry>
         return PhraseSuggestionBuilder.SUGGESTION_NAME;
     }
 
-    @Override
-    public int getWriteableType() {
-        return TYPE;
-    }
-
     @Override
     protected Entry newEntry(StreamInput in) throws IOException {
         return new Entry(in);

+ 0 - 8
server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestion.java

@@ -43,9 +43,6 @@ import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constru
  */
 public class TermSuggestion extends Suggestion<TermSuggestion.Entry> {
 
-    @Deprecated
-    public static final int TYPE = 1;
-
     public static final Comparator<Suggestion.Entry.Option> SCORE = new Score();
     public static final Comparator<Suggestion.Entry.Option> FREQUENCY = new Frequency();
 
@@ -100,11 +97,6 @@ public class TermSuggestion extends Suggestion<TermSuggestion.Entry> {
         }
     }
 
-    @Override
-    public int getWriteableType() {
-        return TYPE;
-    }
-
     public void setSort(SortBy sort) {
         this.sort = sort;
     }