com.hazelcast.config.MapIndexConfig Java Examples
The following examples show how to use
com.hazelcast.config.MapIndexConfig.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MapsConfig.java From eventapis with Apache License 2.0 | 6 votes |
@Override public Config configure(Config config) { List<MapIndexConfig> indexes = Arrays.asList( new MapIndexConfig("startTime", true), new MapIndexConfig("operationState", true) ); config.getMapConfig(OPERATIONS_MAP_NAME) .setTimeToLiveSeconds(OPERATIONS_MAX_TTL_INSEC) .setMapIndexConfigs(indexes); config.getMapConfig(OPERATIONS_MAP_HISTORY_NAME) .setMapIndexConfigs(indexes) .setMaxSizeConfig(new MaxSizeConfig(evictFreePercentage, MaxSizeConfig.MaxSizePolicy.FREE_HEAP_PERCENTAGE)) .setEvictionPolicy(EvictionPolicy.LRU); config.getReplicatedMapConfig(TOPICS_MAP_NAME); return config; }
Example #2
Source File: HazelcastOperationMapsConfig.java From eventapis with Apache License 2.0 | 6 votes |
@Override public Config configure(Config config) { List<MapIndexConfig> indexes = Arrays.asList( new MapIndexConfig("spanningServices[any].serviceName", true) ); MapConfig mapConfig = new MapConfig(EVENTS_OPS_MAP_NAME) .setMapIndexConfigs(indexes) .setMaxSizeConfig(new MaxSizeConfig(evictFreePercentage, MaxSizeConfig.MaxSizePolicy.FREE_HEAP_PERCENTAGE)) .setEvictionPolicy(EvictionPolicy.LRU) .setQuorumName("default") .setName(EVENTS_OPS_MAP_NAME); config.addMapConfig(mapConfig); return config; }
Example #3
Source File: StaticMapConfig.java From hazelcast-demo with Apache License 2.0 | 5 votes |
public static void main(String[] args) { MapConfig mapConfig = new MapConfig(); mapConfig.setName("cacheMap")// 设置Map名称 .setInMemoryFormat(InMemoryFormat.BINARY)// 设置内存格式 .setBackupCount(1);// 设置副本个数 mapConfig.getMapStoreConfig()// .setWriteDelaySeconds(60)// .setWriteBatchSize(1000);// 设置缓存格式 mapConfig.addMapIndexConfig(new MapIndexConfig().setAttribute("id").setOrdered(true));// 增加索引 mapConfig.addMapIndexConfig(new MapIndexConfig().setAttribute("name").setOrdered(true)); }
Example #4
Source File: HazelcastHttpSessionConfig.java From spring-session with Apache License 2.0 | 5 votes |
@Bean public HazelcastInstance hazelcastInstance() { Config config = new Config(); MapAttributeConfig attributeConfig = new MapAttributeConfig() .setName(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE) .setExtractor(PrincipalNameExtractor.class.getName()); config.getMapConfig(HazelcastIndexedSessionRepository.DEFAULT_SESSION_MAP_NAME) // <2> .addMapAttributeConfig(attributeConfig).addMapIndexConfig( new MapIndexConfig(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false)); return Hazelcast.newHazelcastInstance(config); // <3> }
Example #5
Source File: SessionConfig.java From spring-session with Apache License 2.0 | 5 votes |
@Bean(destroyMethod = "shutdown") public HazelcastInstance hazelcastInstance() { Config config = new Config(); NetworkConfig networkConfig = config.getNetworkConfig(); networkConfig.setPort(0); networkConfig.getJoin().getMulticastConfig().setEnabled(false); MapAttributeConfig attributeConfig = new MapAttributeConfig() .setName(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE) .setExtractor(PrincipalNameExtractor.class.getName()); config.getMapConfig(HazelcastIndexedSessionRepository.DEFAULT_SESSION_MAP_NAME) .addMapAttributeConfig(attributeConfig).addMapIndexConfig( new MapIndexConfig(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false)); return Hazelcast.newHazelcastInstance(config); }
Example #6
Source File: HazelcastITestUtils.java From spring-session with Apache License 2.0 | 5 votes |
/** * Creates {@link HazelcastInstance} for use in integration tests. * @return the Hazelcast instance */ static HazelcastInstance embeddedHazelcastServer() { Config config = new Config(); NetworkConfig networkConfig = config.getNetworkConfig(); networkConfig.setPort(0); networkConfig.getJoin().getMulticastConfig().setEnabled(false); MapAttributeConfig attributeConfig = new MapAttributeConfig() .setName(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE) .setExtractor(PrincipalNameExtractor.class.getName()); config.getMapConfig(HazelcastIndexedSessionRepository.DEFAULT_SESSION_MAP_NAME) .addMapAttributeConfig(attributeConfig).addMapIndexConfig( new MapIndexConfig(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false)); return Hazelcast.newHazelcastInstance(config); }