Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid uid creation in ParsedDocument #27241

Merged
merged 1 commit into from
Nov 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.elasticsearch.index.mapper;

import org.apache.lucene.document.Field;
import org.apache.lucene.util.BytesRef;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.mapper.ParseContext.Document;
Expand All @@ -35,7 +34,6 @@ public class ParsedDocument {
private final Field version;

private final String id, type;
private final BytesRef uid;
private final SeqNoFieldMapper.SequenceIDFields seqID;

private final String routing;
Expand All @@ -62,7 +60,6 @@ public ParsedDocument(Field version,
this.seqID = seqID;
this.id = id;
this.type = type;
this.uid = Uid.createUidAsBytes(type, id);
this.routing = routing;
this.documents = documents;
this.source = source;
Expand Down Expand Up @@ -140,9 +137,7 @@ public void addDynamicMappingsUpdate(Mapping update) {

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Document ").append("uid[").append(uid).append("] doc [").append(documents).append("]");
return sb.toString();
return "Document uid[" + Uid.createUidAsBytes(type, id) + "] doc [" + documents + ']';
}

}