當前位置: 首頁>>代碼示例>>Java>>正文


Java MapConfig.setName方法代碼示例

本文整理匯總了Java中com.hazelcast.config.MapConfig.setName方法的典型用法代碼示例。如果您正苦於以下問題:Java MapConfig.setName方法的具體用法?Java MapConfig.setName怎麽用?Java MapConfig.setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.hazelcast.config.MapConfig的用法示例。


在下文中一共展示了MapConfig.setName方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setup

import com.hazelcast.config.MapConfig; //導入方法依賴的package包/類
public DistMapConfig setup(Config cfg, String name, Object storeImplementation) {
    MapConfig mapConfig = new MapConfig();

    //TODO: Refactor the config options
    mapConfig.setName(name);
    mapConfig.setBackupCount(1);

    if (storeImplementation != null) {

        MaxSizeConfig maxSizeConfig = new MaxSizeConfig();
        //todo Refactor this to config
        maxSizeConfig.setSize(1000);

        MapStoreConfig store = new MapStoreConfig();
        store.setImplementation(storeImplementation);

        mapConfig.setMaxSizeConfig(maxSizeConfig);
        mapConfig.setMapStoreConfig(store);
    }

    cfg.addMapConfig(mapConfig);

    return this;
}
 
開發者ID:Esquive,項目名稱:iticrawler,代碼行數:25,代碼來源:DistMapConfig.java

示例2: testEvictedEntryNotNullAfterLockAndGet

import com.hazelcast.config.MapConfig; //導入方法依賴的package包/類
/**
 * Test for Issue 710
 */
@Test
public void testEvictedEntryNotNullAfterLockAndGet() throws Exception {
    String mapName = "testLock";
    Config config = new XmlConfigBuilder().build();
    MapConfig mapConfig = new MapConfig();
    mapConfig.setName(mapName);
    mapConfig.setTimeToLiveSeconds(3);
    config.addMapConfig(mapConfig);
    HazelcastInstance h1 = Hazelcast.newHazelcastInstance(config);
    IMap<Object, Object> m1 = h1.getMap(mapName);
    m1.put(1, 1);
    assertEquals(1, m1.get(1));
    Thread.sleep(5000);
    assertEquals(null, m1.get(1));
    m1.lock(1);
    assertEquals(null, m1.get(1));
    m1.put(1, 1);
    assertEquals(1, m1.get(1));
}
 
開發者ID:mdogan,項目名稱:hazelcast-archive,代碼行數:23,代碼來源:ClusterLockTest.java

示例3: init

import com.hazelcast.config.MapConfig; //導入方法依賴的package包/類
public void init() {

        //Specific map time to live
        MapConfig myMapConfig = new MapConfig();
        myMapConfig.setName("cachetest");
        myMapConfig.setTimeToLiveSeconds(10);

        //Package config
        Config myConfig = new Config();
        myConfig.addMapConfig(myMapConfig);

        //Symmetric Encryption
        SymmetricEncryptionConfig symmetricEncryptionConfig = new SymmetricEncryptionConfig();
        symmetricEncryptionConfig.setAlgorithm("DESede");
        symmetricEncryptionConfig.setSalt("saltysalt");
        symmetricEncryptionConfig.setPassword("lamepassword");
        symmetricEncryptionConfig.setIterationCount(1337);

        //Weak Network config..
        NetworkConfig networkConfig = new NetworkConfig();
        networkConfig.setSymmetricEncryptionConfig(symmetricEncryptionConfig);

        myConfig.setNetworkConfig(networkConfig);

        Hazelcast.init(myConfig);

        cacheMap = Hazelcast.getMap("cachetest");
    }
 
開發者ID:blackarbiter,項目名稱:Android_Code_Arbiter,代碼行數:29,代碼來源:HazelcastSymmetric.java

示例4: HazelcastApp

import com.hazelcast.config.MapConfig; //導入方法依賴的package包/類
public HazelcastApp(String name, int id) {
    this.id = id;
    Config config = new Config();
    MapConfig mapConfig = new MapConfig();
    mapConfig.setName("nodes");
    mapConfig.addEntryListenerConfig(new EntryListenerConfig(MapEntryListener.class.getCanonicalName(), false, true));
    config.addMapConfig(mapConfig);
    config.setInstanceName(name + id);
    hazelcastInstance = Hazelcast.newHazelcastInstance(config);
}
 
開發者ID:masgari,項目名稱:microservices-sample,代碼行數:11,代碼來源:HazelcastApp.java

示例5: create

import com.hazelcast.config.MapConfig; //導入方法依賴的package包/類
public MapConfig create() {
	
	MapConfig mapConfig = new MapConfig();
	mapConfig.setName(HazelcastData.INVENTORY_ITEM_AGGREGATE_HISTORY.name());
	mapConfig.setInMemoryFormat(MapConfig.DEFAULT_IN_MEMORY_FORMAT);
	
	MapStoreConfig mapStoreConfig = new MapStoreConfig();
	mapStoreConfig.setImplementation(mapStore);
	mapStoreConfig.setEnabled(true);
	mapStoreConfig.setWriteDelaySeconds(writeDelaySeconds); 
	/* writeDelaySeconds > 0 means write-behind. */
	mapConfig.setMapStoreConfig(mapStoreConfig);
	
	return mapConfig;
}
 
開發者ID:rodolfodpk,項目名稱:myeslib,代碼行數:16,代碼來源:InventoryItemMapConfigFactory.java

示例6: testUseBackupDataGet

import com.hazelcast.config.MapConfig; //導入方法依賴的package包/類
@Test
public void testUseBackupDataGet() throws Exception {
    final Config config = new Config();
    final MapConfig mapConfig = new MapConfig();
    mapConfig.setName("q");
    mapConfig.setReadBackupData(true);
    config.setMapConfigs(Collections.singletonMap(mapConfig.getName(), mapConfig));
    HazelcastInstance h1 = Hazelcast.newHazelcastInstance(config);
    HazelcastInstance h2 = Hazelcast.newHazelcastInstance(config);
    h1.getMap("q").put("q", "Q");
    Thread.sleep(50L);
    final IMap<Object, Object> map2 = h2.getMap("q");
    assertEquals("Q", map2.get("q"));
}
 
開發者ID:mdogan,項目名稱:hazelcast-archive,代碼行數:15,代碼來源:HazelcastClusterTest.java

示例7: testUseBackupDataGet

import com.hazelcast.config.MapConfig; //導入方法依賴的package包/類
@Test
public void testUseBackupDataGet() throws Exception {
    final Config config = new Config();
    final MapConfig mapConfig = new MapConfig();
    mapConfig.setName("q");
    mapConfig.setReadBackupData(true);
    config.setMapConfigs(Collections.singletonMap(mapConfig.getName(), mapConfig));
    HazelcastInstance h1 = Hazelcast.newHazelcastInstance(config);
    HazelcastInstance h2 = Hazelcast.newHazelcastInstance(config);
    h1.getMap("q").put("q", "Q");
    Thread.sleep(50L);
    HazelcastClient client = newHazelcastClient(h2);
    assertEquals("Q", client.getMap("q").get("q"));
}
 
開發者ID:mdogan,項目名稱:hazelcast-archive,代碼行數:15,代碼來源:HazelcastClientClusterTest.java


注:本文中的com.hazelcast.config.MapConfig.setName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。