本文整理匯總了Java中org.elasticsearch.common.settings.Settings.getAsLong方法的典型用法代碼示例。如果您正苦於以下問題:Java Settings.getAsLong方法的具體用法?Java Settings.getAsLong怎麽用?Java Settings.getAsLong使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.elasticsearch.common.settings.Settings
的用法示例。
在下文中一共展示了Settings.getAsLong方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addHumanReadableSettings
import org.elasticsearch.common.settings.Settings; //導入方法依賴的package包/類
/**
* 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();
}
示例2: PublishClusterStateVersionAction
import org.elasticsearch.common.settings.Settings; //導入方法依賴的package包/類
public PublishClusterStateVersionAction(Settings settings, ClusterService clusterService, TransportService transportService, ClusterStateOpLog clusterStateOpLog) {
super(settings);
this.clusterService = clusterService;
this.transportService = transportService;
this.clusterStateOpLog = clusterStateOpLog;
this.pullFullClusterStateAction = new PullFullClusterStateAction(settings, clusterService, transportService, clusterStateOpLog);
this.fullStateSyncOps = settings.getAsLong(SETTING_FULL_STATE_SYNC_THRESHOLD, 30L);
this.publishTimeout = settings.getAsTime(PUBLISH_TIMEOUT, publishTimeout);
this.transportService.registerRequestHandler(PUBLISH_VERSION_ACTION_NAME, BytesTransportRequest.class, ThreadPool.Names.GENERIC, new PublishClusterStateVersionRequestHandler());
}
示例3: timeCreated
import org.elasticsearch.common.settings.Settings; //導入方法依賴的package包/類
private long timeCreated(Settings settings) {
return settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1L);
}
示例4: timeCreated
import org.elasticsearch.common.settings.Settings; //導入方法依賴的package包/類
private long timeCreated(Settings settings) {
return settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1l);
}