congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
NamedWriteable
Code IndexAdd Tabnine to your IDE (free)

How to use
NamedWriteable
in
org.elasticsearch.common.io.stream

Best Java code snippets using org.elasticsearch.common.io.stream.NamedWriteable (Showing top 11 results out of 315)

origin: org.elasticsearch/elasticsearch

/**
 * Writes a {@link NamedWriteable} to the current stream, by first writing its name and then the object itself
 */
public void writeNamedWriteable(NamedWriteable namedWriteable) throws IOException {
  writeString(namedWriteable.getWriteableName());
  namedWriteable.writeTo(this);
}
origin: org.elasticsearch/elasticsearch

  @Override
  public <C extends NamedWriteable> C readNamedWriteable(@SuppressWarnings("unused") Class<C> categoryClass,
                              @SuppressWarnings("unused") String name) throws IOException {
    Writeable.Reader<? extends C> reader = namedWriteableRegistry.getReader(categoryClass, name);
    C c = reader.read(this);
    if (c == null) {
      throw new IOException(
        "Writeable.Reader [" + reader + "] returned null which is not allowed and probably means it screwed up the stream.");
    }
    assert name.equals(c.getWriteableName()) : c + " claims to have a different name [" + c.getWriteableName()
      + "] than it was read from [" + name + "].";
    return c;
  }
}
origin: harbby/presto-connectors

  @Override
  <C> C readNamedWriteable(Class<C> categoryClass) throws IOException {
    String name = readString();
    NamedWriteable<? extends C> namedWriteable = namedWriteableRegistry.getPrototype(categoryClass, name);
    return namedWriteable.readFrom(this);
  }
}
origin: harbby/presto-connectors

private void registerPrototype(NamedWriteable<? extends T> namedWriteable) {
  NamedWriteable<? extends T> existingNamedWriteable = registry.get(namedWriteable.getWriteableName());
  if (existingNamedWriteable != null) {
    throw new IllegalArgumentException("named writeable of type [" + namedWriteable.getClass().getName() + "] with name [" + namedWriteable.getWriteableName() + "] " +
        "is already registered by type [" + existingNamedWriteable.getClass().getName() + "] within category [" + categoryClass.getName() + "]");
  }
  registry.put(namedWriteable.getWriteableName(), namedWriteable);
}
origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Writes a {@link NamedWriteable} to the current stream, by first writing its name and then the object itself
 */
public void writeNamedWriteable(NamedWriteable namedWriteable) throws IOException {
  writeString(namedWriteable.getWriteableName());
  namedWriteable.writeTo(this);
}
origin: com.strapdata.elasticsearch/elasticsearch

  @Override
  public <C extends NamedWriteable> C readNamedWriteable(@SuppressWarnings("unused") Class<C> categoryClass,
                              @SuppressWarnings("unused") String name) throws IOException {
    Writeable.Reader<? extends C> reader = namedWriteableRegistry.getReader(categoryClass, name);
    C c = reader.read(this);
    if (c == null) {
      throw new IOException(
        "Writeable.Reader [" + reader + "] returned null which is not allowed and probably means it screwed up the stream.");
    }
    assert name.equals(c.getWriteableName()) : c + " claims to have a different name [" + c.getWriteableName()
      + "] than it was read from [" + name + "].";
    return c;
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Writes a {@link NamedWriteable} to the current stream, by first writing its name and then the object itself
 */
public void writeNamedWriteable(NamedWriteable namedWriteable) throws IOException {
  writeString(namedWriteable.getWriteableName());
  namedWriteable.writeTo(this);
}
origin: apache/servicemix-bundles

/**
 * Writes a {@link NamedWriteable} to the current stream, by first writing its name and then the object itself
 */
public void writeNamedWriteable(NamedWriteable namedWriteable) throws IOException {
  writeString(namedWriteable.getWriteableName());
  namedWriteable.writeTo(this);
}
origin: harbby/presto-connectors

/**
 * Writes a {@link NamedWriteable} to the current stream, by first writing its name and then the object itself
 */
void writeNamedWriteable(NamedWriteable namedWriteable) throws IOException {
  writeString(namedWriteable.getWriteableName());
  namedWriteable.writeTo(this);
}
origin: apache/servicemix-bundles

  @Override
  public <C extends NamedWriteable> C readNamedWriteable(@SuppressWarnings("unused") Class<C> categoryClass,
                              @SuppressWarnings("unused") String name) throws IOException {
    Writeable.Reader<? extends C> reader = namedWriteableRegistry.getReader(categoryClass, name);
    C c = reader.read(this);
    if (c == null) {
      throw new IOException(
        "Writeable.Reader [" + reader + "] returned null which is not allowed and probably means it screwed up the stream.");
    }
    assert name.equals(c.getWriteableName()) : c + " claims to have a different name [" + c.getWriteableName()
      + "] than it was read from [" + name + "].";
    return c;
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  @Override
  public <C extends NamedWriteable> C readNamedWriteable(@SuppressWarnings("unused") Class<C> categoryClass,
                              @SuppressWarnings("unused") String name) throws IOException {
    Writeable.Reader<? extends C> reader = namedWriteableRegistry.getReader(categoryClass, name);
    C c = reader.read(this);
    if (c == null) {
      throw new IOException(
        "Writeable.Reader [" + reader + "] returned null which is not allowed and probably means it screwed up the stream.");
    }
    assert name.equals(c.getWriteableName()) : c + " claims to have a different name [" + c.getWriteableName()
      + "] than it was read from [" + name + "].";
    return c;
  }
}
org.elasticsearch.common.io.streamNamedWriteable

Javadoc

A Writeable object identified by its name. To be used for arbitrary serializable objects (e.g. queries); when reading them, their name tells which specific object needs to be created.

Most used methods

  • getWriteableName
    Returns the name of the writeable object
  • writeTo
  • readFrom

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • setScale (BigDecimal)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Kernel (java.awt.image)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Top plugins for Android Studio
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