热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.elasticsearch.common.unit.TimeValue.getNanos()方法的使用及代码示例

本文整理了Java中org.elasticsearch.common.unit.TimeValue.getNanos()方法的一些代码示例,展示了TimeValue.getNanos()的具体用法。这

本文整理了Java中org.elasticsearch.common.unit.TimeValue.getNanos()方法的一些代码示例,展示了TimeValue.getNanos()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TimeValue.getNanos()方法的具体详情如下:
包路径:org.elasticsearch.common.unit.TimeValue
类名称:TimeValue
方法名:getNanos

TimeValue.getNanos介绍

暂无

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
* Sets the amount of time before an entry in the cache expires after it was written.
*
* @param expireAfterWrite The amount of time before an entry expires after it was written. Must not be {@code null} and must be
* greater than 0.
*/
public CacheBuilder setExpireAfterWrite(TimeValue expireAfterWrite) {
Objects.requireNonNull(expireAfterWrite);
final long expireAfterWriteNanos = expireAfterWrite.getNanos();
if (expireAfterWriteNanos <= 0) {
throw new IllegalArgumentException("expireAfterWrite <= 0");
}
this.expireAfterWriteNanos = expireAfterWriteNanos;
return this;
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
* Sets the amount of time before an entry in the cache expires after it was last accessed.
*
* @param expireAfterAccess The amount of time before an entry expires after it was last accessed. Must not be {@code null} and must
* be greater than 0.
*/
public CacheBuilder setExpireAfterAccess(TimeValue expireAfterAccess) {
Objects.requireNonNull(expireAfterAccess);
final long expireAfterAccessNanos = expireAfterAccess.getNanos();
if (expireAfterAccessNanos <= 0) {
throw new IllegalArgumentException("expireAfterAccess <= 0");
}
this.expireAfterAccessNanos = expireAfterAccessNanos;
return this;
}

代码示例来源:origin: org.elasticsearch/elasticsearch

QueueResizingEsThreadPoolExecutor(String name, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,
ResizableBlockingQueue workQueue, int minQueueSize, int maxQueueSize,
Function runnableWrapper, final int tasksPerFrame,
TimeValue targetedResponseTime, ThreadFactory threadFactory, XRejectedExecutionHandler handler,
ThreadContext contextHolder) {
super(name, corePoolSize, maximumPoolSize, keepAliveTime, unit,
workQueue, threadFactory, handler, contextHolder);
this.runnableWrapper = runnableWrapper;
this.workQueue = workQueue;
this.tasksPerFrame = tasksPerFrame;
this.startNs = System.nanoTime();
this.minQueueSize = minQueueSize;
this.maxQueueSize = maxQueueSize;
this.targetedRespOnseTimeNanos= targetedResponseTime.getNanos();
this.executiOnEWMA= new ExponentiallyWeightedMovingAverage(EWMA_ALPHA, 0);
logger.debug(
"thread pool [{}] will adjust queue by [{}] when determining automatic queue size", getName(), QUEUE_ADJUSTMENT_AMOUNT);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

if (cacheExpire.getNanos() != 0) {
cacheBuilder.setExpireAfterAccess(cacheExpire);

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
* Sets the amount of time before an entry in the cache expires after it was written.
*
* @param expireAfterWrite The amount of time before an entry expires after it was written. Must not be {@code null} and must be
* greater than 0.
*/
public CacheBuilder setExpireAfterWrite(TimeValue expireAfterWrite) {
Objects.requireNonNull(expireAfterWrite);
final long expireAfterWriteNanos = expireAfterWrite.getNanos();
if (expireAfterWriteNanos <= 0) {
throw new IllegalArgumentException("expireAfterWrite <= 0");
}
this.expireAfterWriteNanos = expireAfterWriteNanos;
return this;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
* Sets the amount of time before an entry in the cache expires after it was last accessed.
*
* @param expireAfterAccess The amount of time before an entry expires after it was last accessed. Must not be {@code null} and must
* be greater than 0.
*/
public CacheBuilder setExpireAfterAccess(TimeValue expireAfterAccess) {
Objects.requireNonNull(expireAfterAccess);
final long expireAfterAccessNanos = expireAfterAccess.getNanos();
if (expireAfterAccessNanos <= 0) {
throw new IllegalArgumentException("expireAfterAccess <= 0");
}
this.expireAfterAccessNanos = expireAfterAccessNanos;
return this;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
* Sets the amount of time before an entry in the cache expires after it was written.
*
* @param expireAfterWrite The amount of time before an entry expires after it was written. Must not be {@code null} and must be
* greater than 0.
*/
public CacheBuilder setExpireAfterWrite(TimeValue expireAfterWrite) {
Objects.requireNonNull(expireAfterWrite);
final long expireAfterWriteNanos = expireAfterWrite.getNanos();
if (expireAfterWriteNanos <= 0) {
throw new IllegalArgumentException("expireAfterWrite <= 0");
}
this.expireAfterWriteNanos = expireAfterWriteNanos;
return this;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
* Sets the amount of time before an entry in the cache expires after it was last accessed.
*
* @param expireAfterAccess The amount of time before an entry expires after it was last accessed. Must not be {@code null} and must
* be greater than 0.
*/
public CacheBuilder setExpireAfterAccess(TimeValue expireAfterAccess) {
Objects.requireNonNull(expireAfterAccess);
final long expireAfterAccessNanos = expireAfterAccess.getNanos();
if (expireAfterAccessNanos <= 0) {
throw new IllegalArgumentException("expireAfterAccess <= 0");
}
this.expireAfterAccessNanos = expireAfterAccessNanos;
return this;
}

代码示例来源:origin: apache/servicemix-bundles

/**
* Sets the amount of time before an entry in the cache expires after it was written.
*
* @param expireAfterWrite The amount of time before an entry expires after it was written. Must not be {@code null} and must be
* greater than 0.
*/
public CacheBuilder setExpireAfterWrite(TimeValue expireAfterWrite) {
Objects.requireNonNull(expireAfterWrite);
final long expireAfterWriteNanos = expireAfterWrite.getNanos();
if (expireAfterWriteNanos <= 0) {
throw new IllegalArgumentException("expireAfterWrite <= 0");
}
this.expireAfterWriteNanos = expireAfterWriteNanos;
return this;
}

代码示例来源:origin: apache/servicemix-bundles

/**
* Sets the amount of time before an entry in the cache expires after it was last accessed.
*
* @param expireAfterAccess The amount of time before an entry expires after it was last accessed. Must not be {@code null} and must
* be greater than 0.
*/
public CacheBuilder setExpireAfterAccess(TimeValue expireAfterAccess) {
Objects.requireNonNull(expireAfterAccess);
final long expireAfterAccessNanos = expireAfterAccess.getNanos();
if (expireAfterAccessNanos <= 0) {
throw new IllegalArgumentException("expireAfterAccess <= 0");
}
this.expireAfterAccessNanos = expireAfterAccessNanos;
return this;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

QueueResizingEsThreadPoolExecutor(String name, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,
ResizableBlockingQueue workQueue, int minQueueSize, int maxQueueSize,
Function runnableWrapper, final int tasksPerFrame,
TimeValue targetedResponseTime, ThreadFactory threadFactory, XRejectedExecutionHandler handler,
ThreadContext contextHolder) {
super(name, corePoolSize, maximumPoolSize, keepAliveTime, unit,
workQueue, threadFactory, handler, contextHolder);
this.runnableWrapper = runnableWrapper;
this.workQueue = workQueue;
this.tasksPerFrame = tasksPerFrame;
this.startNs = System.nanoTime();
this.minQueueSize = minQueueSize;
this.maxQueueSize = maxQueueSize;
this.targetedRespOnseTimeNanos= targetedResponseTime.getNanos();
this.executiOnEWMA= new ExponentiallyWeightedMovingAverage(EWMA_ALPHA, 0);
logger.debug(
"thread pool [{}] will adjust queue by [{}] when determining automatic queue size", getName(), QUEUE_ADJUSTMENT_AMOUNT);
}

代码示例来源:origin: apache/servicemix-bundles

QueueResizingEsThreadPoolExecutor(String name, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,
ResizableBlockingQueue workQueue, int minQueueSize, int maxQueueSize,
Function runnableWrapper, final int tasksPerFrame,
TimeValue targetedResponseTime, ThreadFactory threadFactory, XRejectedExecutionHandler handler,
ThreadContext contextHolder) {
super(name, corePoolSize, maximumPoolSize, keepAliveTime, unit,
workQueue, threadFactory, handler, contextHolder);
this.runnableWrapper = runnableWrapper;
this.workQueue = workQueue;
this.tasksPerFrame = tasksPerFrame;
this.startNs = System.nanoTime();
this.minQueueSize = minQueueSize;
this.maxQueueSize = maxQueueSize;
this.targetedRespOnseTimeNanos= targetedResponseTime.getNanos();
this.executiOnEWMA= new ExponentiallyWeightedMovingAverage(EWMA_ALPHA, 0);
logger.debug(
"thread pool [{}] will adjust queue by [{}] when determining automatic queue size", getName(), QUEUE_ADJUSTMENT_AMOUNT);
}

代码示例来源:origin: spinscale/elasticsearch-graphite-plugin

private void sendStoreStats(String type, StoreStats storeStats) {
sendInt(type, "sizeInBytes", storeStats.sizeInBytes());
sendInt(type, "throttleTimeInNanos", storeStats.throttleTime().getNanos());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

if (cacheExpire.getNanos() != 0) {
cacheBuilder.setExpireAfterAccess(cacheExpire);

代码示例来源:origin: apache/servicemix-bundles

if (cacheExpire.getNanos() != 0) {
cacheBuilder.setExpireAfterAccess(cacheExpire);

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

if (cacheExpire.getNanos() != 0) {
cacheBuilder.setExpireAfterAccess(cacheExpire);

推荐阅读
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • 目录实现效果:实现环境实现方法一:基本思路主要代码JavaScript代码总结方法二主要代码总结方法三基本思路主要代码JavaScriptHTML总结实 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • Java在运行已编译完成的类时,是通过java虚拟机来装载和执行的,java虚拟机通过操作系统命令JAVA_HOMEbinjava–option来启 ... [详细]
  • Java中包装类的设计原因以及操作方法
    本文主要介绍了Java中设计包装类的原因以及操作方法。在Java中,除了对象类型,还有八大基本类型,为了将基本类型转换成对象,Java引入了包装类。文章通过介绍包装类的定义和实现,解答了为什么需要包装类的问题,并提供了简单易用的操作方法。通过本文的学习,读者可以更好地理解和应用Java中的包装类。 ... [详细]
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • 本文介绍了OC学习笔记中的@property和@synthesize,包括属性的定义和合成的使用方法。通过示例代码详细讲解了@property和@synthesize的作用和用法。 ... [详细]
  • Android JSON基础,音视频开发进阶指南目录
    Array里面的对象数据是有序的,json字符串最外层是方括号的,方括号:[]解析jsonArray代码try{json字符串最外层是 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • 本文详细介绍了Spring的JdbcTemplate的使用方法,包括执行存储过程、存储函数的call()方法,执行任何SQL语句的execute()方法,单个更新和批量更新的update()和batchUpdate()方法,以及单查和列表查询的query()和queryForXXX()方法。提供了经过测试的API供使用。 ... [详细]
  • 本文介绍了Python爬虫技术基础篇面向对象高级编程(中)中的多重继承概念。通过继承,子类可以扩展父类的功能。文章以动物类层次的设计为例,讨论了按照不同分类方式设计类层次的复杂性和多重继承的优势。最后给出了哺乳动物和鸟类的设计示例,以及能跑、能飞、宠物类和非宠物类的增加对类数量的影响。 ... [详细]
author-avatar
对不起太依赖你
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有