Package org.infinispan.configuration.cache

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.clustering()


   private Configuration getMetadataCacheConfig() {
      ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();

      //allow the registry to work for local caches as well as isClustered caches
      boolean isClustered = cacheManager.getGlobalComponentRegistry().getGlobalConfiguration().isClustered();
      configurationBuilder.clustering().cacheMode(isClustered ? CacheMode.REPL_SYNC : CacheMode.LOCAL);

      //use a transactional cache for high consistency as writes are expected to be rare in this cache
      configurationBuilder.transaction().transactionMode(TransactionMode.TRANSACTIONAL);

      //fetch the state (redundant as state transfer this is enabled by default, keep it here to document the intention)
View Full Code Here


      //use a transactional cache for high consistency as writes are expected to be rare in this cache
      configurationBuilder.transaction().transactionMode(TransactionMode.TRANSACTIONAL);

      //fetch the state (redundant as state transfer this is enabled by default, keep it here to document the intention)
      configurationBuilder.clustering().stateTransfer().fetchInMemoryState(true);

      return configurationBuilder.build();
   }

   @ManagedOperation(description = "Registers a Protobuf definition file", displayName = "Register Protofile")
View Full Code Here

      for (int i = 0; i < reader.getAttributeCount(); i++) {
         String value = reader.getAttributeValue(i);
         Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
         switch (attribute) {
         case OWNERS: {
            builder.clustering().hash().numOwners(Integer.parseInt(value));
            break;
         }
         case VIRTUAL_NODES: {
            builder.clustering().hash().numVirtualNodes(Integer.parseInt(value));
            break;
View Full Code Here

         case OWNERS: {
            builder.clustering().hash().numOwners(Integer.parseInt(value));
            break;
         }
         case VIRTUAL_NODES: {
            builder.clustering().hash().numVirtualNodes(Integer.parseInt(value));
            break;
         }
         case L1_LIFESPAN: {
            builder.clustering().l1().lifespan(Long.parseLong(value));
            break;
View Full Code Here

         case VIRTUAL_NODES: {
            builder.clustering().hash().numVirtualNodes(Integer.parseInt(value));
            break;
         }
         case L1_LIFESPAN: {
            builder.clustering().l1().lifespan(Long.parseLong(value));
            break;
         }
         default: {
            this.parseClusteredCacheAttribute(reader, i, attribute, value, builder, CacheMode.DIST_ASYNC);
         }
View Full Code Here

@Test(groups = "functional", testName = "query.distributed.MultiNodeLocalTest")
public class MultiNodeLocalTest extends MultiNodeDistributedTest {

   protected EmbeddedCacheManager createCacheManager() throws IOException {
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder
            .clustering()
            .cacheMode(CacheMode.LOCAL)
            .indexing()
            .enabled(true)
            .addProperty("hibernate.search.lucene_version", "LUCENE_CURRENT")
View Full Code Here

    @SuppressWarnings("unchecked")
    @Before
    public void before() {
        ConfigurationBuilder builder = new ConfigurationBuilder();
        builder.clustering().cacheMode(CacheMode.DIST_SYNC);

        when(this.cache.getCacheConfiguration()).thenReturn(builder.build());

        this.manager = new DistributedCacheManager<OutgoingDistributableSessionData>(this.sessionManager, this.cache, this.registry, this.lockManager, this.storage, this.batchingManager, this.invoker);
View Full Code Here

   protected boolean partitionHandling = true;

   @Override
   protected void createCacheManagers() throws Throwable {
      ConfigurationBuilder dcc = getDefaultClusteredCacheConfig(cacheMode);
      dcc.clustering().partitionHandling().enabled(partitionHandling);
      createClusteredCaches(numMembersInCluster, dcc, new TransportFlags().withFD(true).withMerge(true));
      waitForClusterToForm();
   }

View Full Code Here

      // The cache managers are created in the test methods
   }

   private Configuration buildConfiguration(boolean tx) {
      ConfigurationBuilder cb = getDefaultClusteredCacheConfig(CacheMode.REPL_ASYNC, tx);
      cb.clustering()
            .async().useReplQueue(true)
            .replQueueInterval(100)
            .replQueueMaxElements(3);
      // These are the default:
      // .asyncMarshalling(false)
View Full Code Here

      return getDefaultClusteredCacheConfig(mode, transactional, false);
   }

   public static ConfigurationBuilder getDefaultClusteredCacheConfig(CacheMode mode, boolean transactional, boolean useCustomTxLookup) {
      ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(transactional, useCustomTxLookup);
      builder.
         clustering()
            .cacheMode(mode)
            .stateTransfer().fetchInMemoryState(false)
         .transaction().syncCommitPhase(true).syncRollbackPhase(true)
         .cacheStopTimeout(0L);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.