public void removeListInterest(List keys, boolean isDurable, boolean receiveUpdatesAsInvalidates) { this.pool.getRITracker().removeInterestList(this.region, keys, isDurable, receiveUpdatesAsInvalidates); }
/** * Support for server-side interest registration */ public void removeSingleInterest(Object key, int interestType, boolean isDurable, boolean receiveUpdatesAsInvalidates) { this.pool.getRITracker().removeSingleInterest(this.region, key, interestType, isDurable, receiveUpdatesAsInvalidates); }
public List getInterestList(int interestType) { return this.pool.getRITracker().getInterestList(this.regionName, interestType); }
/** * Release use of this pool */ public void detach(boolean keepalive) { this.pool.getRITracker().unregisterRegion(this, keepalive); super.detach(); }
public void addListInterest(List keys, InterestResultPolicy pol, boolean isDurable, boolean receiveUpdatesAsInvalidates) { RegisterInterestTracker rit = this.pool.getRITracker(); boolean finished = false; try { rit.addInterestList(this.region, keys, pol, isDurable, receiveUpdatesAsInvalidates); finished = true; } finally { if (!finished) { rit.removeInterestList(this.region, keys, isDurable, receiveUpdatesAsInvalidates); } } }
private void recoverSingleList(int interestType, Connection recoveredConnection, boolean isDurable, boolean receiveValues, boolean isFirstNewConnection) { Iterator i = this.getPool().getRITracker() .getRegionToInterestsMap(interestType, isDurable, !receiveValues).values().iterator(); while (i.hasNext()) { // restore a region RegionInterestEntry e = (RegionInterestEntry) i.next(); recoverSingleRegion(e.getRegion(), e.getInterests(), interestType, recoveredConnection, isDurable, receiveValues, isFirstNewConnection); } // restore a region }
/** * Support for server-side interest registration */ public void addSingleInterest(Object key, int interestType, InterestResultPolicy pol, boolean isDurable, boolean receiveUpdatesAsInvalidates) { RegisterInterestTracker rit = this.pool.getRITracker(); boolean finished = false; try { rit.addSingleInterest(this.region, key, interestType, pol, isDurable, receiveUpdatesAsInvalidates); finished = true; } finally { if (!finished) { rit.removeSingleInterest(this.region, key, interestType, isDurable, receiveUpdatesAsInvalidates); } } }
private void recoverCqs(Connection recoveredConnection, boolean isDurable) { Map cqs = this.getPool().getRITracker().getCqsMap(); Iterator i = cqs.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = (Map.Entry) i.next(); ClientCQ cqi = (ClientCQ) e.getKey(); String name = cqi.getName(); if (this.pool.getMultiuserAuthentication()) { UserAttributes.userAttributes .set(((DefaultQueryService) this.pool.getQueryService()).getUserAttributes(name)); } try { if (((CqStateImpl) cqi.getState()).getState() != CqStateImpl.INIT) { cqi.createOn(recoveredConnection, isDurable); } } finally { UserAttributes.userAttributes.set(null); } } }
/** * Does a CQ stop on all relevant servers * * @param cq the CQ to stop on the server */ public void stop(ClientCQ cq) { pool.getRITracker().removeCq(cq, cq.isDurable()); StopCQOp.execute(this.pool, cq.getName()); }
/** * Does a CQ close on all relevant servers * * @param cq the CQ to close on the server */ public void close(ClientCQ cq) { pool.getRITracker().removeCq(cq, cq.isDurable()); CloseCQOp.execute(this.pool, cq.getName()); }
/** * Does a region unregisterInterestList on a server * * @param keys list of keys we are interested in * @param isClosing true if this unregister is done by a close * @param keepAlive true if this unregister should not undo a durable registration */ public void unregisterInterestList(List keys, boolean isClosing, boolean keepAlive) { RegisterInterestTracker rit = this.pool.getRITracker(); boolean removed = rit.removeInterestList(this.region, keys, false, true) || rit.removeInterestList(this.region, keys, false, false) || rit.removeInterestList(this.region, keys, true, true) || rit.removeInterestList(this.region, keys, true, false); if (removed) { UnregisterInterestListOp.execute(this.pool, this.regionName, keys, isClosing, keepAlive); } }
regionDataPolicy); } else { final RegisterInterestTracker rit = this.pool.getRITracker(); List result = null; boolean finished = false;
final RegisterInterestTracker rit = this.pool.getRITracker(); List result = null; boolean finished = false;
/** * Does a region unregisterInterest on a server * * @param key describes what we are no longer interested in * @param interestType the {@link InterestType} for this unregister * @param isClosing true if this unregister is done by a close * @param keepAlive true if this unregister should not undo a durable registration */ public void unregisterInterest(Object key, int interestType, boolean isClosing, boolean keepAlive) { if (interestType == InterestType.KEY && key instanceof List) { unregisterInterestList((List) key, isClosing, keepAlive); } else { RegisterInterestTracker rit = this.pool.getRITracker(); boolean removed = rit.removeSingleInterest(this.region, key, interestType, false, false) || rit.removeSingleInterest(this.region, key, interestType, true, false) || rit.removeSingleInterest(this.region, key, interestType, false, true) || rit.removeSingleInterest(this.region, key, interestType, true, true); if (removed) { UnregisterInterestOp.execute(this.pool, this.regionName, key, interestType, isClosing, keepAlive); } } }
/** * Create a continuous query on the given pool * * @param cq the CQ to create on the server */ public Object create(ClientCQ cq) { pool.getRITracker().addCq(cq, cq.isDurable()); byte regionDataPolicyOrdinal = cq.getCqBaseRegion() == null ? (byte) 0 : cq.getCqBaseRegion().getAttributes().getDataPolicy().ordinal; return CreateCQOp.execute(this.pool, cq.getName(), cq.getQueryString(), CqStateImpl.RUNNING, cq.isDurable(), regionDataPolicyOrdinal); }
/** * Create a continuous query on the given server and return the initial query results. * * @param cq the CQ to create on the server */ public SelectResults createWithIR(ClientCQ cq) { pool.getRITracker().addCq(cq, cq.isDurable()); byte regionDataPolicyOrdinal = cq.getCqBaseRegion() == null ? (byte) 0 : cq.getCqBaseRegion().getAttributes().getDataPolicy().ordinal; return CreateCQWithIROp.execute(this.pool, cq.getName(), cq.getQueryString(), CqStateImpl.RUNNING, cq.isDurable(), regionDataPolicyOrdinal); }