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
| 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
| 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
| 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
| 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
| Development Cycle: | |
| By starting today we're switching to a pull-request based development. Instead of pushing directly to main repo (github.com/hazelcast/hazelcast), everybody should push his bugfix/improvement/feature to his own git fork and send a pull request to merge with main repo. There will be no direct push to main repo branches. | |
| This requires everybody to work two separate remote repositories. First of all, everybody should have a fork of main repo in their own account (I guess nearly everybody has already a fork at the moment). If not, go to github.com/hazelcast/hazelcast and press the fork button (top rlght of the page). There may be lots of ways of working with multiple remote repos. I'll try to explain how I work, you can find an easier/comfortable way of your own.. | |
| Currently I (and most of you) already have a default remote named 'origin' for main repo. Add your own repo as another remote (You can list current remotes using: git remote -v); | |
| git remote add mdogan [email protected]:mdogan/hazelca |
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 yourgroupid; | |
| import com.hazelcast.core.HazelcastInstance; | |
| import com.hazelcast.core.ILock; | |
| import com.hazelcast.core.IQueue; | |
| import com.hazelcast.core.TransactionalQueue; | |
| import com.hazelcast.logging.ILogger; | |
| import com.hazelcast.logging.Logger; | |
| import com.hazelcast.stabilizer.tests.TestContext; | |
| import com.hazelcast.stabilizer.tests.TestRunner; |
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 yourgroupid; | |
| import com.hazelcast.core.HazelcastInstance; | |
| import com.hazelcast.core.ILock; | |
| import com.hazelcast.core.IQueue; | |
| import com.hazelcast.core.TransactionalQueue; | |
| import com.hazelcast.logging.ILogger; | |
| import com.hazelcast.logging.Logger; | |
| import com.hazelcast.stabilizer.tests.TestContext; |
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.MapIndexConfig; | |
| 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.io.Serializable; |
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 { | |
| final Config config = new Config(); | |
| HazelcastInstance instance1 = Hazelcast.newHazelcastInstance(config); | |
| HazelcastInstance instance2 = Hazelcast.newHazelcastInstance(config); | |
| final IMap<Object, Object> map = instance1.getMap("default"); | |
| final long begin = System.currentTimeMillis(); | |
| map.put("key", "value", 620, TimeUnit.SECONDS); | |
| while (true) { |