Java Code Examples for org.elasticsearch.Version#V_EMPTY

The following examples show how to use org.elasticsearch.Version#V_EMPTY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IndexMetaData.java    From crate with Apache License 2.0 6 votes vote down vote up
/**
 * Adds human readable version and creation date settings.
 * This method is used to display the settings in a human readable format in REST API
 */
public static Settings addHumanReadableSettings(Settings settings) {
    Settings.Builder builder = Settings.builder().put(settings);
    Version version = SETTING_INDEX_VERSION_CREATED.get(settings);
    if (version != Version.V_EMPTY) {
        builder.put(SETTING_VERSION_CREATED_STRING, version.toString());
    }
    Version versionUpgraded = settings.getAsVersion(SETTING_VERSION_UPGRADED, null);
    if (versionUpgraded != null) {
        builder.put(SETTING_VERSION_UPGRADED_STRING, versionUpgraded.toString());
    }
    Long creationDate = settings.getAsLong(SETTING_CREATION_DATE, null);
    if (creationDate != null) {
        ZonedDateTime creationDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(creationDate), ZoneOffset.UTC);
        builder.put(SETTING_CREATION_DATE_STRING, creationDateTime.toString());
    }
    return builder.build();
}
 
Example 2
Source File: CoordinatorTests.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public Version getMinimalSupportedVersion() {
    return Version.V_EMPTY;
}