try { Custom custom = parser.namedObject(Custom.class, currentFieldName, null); builder.putCustom(custom.getWriteableName(), custom); } catch (NamedObjectNotFoundException ex) { logger.warn("Skipping unknown custom object with type {}", currentFieldName);
try { Custom custom = parser.namedObject(Custom.class, currentFieldName, null); builder.putCustom(custom.getWriteableName(), custom); } catch (NamedObjectNotFoundException ex) { logger.warn("Skipping unknown custom object with type {}", currentFieldName);
try { Custom custom = parser.namedObject(Custom.class, currentFieldName, null); builder.putCustom(custom.getWriteableName(), custom); } catch (NamedObjectNotFoundException ex) { logger.warn("Skipping unknown custom object with type {}", currentFieldName);
try { Custom custom = parser.namedObject(Custom.class, currentFieldName, null); builder.putCustom(custom.getWriteableName(), custom); } catch (UnknownNamedObjectException ex) { logger.warn("Skipping unknown custom object with type {}", currentFieldName);
public static MetaData readFrom(StreamInput in) throws IOException { Builder builder = new Builder(); builder.version = in.readLong(); builder.clusterUUID = in.readString(); builder.transientSettings(readSettingsFromStream(in)); builder.persistentSettings(readSettingsFromStream(in)); int size = in.readVInt(); for (int i = 0; i < size; i++) { builder.put(IndexMetaData.readFrom(in), false); } size = in.readVInt(); for (int i = 0; i < size; i++) { builder.put(IndexTemplateMetaData.readFrom(in)); } int customSize = in.readVInt(); for (int i = 0; i < customSize; i++) { Custom customIndexMetaData = in.readNamedWriteable(Custom.class); builder.putCustom(customIndexMetaData.getWriteableName(), customIndexMetaData); } return builder.build(); }
public static MetaData readFrom(StreamInput in) throws IOException { Builder builder = new Builder(); builder.version = in.readLong(); builder.clusterUUID = in.readString(); builder.transientSettings(readSettingsFromStream(in)); builder.persistentSettings(readSettingsFromStream(in)); int size = in.readVInt(); for (int i = 0; i < size; i++) { builder.put(IndexMetaData.readFrom(in), false); } size = in.readVInt(); for (int i = 0; i < size; i++) { builder.put(IndexTemplateMetaData.readFrom(in)); } int customSize = in.readVInt(); for (int i = 0; i < customSize; i++) { Custom customIndexMetaData = in.readNamedWriteable(Custom.class); builder.putCustom(customIndexMetaData.getWriteableName(), customIndexMetaData); } return builder.build(); }
public static MetaData readFrom(StreamInput in) throws IOException { Builder builder = new Builder(); builder.version = in.readLong(); builder.clusterUUID = in.readString(); builder.transientSettings(readSettingsFromStream(in)); builder.persistentSettings(readSettingsFromStream(in)); int size = in.readVInt(); for (int i = 0; i < size; i++) { builder.put(IndexMetaData.readFrom(in), false); } size = in.readVInt(); for (int i = 0; i < size; i++) { builder.put(IndexTemplateMetaData.readFrom(in)); } int customSize = in.readVInt(); for (int i = 0; i < customSize; i++) { Custom customIndexMetaData = in.readNamedWriteable(Custom.class); builder.putCustom(customIndexMetaData.getWriteableName(), customIndexMetaData); } return builder.build(); }
/** * Since custom metadata can be loaded by a plugin class loader that resides in a sub-node, we need to * marshal this object into something the tribe node can work with */ private MetaData.Custom marshal(MetaData.Custom custom) { try (BytesStreamOutput bytesStreamOutput = new BytesStreamOutput()){ bytesStreamOutput.writeNamedWriteable(custom); try(StreamInput input = bytesStreamOutput.bytes().streamInput()) { StreamInput namedInput = new NamedWriteableAwareStreamInput(input, namedWriteableRegistry); MetaData.Custom marshaled = namedInput.readNamedWriteable(MetaData.Custom.class); return marshaled; } } catch (IOException ex) { throw new IllegalStateException("cannot marshal object with type " + custom.getWriteableName() + " to tribe node"); } } }
/** * Since custom metadata can be loaded by a plugin class loader that resides in a sub-node, we need to * marshal this object into something the tribe node can work with */ private MetaData.Custom marshal(MetaData.Custom custom) { try (BytesStreamOutput bytesStreamOutput = new BytesStreamOutput()){ bytesStreamOutput.writeNamedWriteable(custom); try(StreamInput input = bytesStreamOutput.bytes().streamInput()) { StreamInput namedInput = new NamedWriteableAwareStreamInput(input, namedWriteableRegistry); MetaData.Custom marshaled = namedInput.readNamedWriteable(MetaData.Custom.class); return marshaled; } } catch (IOException ex) { throw new IllegalStateException("cannot marshal object with type " + custom.getWriteableName() + " to tribe node"); } } }
public static MetaData readFrom(StreamInput in) throws IOException { Builder builder = new Builder(); builder.version = in.readLong(); builder.clusterUUID = in.readString(); builder.transientSettings(readSettingsFromStream(in)); builder.persistentSettings(readSettingsFromStream(in)); int size = in.readVInt(); for (int i = 0; i < size; i++) { builder.put(IndexMetaData.readFrom(in), false); } size = in.readVInt(); for (int i = 0; i < size; i++) { builder.put(IndexTemplateMetaData.readFrom(in)); } int customSize = in.readVInt(); for (int i = 0; i < customSize; i++) { Custom customIndexMetaData = in.readNamedWriteable(Custom.class); builder.putCustom(customIndexMetaData.getWriteableName(), customIndexMetaData); } return builder.build(); }