Infinispan配置文件说明

来源:互联网 发布:rstudio数据恢复官网 编辑:程序博客网 时间:2024/06/05 19:28
<?xml version="1.0" encoding="UTF-8"?><infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd" xmlns="urn:infinispan:config:5.0"> <!-- 定义全局缓存策略 --> <global>  <!-- 交通工具,集群通信工具 -->  <transport machineId="computer_01" siteId="site_001"   strictPeerToPeer="true"   transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"   rackId="null" clusterName="infinispan_cluster" nodeName="node_01"   distributedSyncTimeout="240000">  </transport>  <!-- 当JVM关闭的cache instance的时候   hookBehavior:(DEFAULT|REGISTER|DONT_REGISTER)  -->  <shutdown hookBehavior="DEFAULT" />  <!--用户定时刷新复制队列,如果useReplQueue 设置为true的时候用于刷新队列的执行器  -->  <replicationQueueScheduledExecutor   factory="org.infinispan.executors.DefaultScheduledExecutorFactory">   <properties>    <property name="threadNamePrefix"     value="replicationQueueScheduledExecutor_thread" />    <!-- 核心线程数目 -->    <property name="maxThreads" value="10" />   </properties>  </replicationQueueScheduledExecutor>  <!-- 配置全局是否使用JMX配管理统计   cacheManagerName:如果JMX统计被启动,这个属性代表这个缓存管理器名称   jmxDomain:jmx域名   enabled:默认是false,是否被JMX来管理开关   mBeanServerLookup:Fully qualified name of class that will attempt to locate a JMX MBean server to bind to   allowDuplicateDomains:默认是false,如果设置为true,multiple cache manager instances could be configured under the same configured JMX domain. Each cache manager will in practice use a different JMX domain that has been calculated based on the configured one by adding an incrementing index to it  -->  <globalJmxStatistics allowDuplicateDomains="false"   enabled="true" cacheManagerName="infinispan_jmxManage"   jmxDomain="org.infinispan"   mBeanServerLookup="org.infinispan.jmx.PlatformMBeanServerLookup" />  <!-- 异步侦听执行器,用于向异步侦听器发送通知   factory:执行器工厂类名称,重写实现该类必须继承org.infinispan.executors.ExecutorFactory  -->  <asyncListenerExecutor   factory="org.infinispan.executors.DefaultExecutorFactory">   <!-- 异步执行器的属性设置 -->   <properties>    <!--  threadNamePrefix:线程名称前缀。 -->    <property name="threadNamePrefix"     value="infinspan_thread" />    <!-- 执行器的最大线程数目,即线程池核心线程数目 -->    <property name="maxThreads" value="10" />   </properties>  </asyncListenerExecutor>  <!-- 用于配置异步传输执行器,包括异步打包、缓存异步操作,例如Cache.putAsync(),factory:异步执行器,可以重写该异步执行器,但是必须要实现org.infinispan.executors.ExecutorFactory 接口-->  <asyncTransportExecutor   factory="org.infinispan.executors.DefaultExecutorFactory">   <!-- 异步执行器的属性配置 -->   <properties>    <!-- 异步执行器线程名称前缀 -->    <property name="threadNamePrefix"     value="asyncTransport_thread" />    <!-- 异步执行器核心线程的线程数目 -->    <property name="maxThreads" value="10" />   </properties>  </asyncTransportExecutor>  <!-- 周期性执行回收任务执行器 factory:默认的执行器类名,如果想重新改工厂,必须实现org.infinispan.executors.ScheduledExecutorFactory 接口-->  <evictionScheduledExecutor   factory="org.infinispan.executors.DefaultScheduledExecutorFactory">   <properties>    <!-- 线程名称前缀 -->    <property name="threadNamePrefix"     value="evictionScheduled_thread" />    <!-- 线程池的核心线程数目 -->    <property name="maxThreads" value="10" />   </properties>  </evictionScheduledExecutor> </global> <!-- 定义默认缓存的策略,例如用CacheManager.getCache()的时候就是得到默认缓存策略。 --> <default>  <!-- 用户改变不安全操作,   Certain operations such as Cache.put() that are supposed to return the previous value associated with the specified key according to the java.util.Map contract will not fulfill this contract if unsafe toggle is turned on. Use with care   unreliableReturnValues:默认是false。用这个属性要小心。  -->  <unsafe unreliableReturnValues="false" />  <!-- 按照二进制流岚存储   enabled:默认是true   storeKeysAsBinary:按照key以二进制流形式存储   storeValuesAsBinary:把内容按照二进制流形式存储  -->  <storeAsBinary enabled="true" storeKeysAsBinary="true"   storeValuesAsBinary="true" />  <!-- 定义本地虚拟机并发锁机制特性   useLockStriping:默认false,如果设置为true,将会对每一个条目加一个共享锁子,好处就是减少内催消耗,坏处就是减少了并发   isolationLevel:隔离级别,(NONE|SERIALIZABLE|REPEATABLE_READ|READ_COMMITTED|READ_UNCOMMITTED)   concurrencyLevel:并发级别   lockAcquisitionTimeout:获得锁打开的等待最大时间   writeSkewCheck:默认是false,This setting is only applicable in the case of REPEATABLE_READ. When write skew check is set to false, if the writer at commit time discovers that the working entry and the underlying entry have different versions, the working entry will overwrite the underlying entry. If true, such version conflict - known as a write-skew - will throw an Exception  -->  <locking writeSkewCheck="false" lockAcquisitionTimeout="10000"   concurrencyLevel="32" useLockStriping="true"   isolationLevel="READ_COMMITTED" />  <!-- 不赞成的配置,用于存储一个二进制流来代替,默认是false -->  <lazyDeserialization enabled="true" />  <!-- 定义这个缓存是否被JMX统计,默认是false, -->  <jmxStatistics enabled="true" />  <!-- 定义是够调用批量API enabled:默认是false的。-->  <invocationBatching enabled="true" />  <!-- 用于定义条目的索引,具体查看infinispan-query.jar以及和他的依赖。 indexLocalOnly:默认是false,如果设置为true就是忽略远程改变。enabled:如果启动如果缓存更新,索引将随着更新-->  <indexing enabled="true" indexLocalOnly="true">   <properties>   </properties>  </indexing>  <!-- 缓存失效相关配置 ,lifespan:缓存最大声明周期,-1表示永久,maxIdel:缓存的最大空闲时间,-1表示永久。   wakeUpInterval:Interval (in milliseconds) between subsequent runs to purge expired entries from memory and any cache stores. If you wish to disable the periodic eviction process altogether, set wakeupInterval to -1.  -->  <expiration lifespan="-1" maxIdle="-1" wakeUpInterval="60000" />  <!-- 用户配置缓存回收策略 wakeUpInterval:不赞成设置,利用原始设置。strategy:回收策略,'UNORDERED','FIFO','LRU','LIRS','NONE'(禁用回收),   threadPolicy:线程策略,默认是DEFAULT。   maxEntries:在一个缓存实例中缓存最大队列长度,-1就是没有限制。  -->  <eviction strategy="LIRS" threadPolicy="PIGGYBACK"   maxEntries="100" />  <!-- 定义定制缓存拦截器 -->  <customInterceptors>   <!-- 具体拦截器  class:-->   <interceptor class="-1" after="null" before="null"    position="OTHER_THAN_FIRST_OR_LAST" index="-1" />  </customInterceptors>  <!-- 这个标签用于控制cache容器 -->  <dataContainer   class="org.infinispan.container.DefaultDataContainer">   <properties>    <property name="" />   </properties>  </dataContainer>  <!--死锁发觉器  enabled:默认是false,如果设置true,就会开启死锁侦测。spinDuration:Time period that determines how often is lock acquisition attempted within maximum time allowed to acquire a particular lock-->  <deadlockDetection enabled="true" spinDuration="100" />  <!-- 是否开启JMS监控,JMS可以对缓存进行统一管理监控 -->  <jmxStatistics enabled="true" />  <!-- 缓存集群相关配置,属性mode:d或者dist或者distribution表示分布式,r或者repl或者replication表示复制,i或者inv或者invalidation表示失效,如果设置为l或者local这个缓存就是不支持集群 -->  <clustering mode="distribution">   <!-- 用来定义L1 cache行为动作,如果是其他的cache模式,这个是无效的,enabled:(默认是true,是否启动L1 cache),lifespan:放在L1 cache最大声明周期,onRehash:默认true,条目将会被重新移到l1而不是一块 被移除.invalidationThreshold:决定是广播还是单播操作失效的l1,默认是广播,如果设置为-1,单播将会被使用,如果设置0,广播将会被使用 -->   <l1 enabled="true" lifespan="60000" onRehash="true"    invalidationThreshold="0" />   <!-- 允许微调特性,仅仅用于cache mode是distributed    numVirtualNodes:默认是1,每一个真是节点的虚拟节点    numOwners:每一个集群中节点的备份的数目。默认是2.    rehashWait:以后的标签,当前没用。    rehashEnabled:默认是true,如果设置为false,如果新的节点加入缓存,将不会调整各个节点之间缓存。强烈建议设置为true。    rehashRpcTimeout:重新分配操作缓存的超时时间。    class:提供hash散列算法的类名。    hashFunctionClass:用于used as a bit spreader and a general hash code generator. Typically used in conjunction with the many default   -->   <hash    hashFunctionClass="org.infinispan.util.hash.MurmurHash3"    rehashEnabled="true" numOwners="2" rehashRpcTimeout="120000"    numVirtualNodes="1" rehashWait="60000">    <!-- 定义不同的grouper定义 enabled:是否启用,默认是false -->    <groups enabled="true">     <!-- 定义group具体可参考API文档 -->     <grouper class="" />    </groups>   </hash>   <!-- 同步更新缓存,集群之间的通信是同步通信的。同async是互斥的,不能同时存在。replTimeout:等待远程调用的回复超时时间,如果超时就抛出异常-->   <sync replTimeout="15000" />   <!-- 异步更新缓存通信,集群之间通信是异步通信的。    asyncMarshalling:(默认是false,如果设置为true,异步发送集装是允许的,caller将会返回的更快,但是会遭受重新安排操作)    useReplQueue:(默认是false,如果设置为true,意味着将会强制所有的通讯排队定期的批量发送)    replQueueMaxElements:(默认是1000,如果useReplQueue为true,那么这个属性将会触发发送队列,当达到最大队列的时候就会触发发送)    replQueueClass:(默认是:org.infinispan.remoting.ReplicationQueueImpl,    重写应用队列类,可以让你定义队列的行为控制。)    replQueueInterval:如果useReplQueue为true,那么这个属性将会控制对长时间刷新队列即清空发送队列。   -->   <async asyncMarshalling="true" useReplQueue="true"    replQueueMaxElements="100" replQueueInterval="5000" />   <!-- 配置一个新的cache加入集群如何恢复状态,这个标签仅仅用在cache mode是invalidation和replication集群下面。    timeout:最大等待邻近节点恢复状态时间,超时会抛出异常。    retryWaitTimeIncreaseFactor:等待增加状态成功尝试次数,    alwaysProvideInMemoryState:默认是false,如果设置为true,这个将会允许cache提供内存状态给邻近节点,尽管cache没有配置从邻近节点抓取状态    numRetries:获取状态最大的尝试次数,尝试失败抛出异常    initialRetryWaitTime:在尝试获取传输检索之前回滚初始化等待时间    logFlushTimeout: 同步集群事务日志的最大时间    maxNonProgressingLogWrites:This is the maximum number of non-progressing transaction log writes after which a brute-force flush approach is resorted to, to synchronize transaction logs    fetchInMemoryState:默认是false,如果设置为true,当系统启动的时候引起cache向邻近节点要缓存状态,cache将会启动'warm',它将会印象启动时间   -->   <stateRetrieval maxNonProgressingLogWrites="100"    timeout="240000" retryWaitTimeIncreaseFactor="2"    alwaysProvideInMemoryState="true" numRetries="5"    initialRetryWaitTime="500" logFlushTimeout="60000" />  </clustering>  <!-- 加载器 passivation:默认是false,shared:默认false,preload:默认false-->  <loaders passivation="true" shared="true" preload="true">   <!-- 用户加载存储cache到外部源 ,fetchPersistentState:默认是false,    ignoreModifications:默认是false,忽略cache的更新操作,意味着cache store将会和cache不是同步的    purgeSynchronously:如果设置为true,CacheStore#purgeExpired()调用都是同步来做的    class:类名,但是必须继承org.infinispan.loaders.CacheLoader interface    purgeOnStartup:默认fasle,如果设置设置true,在启动的时候就清空cache store    purgerThreads:清空的线程的数量   -->   <loader purgerThreads="1" purgeOnStartup="true"    fetchPersistentState="true" ignoreModifications="false"    purgeSynchronously="false">    <!-- 配置缓存加载器,如果开启,将提供你异步写入cache存储器,threadPoolSize:(默认是1;)执行写缓存线程池的核心线程数目,enabled:(默认是false,如果设置true,所有的对cache存储器更新操作将是拥有一个独立的线程异步更新,)停止緩存的超时时间,当停止缓存的时候,可能还有新的更新操作,这个时候你就希望把时间设置大一点,放置数据的丢失 -->    <async enabled="true" threadPoolSize="10"     flushLockTimeout="5000" shutdownTimeout="25000" />    <!-- 被用于在集群中只有一个实例的时候,集群的协调者将会用单利来存储     pushStateWhenCoordinator:如果设置为true,当一个节点编程协调者,他将会存储状态到cache store,知道一个新的协调者被选举出来     enabled:false,如果设置为true,单例存储是启动的     pushStateTimeout:如果pushStateWhenCoordinator设置为true,那么这个就是处理内存中状态到cache loader中得最大时间    -->    <singletonStore enabled="false" pushStateTimeout="10000"     pushStateWhenCoordinator="true" />   </loader>  </loaders>  <!-- 定义事务的特性 -->  <transaction eagerLockSingleNode="false"   cacheStopTimeout="30000" useEagerLocking="false"   syncCommitPhase="false" syncRollbackPhase="false"   useSynchronization="false"   transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup">   <!--回复确保了数据子啊书屋资源和结束的时候状态一致。  -->   <recovery enabled="false"    recoveryInfoCacheName="__recoveryInfoCacheName__" />  </transaction> </default></infinispan>




0 0
原创粉丝点击