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
Introduce client feature tracking #31020
Changes from 1 commit
e1fbfaf
82ed4d4
6d529fe
66f2ea9
25a861c
0b39ce9
26071ff
8be176c
1f66829
546fe41
a18f166
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,10 +58,12 @@ | |
import java.util.EnumMap; | ||
import java.util.EnumSet; | ||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.Iterator; | ||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Set; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.function.IntFunction; | ||
|
||
|
@@ -98,6 +100,7 @@ public abstract class StreamOutput extends OutputStream { | |
} | ||
|
||
private Version version = Version.CURRENT; | ||
private Set<String> features = Collections.emptySet(); | ||
|
||
/** | ||
* The version of the node on the other side of this stream. | ||
|
@@ -113,6 +116,14 @@ public void setVersion(Version version) { | |
this.version = version; | ||
} | ||
|
||
public boolean hasFeature(final String feature) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we have a java docs with some explanation of what the features are (or a link to where it's explained). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I pushed 26071ff. |
||
return this.features.contains(feature); | ||
} | ||
|
||
public void setFeatures(final Set<String> features) { | ||
this.features = Collections.unmodifiableSet(new HashSet<>(features)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. assert it's currently empty? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wrapped this into 26071ff. |
||
} | ||
|
||
public long position() throws IOException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ | |
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
import java.util.function.Predicate; | ||
import java.util.stream.Collectors; | ||
|
@@ -189,7 +190,7 @@ public long getNumberOfTasksOnNode(String nodeId, String taskName) { | |
|
||
@Override | ||
public Version getMinimalSupportedVersion() { | ||
return Version.V_5_4_0; | ||
return Version.V_6_3_0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We cannot change this. This would mean that a mixed 6.2 x-pack / 6.3 x-pack cluster might drop its persistent tasks on the floor. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussed with @bleskes. Only revert this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I pushed a18f166. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we can change this - 6.2 with xpack will have problems. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I pushed a18f166. |
||
} | ||
|
||
@Override | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we have a version protection here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I pushed 0b39ce9.