public long getCreationDate() { return settings.getAsLong(SETTING_CREATION_DATE, -1L); }
private long timeCreated(Settings settings) { return settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1L); }
/** * 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(); }
public long getCreationDate() { return settings.getAsLong(SETTING_CREATION_DATE, -1l); }
private long timeCreated(Settings settings) { return settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1L); }
public long getCreationDate() { return settings.getAsLong(SETTING_CREATION_DATE, -1L); }
private long timeCreated(Settings settings) { return settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1l); }
public long getCreationDate() { return settings.getAsLong(SETTING_CREATION_DATE, -1L); }
private long timeCreated(Settings settings) { return settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1L); }
private long timeCreated(Settings settings) { return settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1L); }
public long creationDate() { return settings.getAsLong(SETTING_CREATION_DATE, -1l); }
/** * 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 = settings.getAsVersion(SETTING_VERSION_CREATED, null); if (version != null) { 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) { DateTime creationDateTime = new DateTime(creationDate, DateTimeZone.UTC); builder.put(SETTING_CREATION_DATE_STRING, creationDateTime.toString()); } return builder.build(); }
private void checkNestedFieldsLimit(Map<String, ObjectMapper> fullPathObjectMappers) { long allowedNestedFields = indexSettingsService.getSettings().getAsLong(INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING, 50L); long actualNestedFields = 0; for (ObjectMapper objectMapper : fullPathObjectMappers.values()) { if (objectMapper.nested().isNested()) { actualNestedFields++; } } if (allowedNestedFields >= 0 && actualNestedFields > allowedNestedFields) { throw new IllegalArgumentException("Limit of nested fields [" + allowedNestedFields + "] in index [" + index().name() + "] has been exceeded"); } }
/** * 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(); }
/** * 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 = settings.getAsVersion(SETTING_VERSION_CREATED, null); if (version != null) { 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) { DateTime creationDateTime = new DateTime(creationDate, DateTimeZone.UTC); builder.put(SETTING_CREATION_DATE_STRING, creationDateTime.toString()); } return builder.build(); }
validator.setCheckOnlyEndEntities(settings.getAsBoolean(SSLConfigConstants.SEARCHGUARD_SSL_HTTP_CRL_CHECK_ONLY_END_ENTITIES, true)); validator.setPreferCrl(settings.getAsBoolean(SSLConfigConstants.SEARCHGUARD_SSL_HTTP_CRL_PREFER_CRLFILE_OVER_OCSP, false)); Long dateTimestamp = settings.getAsLong(SSLConfigConstants.SEARCHGUARD_SSL_HTTP_CRL_VALIDATION_DATE, null); if(dateTimestamp != null && dateTimestamp.longValue() < 0) { dateTimestamp = null;
/** * Creates a new search index statistics objects per specified parameters. * * @param settings the search index settings * @param docsStats the search index docs stats * @param indexCount the count of index * * @return the newly created search index statistics object */ protected SearchIndexStatistics createSearchIndexStatistics(Settings settings, DocsStats docsStats, long indexCount) { SearchIndexStatistics searchIndexStatistics = new SearchIndexStatistics(); Long creationDate = settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1L); if (creationDate.longValue() != -1L) { DateTime creationDateTime = new DateTime(creationDate, DateTimeZone.UTC); searchIndexStatistics.setIndexCreationDate(HerdDateUtils.getXMLGregorianCalendarValue(creationDateTime.toDate())); } searchIndexStatistics.setIndexNumberOfActiveDocuments(docsStats.getCount()); searchIndexStatistics.setIndexNumberOfDeletedDocuments(docsStats.getDeleted()); searchIndexStatistics.setIndexUuid(settings.get(IndexMetaData.SETTING_INDEX_UUID)); searchIndexStatistics.setIndexCount(indexCount); return searchIndexStatistics; }
/** * Creates a new search index statistics objects per specified parameters. * * @param settings the search index settings * @param docsStats the search index docs stats * @param indexCount the count of index * * @return the newly created search index statistics object */ protected SearchIndexStatistics createSearchIndexStatistics(Settings settings, DocsStats docsStats, long indexCount) { SearchIndexStatistics searchIndexStatistics = new SearchIndexStatistics(); Long creationDate = settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1L); if (creationDate.longValue() != -1L) { DateTime creationDateTime = new DateTime(creationDate, DateTimeZone.UTC); searchIndexStatistics.setIndexCreationDate(HerdDateUtils.getXMLGregorianCalendarValue(creationDateTime.toDate())); } searchIndexStatistics.setIndexNumberOfActiveDocuments(docsStats.getCount()); searchIndexStatistics.setIndexNumberOfDeletedDocuments(docsStats.getDeleted()); searchIndexStatistics.setIndexUuid(settings.get(IndexMetaData.SETTING_INDEX_UUID)); searchIndexStatistics.setIndexCount(indexCount); return searchIndexStatistics; }