mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 22:36:20 +00:00
Querying mapping on a non-master throws an error, closes #261.
This commit is contained in:
parent
ee60d7dedc
commit
c987e8a534
@ -375,7 +375,12 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode> {
|
||||
}
|
||||
|
||||
public static void writeTo(DiscoveryNodes nodes, StreamOutput out) throws IOException {
|
||||
out.writeUTF(nodes.masterNodeId);
|
||||
if (nodes.masterNodeId() == null) {
|
||||
out.writeBoolean(false);
|
||||
} else {
|
||||
out.writeBoolean(true);
|
||||
out.writeUTF(nodes.masterNodeId);
|
||||
}
|
||||
out.writeVInt(nodes.size());
|
||||
for (DiscoveryNode node : nodes) {
|
||||
node.writeTo(out);
|
||||
@ -384,7 +389,9 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode> {
|
||||
|
||||
public static DiscoveryNodes readFrom(StreamInput in, @Nullable DiscoveryNode localNode) throws IOException {
|
||||
Builder builder = new Builder();
|
||||
builder.masterNodeId(in.readUTF());
|
||||
if (in.readBoolean()) {
|
||||
builder.masterNodeId(in.readUTF());
|
||||
}
|
||||
if (localNode != null) {
|
||||
builder.localNodeId(localNode.id());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user