@Override public void init(NodeEngine nodeEngine, Properties properties) { this.nodeEngine = nodeEngine; containers = new Container[nodeEngine.getPartitionService().getPartitionCount()]; for (int i = 0; i < containers.length; i++) { containers[i] = new Container(); } }
@Override public void destroyDistributedObject(String objectName) { int partitionId = nodeEngine.getPartitionService().getPartitionId(objectName); Container container = containers[partitionId]; container.destroy(objectName); }
private Set<Integer> getPartitionsForKeys(Set<Data> keys) { IPartitionService partitionService = getNodeEngine().getPartitionService(); int partitions = partitionService.getPartitionCount(); int capacity = Math.min(partitions, keys.size()); Set<Integer> partitionIds = createHashSet(capacity); Iterator<Data> iterator = keys.iterator(); while (iterator.hasNext() && partitionIds.size() < partitions) { Data key = iterator.next(); partitionIds.add(partitionService.getPartitionId(key)); } return partitionIds; } }
protected MyPriorityQueueServiceProxy(String name, NodeEngine nodeEngine, MyPriorityQueueService myPriorityQueueService) { super(nodeEngine, myPriorityQueueService); this.name = name; this.nodeEngine = nodeEngine; this.partitionId = nodeEngine.getPartitionService().getPartitionId(this.name); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { this.nodeEngine = nodeEngine; containers = new Container[nodeEngine.getPartitionService().getPartitionCount()]; for (int i = 0; i < containers.length; i++) { containers[i] = new Container(); } }
@Override public CounterProxy createDistributedObject(String objectName) { int partitionId = nodeEngine.getPartitionService().getPartitionId(objectName); Container container = containers[partitionId]; container.init(objectName); return new CounterProxy(objectName, nodeEngine, this); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { this.nodeEngine = nodeEngine; containers = new Container[nodeEngine.getPartitionService().getPartitionCount()]; for (int i = 0; i < containers.length; i++) { containers[i] = new Container(); } }
@Override public int getPartitionId(Object object) { assert object != null; if (object instanceof Data) { nodeEngine.getPartitionService().getPartitionId((Data) object); } return nodeEngine.getPartitionService().getPartitionId(object); }
private BitSet toPartitionBitSet() { BitSet bitSet = new BitSet(getNodeEngine().getPartitionService().getPartitionCount()); for (int partition : partitions) { bitSet.set(partition); } return bitSet; }
@Override public int getPartitionId(Object object) { assert object != null; if (object instanceof Data) { nodeEngine.getPartitionService().getPartitionId((Data) object); } return nodeEngine.getPartitionService().getPartitionId(object); }
private void fireMapDataLoadingTasks() { for (int i = 0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) { requestDataForPartition(i); } }
@Override public DistributedObject createDistributedObject(String objectName) { int partitionId = nodeEngine.getPartitionService().getPartitionId(objectName); Container container = containers[partitionId]; container.init(objectName); return new CounterProxy(objectName, nodeEngine, this); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { this.nodeEngine = nodeEngine; containers = new Container[nodeEngine.getPartitionService().getPartitionCount()]; for (int i = 0; i < containers.length; i++) { containers[i] = new Container(); } }
@Override public DistributedObject createDistributedObject(String objectName) { int partitionId = nodeEngine.getPartitionService().getPartitionId(objectName); Container container = containers[partitionId]; container.init(objectName); return new CounterProxy(objectName, nodeEngine, this); }
DurableExecutorServiceProxy(NodeEngine nodeEngine, DistributedDurableExecutorService service, String name) { super(nodeEngine, service); this.name = name; this.logger = nodeEngine.getLogger(DurableExecutorServiceProxy.class); this.partitionCount = nodeEngine.getPartitionService().getPartitionCount(); }
@Override public void destroyDistributedObject(String objectName) { int partitionId = nodeEngine.getPartitionService().getPartitionId(objectName); Container container = containers[partitionId]; container.destroy(objectName); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { int partitionCount = nodeEngine.getPartitionService().getPartitionCount(); this.nodeEngine = nodeEngine; this.partitions = new ScheduledExecutorPartition[partitionCount]; reset(); }
public CountDownLatchProxy(String name, NodeEngine nodeEngine) { super(nodeEngine, null); this.name = name; Data nameAsPartitionAwareData = getNameAsPartitionAwareData(); this.partitionId = nodeEngine.getPartitionService().getPartitionId(nameAsPartitionAwareData); }
private BitSet toPartitionBitSet() { BitSet bitSet = new BitSet(getNodeEngine().getPartitionService().getPartitionCount()); for (int partition : partitions) { bitSet.set(partition); } return bitSet; }
private int getPartitionId(String name) { IPartitionService partitionService = nodeEngine.getPartitionService(); String partitionKey = getPartitionKey(name); return partitionService.getPartitionId(partitionKey); }