Skip to content

Instantly share code, notes, and snippets.

View gurbuzali's full-sized avatar
🏠
Working from home

Ali Gurbuz gurbuzali

🏠
Working from home
View GitHub Profile
public class ClientProcessTest {
static {
System.setProperty(GroupProperties.PROP_WAIT_SECONDS_BEFORE_JOIN, "0");
System.setProperty("java.net.preferIPv4Stack", "true");
System.setProperty("hazelcast.local.localAddress", "127.0.0.1");
System.setProperty("hazelcast.version.check.enabled", "false");
System.setProperty("hazelcast.socket.bind.any", "true");
Random rand = new Random();
public class ClientProcess {
public static void main(String[] args) {
final ClientConfig clientConfig = new ClientConfig();
clientConfig.setConnectionPoolSize(Integer.valueOf(args[0]));
final HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
final IMap<Object,Object> map = client.getMap("map");
final Random random = new Random(System.currentTimeMillis());
final byte[] bytes = new byte[100];
final String mapName = "map";
final int count = 200000;
boolean nearCache = false;
int threadCount = 1;
final ClientConfig clientConfig = new ClientConfig();
clientConfig.addAddress("127.0.0.1:5701");
if (nearCache) {
final NearCacheConfig nearCacheConfig = new NearCacheConfig();
public static void main(String[] args) throws Exception {
final Config config = new Config();
final MapConfig mapConfig = config.getMapConfig("map");
final MapStoreConfig mapStoreConfig = new MapStoreConfig();
mapStoreConfig.setEnabled(true);
mapStoreConfig.setWriteDelaySeconds(3);
final MyMapStore myMapStore = new MyMapStore();
mapStoreConfig.setImplementation(myMapStore);
mapConfig.setMapStoreConfig(mapStoreConfig);
@gurbuzali
gurbuzali / max-idle-test
Last active August 29, 2015 14:03
max-idle test
public static void main(String[] args) throws Exception {
final Config config = new Config();
final MapConfig mapConfig = config.getMapConfig("default");
mapConfig.setBackupCount(0).setAsyncBackupCount(1).setMaxIdleSeconds(10);
final HazelcastInstance instance1 = Hazelcast.newHazelcastInstance(config);
final HazelcastInstance instance2 = Hazelcast.newHazelcastInstance(config);
final IMap<Object, Object> map = instance1.getMap("default");
@gurbuzali
gurbuzali / ttl-node-up-down
Created July 8, 2014 14:34
ttl while node coming/going
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) {
@gurbuzali
gurbuzali / map-store-performance
Last active August 29, 2015 14:03
map-store-performance
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;
@gurbuzali
gurbuzali / queue-transaction-stabilizer
Created July 16, 2014 07:24
Stabilzer Test transaction queue
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;
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;
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