Tabnine Logo
VersionedNamedWriteable.getMinimalSupportedVersion
Code IndexAdd Tabnine to your IDE (free)

How to use
getMinimalSupportedVersion
method
in
org.elasticsearch.common.io.stream.VersionedNamedWriteable

Best Java code snippets using org.elasticsearch.common.io.stream.VersionedNamedWriteable.getMinimalSupportedVersion (Showing top 3 results out of 315)

origin: org.elasticsearch/elasticsearch

/**
 * Tests whether or not the custom should be serialized. The criteria are:
 * <ul>
 * <li>the output stream must be at least the minimum supported version of the custom</li>
 * <li>the output stream must have the feature required by the custom (if any) or not be a transport client</li>
 * </ul>
 * <p>
 * That is, we only serialize customs to clients than can understand the custom based on the version of the client and the features
 * that the client has. For transport clients we can be lenient in requiring a feature in which case we do not send the custom but
 * for connected nodes we always require that the node has the required feature.
 *
 * @param out    the output stream
 * @param custom the custom to serialize
 * @param <T>    the type of the custom
 * @return true if the custom should be serialized and false otherwise
 */
static <T extends VersionedNamedWriteable & FeatureAware> boolean shouldSerialize(final StreamOutput out, final T custom) {
  if (out.getVersion().before(custom.getMinimalSupportedVersion())) {
    return false;
  }
  if (custom.getRequiredFeature().isPresent()) {
    final String requiredFeature = custom.getRequiredFeature().get();
    // if it is a transport client we are lenient yet for a connected node it must have the required feature
    return out.hasFeature(requiredFeature) || out.hasFeature(TransportClient.TRANSPORT_CLIENT_FEATURE) == false;
  }
  return true;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Tests whether or not the custom should be serialized. The criteria are:
 * <ul>
 * <li>the output stream must be at least the minimum supported version of the custom</li>
 * <li>the output stream must have the feature required by the custom (if any) or not be a transport client</li>
 * </ul>
 * <p>
 * That is, we only serialize customs to clients than can understand the custom based on the version of the client and the features
 * that the client has. For transport clients we can be lenient in requiring a feature in which case we do not send the custom but
 * for connected nodes we always require that the node has the required feature.
 *
 * @param out    the output stream
 * @param custom the custom to serialize
 * @param <T>    the type of the custom
 * @return true if the custom should be serialized and false otherwise
 */
static <T extends VersionedNamedWriteable & FeatureAware> boolean shouldSerialize(final StreamOutput out, final T custom) {
  if (out.getVersion().before(custom.getMinimalSupportedVersion())) {
    return false;
  }
  if (custom.getRequiredFeature().isPresent()) {
    final String requiredFeature = custom.getRequiredFeature().get();
    // if it is a transport client we are lenient yet for a connected node it must have the required feature
    return out.hasFeature(requiredFeature) || out.hasFeature(TransportClient.TRANSPORT_CLIENT_FEATURE) == false;
  }
  return true;
}
origin: apache/servicemix-bundles

/**
 * Tests whether or not the custom should be serialized. The criteria are:
 * <ul>
 * <li>the output stream must be at least the minimum supported version of the custom</li>
 * <li>the output stream must have the feature required by the custom (if any) or not be a transport client</li>
 * </ul>
 * <p>
 * That is, we only serialize customs to clients than can understand the custom based on the version of the client and the features
 * that the client has. For transport clients we can be lenient in requiring a feature in which case we do not send the custom but
 * for connected nodes we always require that the node has the required feature.
 *
 * @param out    the output stream
 * @param custom the custom to serialize
 * @param <T>    the type of the custom
 * @return true if the custom should be serialized and false otherwise
 */
static <T extends VersionedNamedWriteable & FeatureAware> boolean shouldSerialize(final StreamOutput out, final T custom) {
  if (out.getVersion().before(custom.getMinimalSupportedVersion())) {
    return false;
  }
  if (custom.getRequiredFeature().isPresent()) {
    final String requiredFeature = custom.getRequiredFeature().get();
    // if it is a transport client we are lenient yet for a connected node it must have the required feature
    return out.hasFeature(requiredFeature) || out.hasFeature(TransportClient.TRANSPORT_CLIENT_FEATURE) == false;
  }
  return true;
}
org.elasticsearch.common.io.streamVersionedNamedWriteablegetMinimalSupportedVersion

Javadoc

The minimal version of the recipient this object can be sent to

Popular methods of VersionedNamedWriteable

    Popular in Java

    • Reading from database using SQL prepared statement
    • onRequestPermissionsResult (Fragment)
    • getSupportFragmentManager (FragmentActivity)
    • runOnUiThread (Activity)
    • OutputStream (java.io)
      A writable sink for bytes.Most clients will use output streams that write data to the file system (
    • PrintWriter (java.io)
      Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
    • ServerSocket (java.net)
      This class represents a server-side socket that waits for incoming client connections. A ServerSocke
    • Comparator (java.util)
      A Comparator is used to compare two objects to determine their ordering with respect to each other.
    • AtomicInteger (java.util.concurrent.atomic)
      An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
    • BoxLayout (javax.swing)
    • CodeWhisperer alternatives
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now