Package com.hazelcast.core

Examples of com.hazelcast.core.HazelcastInstance


    private BlockingQueue<String> map;

    @Override
    protected void doPostSetup() throws Exception {
        HazelcastComponent component = context().getComponent("hazelcast", HazelcastComponent.class);
        HazelcastInstance hazelcastInstance = component.getHazelcastInstance();
        this.map = hazelcastInstance.getQueue("mm");
        this.map.clear();
    }
View Full Code Here



    @Override
    protected void doPostSetup() throws Exception {
        HazelcastComponent component = context().getComponent("hazelcast", HazelcastComponent.class);
        HazelcastInstance hazelcastInstance = component.getHazelcastInstance();
        this.map = hazelcastInstance.getMultiMap("mm");
        this.map.clear();
    }
View Full Code Here

    @Override
    protected void doPostSetup() throws Exception {
        super.doPostSetup();
        HazelcastComponent component = context().getComponent("hazelcast", HazelcastComponent.class);
        HazelcastInstance hazelcastInstance = component.getHazelcastInstance();
        this.map = hazelcastInstance.getMap("foo");
        this.map.clear();
    }
View Full Code Here

    private BlockingQueue<String> queue;

    @Override
    protected void doPostSetup() throws Exception {
        HazelcastComponent component = context().getComponent("hazelcast", HazelcastComponent.class);
        HazelcastInstance hazelcastInstance = component.getHazelcastInstance();
        queue = hazelcastInstance.getQueue("bar");
        queue.clear();
    }
View Full Code Here

    public void testDefaultInstance() throws InterruptedException {
        HazelcastServiceFactory factory = new HazelcastServiceFactory();
        factory.setUsername(GroupConfig.DEFAULT_GROUP_NAME);
        factory.setPassword(GroupConfig.DEFAULT_GROUP_PASSWORD);
        factory.createOrUpdate(null);
        HazelcastInstance defaultInstance = Hazelcast.newHazelcastInstance(null);
        HazelcastInstance factoryInstance = factory.buildInstance();
        Assert.assertEquals(true, factoryInstance.getCluster().getMembers().size() >= 2);
    }
View Full Code Here

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
       
        // Query param named 'hazelcastInstance' (if exists) overrides the instance that was set
        // programmatically and cancels local instance creation as well.
        HazelcastInstance hzInstance = resolveAndRemoveReferenceParameter(parameters, "hazelcastInstance",
                HazelcastInstance.class);
        // Now we use the hazelcastInstance from compomnent
        if (hzInstance == null) {
            hzInstance = hazelcastInstance;
        }
View Full Code Here

public class HazelcastQueueThroughputTest {
  private static final int TOTAL = 1000000;
  private static final int LAP   = 100000;

  public static void main(String[] args) throws InterruptedException {
    final HazelcastInstance hz = Hazelcast.newHazelcastInstance();
    final IQueue<Object> queue = hz.getQueue("test");

    final long start = System.currentTimeMillis();
    long lastLap = start;

    Thread t = new Thread() {
View Full Code Here

    @Override
    public <SuppliedValue, Result> Result aggregate(Supplier<K, V, SuppliedValue> supplier,
                                                    Aggregation<K, SuppliedValue, Result> aggregation) {


        HazelcastInstance hazelcastInstance = getNodeEngine().getHazelcastInstance();
        JobTracker jobTracker = hazelcastInstance.getJobTracker("hz::aggregation-multimap-" + getName());
        return aggregate(supplier, aggregation, jobTracker);
    }
View Full Code Here

    @Override
    public <SuppliedValue, Result> Result aggregate(Supplier<K, V, SuppliedValue> supplier,
                                                    Aggregation<K, SuppliedValue, Result> aggregation) {

        HazelcastInstance hazelcastInstance = getNodeEngine().getHazelcastInstance();
        JobTracker jobTracker = hazelcastInstance.getJobTracker("hz::aggregation-map-" + getName());
        return aggregate(supplier, aggregation, jobTracker);
    }
View Full Code Here

        }
        if (o == null || !(o instanceof HazelcastInstance)) {
            return false;
        }

        HazelcastInstance that = (HazelcastInstance) o;
        return !(name != null ? !name.equals(that.getName()) : that.getName() != null);
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.core.HazelcastInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.