This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.hazelcast.config.Config; | |
| import com.hazelcast.config.MapConfig; | |
| import com.hazelcast.config.MapStoreConfig; | |
| import com.hazelcast.core.Hazelcast; | |
| import com.hazelcast.core.HazelcastInstance; | |
| import com.hazelcast.core.IMap; | |
| import com.hazelcast.core.MapStore; | |
| import java.util.Collection; | |
| import java.util.HashSet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void main(String args[]) throws Exception { | |
| MapStoreFactory factory = new MapStoreFactory() { | |
| @Override | |
| public MapLoader newMapStore(String mapName, Properties properties) { | |
| return new BasicMapStore(mapName); | |
| } | |
| }; | |
| final Config config = new Config(); | |
| MapConfig mapConfig = config.getMapConfig("default"); | |
| MapStoreConfig mapStoreConfig = new MapStoreConfig(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Config config = new Config(); | |
| OffHeapMemoryConfig memoryConfig = config.getOffHeapMemoryConfig(); | |
| memoryConfig.setEnabled(true); | |
| memoryConfig.setSize(new MemorySize(512, MemoryUnit.MEGABYTES)); | |
| config.setLicenseKey("LICENSE"); | |
| SecurityConfig securityConfig = config.getSecurityConfig(); | |
| securityConfig.setEnabled(true); | |
| final PermissionConfig permissionConfig = new PermissionConfig(); | |
| permissionConfig.setType(PermissionConfig.PermissionType.ALL); | |
| permissionConfig.setName("*"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void testPagingPredicate() { | |
| HazelcastInstance instance = Hazelcast.newHazelcastInstance(); | |
| IMap<Object, Object> map = instance.getMap("map"); | |
| for (int i = 0; i < 20; i++) { | |
| map.put(i, i); | |
| } | |
| PagingPredicate pagingPredicate = getPagingPredicate(0, 10, null); | |
| Collection<Object> values = map.values(pagingPredicate); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void main(String[] args) { | |
| Config config = new Config(); | |
| QueueConfig queueConfig = config.getQueueConfig("q"); | |
| QueueStoreConfig queueStoreConfig = new QueueStoreConfig(); | |
| queueStoreConfig.setEnabled(true); | |
| queueStoreConfig.setProperty("memory-limit", "10"); | |
| queueStoreConfig.setStoreImplementation(new QueueStore() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class GurbuzTest { | |
| public static void main(String[] args) { | |
| Config config = new Config(); | |
| MapConfig mapConfig = new MapConfig(); | |
| mapConfig.setName("query.archive.*"); | |
| MapStoreConfig mapStoreConfig = new MapStoreConfig(); | |
| mapStoreConfig.setEnabled(true).setFactoryImplementation(new MyFac()); | |
| mapConfig.setMapStoreConfig(mapStoreConfig); | |
| config.addMapConfig(mapConfig); | |
| HazelcastInstance instance = Hazelcast.newHazelcastInstance(config); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package compile; | |
| import com.hazelcast.config.Config; | |
| import com.hazelcast.core.EntryAdapter; | |
| import com.hazelcast.core.EntryEvent; | |
| import com.hazelcast.core.EntryListener; | |
| import com.hazelcast.core.Hazelcast; | |
| import com.hazelcast.core.HazelcastInstance; | |
| import com.hazelcast.core.IMap; | |
| import com.hazelcast.core.MapEvent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |