/** * constructs the Thread and initializes the expiry time * */ public ThreadIdToSequenceIdExpiryTask() { expiryTime = QueueStateImpl.this.qManager.getPool().getSubscriptionMessageTrackingTimeout(); }
public void emergencyClose() { destroyed = true; manager.emergencyClose(); queueManager.emergencyClose(); }
/** * Test hook to get a connection to the primary server. */ public Connection getPrimaryConnection() { if (this.queueManager != null) { QueueManager.QueueConnections cons = this.queueManager.getAllConnections(); return cons.getPrimary(); } return null; }
* qManager.getPool().getSubscriptionTimeoutMultiplier() * 1.25); if (this.qManager.getState().verifyIfDuplicate(eventId, !(this.isDurableClient || isDeltaSent))) { continue; this.qManager.getState().verifyIfDuplicate(eventId, true); this.qManager.checkEndpoint(this, this.endpoint);
PrimaryAckOp.execute(qManager.getAllConnections().getPrimary(), qManager.getPool(), events); success = true;
/** * Test hook that returns the ThreadIdToSequenceIdMap */ public Map getThreadIdToSequenceIdMap() { if (this.queueManager == null) return Collections.emptyMap(); if (this.queueManager.getState() == null) return Collections.emptyMap(); return this.queueManager.getState().getThreadIdToSequenceIdMap(); }
throw new SubscriptionNotEnabledException(); Connection primary = this.queueManager.getAllConnectionsNoWait().getPrimary(); if (primary != null && !map.containsKey(primary.getServer())) { Long userId = (Long) AuthenticateUserOp.executeOn(primary.getServer(), this, List<Connection> backups = this.queueManager.getAllConnectionsNoWait().getBackups(); for (int i = 0; i < backups.size(); i++) { Connection conn = backups.get(i);
public InternalLogWriter getSecurityLogger() { return this.qManager.getSecurityLogger(); }
public void readyForEvents(InternalDistributedSystem system) { if (!isDurableClient() || queueManager == null) { return; } this.readyForEventsCalled = true; queueManager.readyForEvents(system); }
queueManager.close(keepAlive);
logger.debug("starting queueManager"); queueManager.start(backgroundProcessor);
/** * test hook */ public int getInvalidateCount() { return ((QueueStateImpl) this.queueManager.getState()).getInvalidateCount(); }
QueueConnections connections = queueManager.getAllConnectionsNoWait(); Connection primary = connections.getPrimary(); if (primary != null) {
private Part requestFullValue(EventID eventId, String reason) throws Exception { if (isUsedByTest) { fullValueRequested = true; } final boolean isDebugEnabled = logger.isDebugEnabled(); if (isDebugEnabled) { logger.debug("{} Requesting full value...", reason); } Part result = (Part) GetEventValueOp.executeOnPrimary(this.qManager.getPool(), eventId, null); if (result == null) { // Just log a warning. Do not stop CCU thread. // TODO: throw a subclass of Exception throw new Exception("Could not retrieve full value for " + eventId); } if (isDebugEnabled) { logger.debug("Full value received."); } return result; }
/** * Test hook. Verify if this EventId is already present in the map or not. If it is already * present then return true. * * @param eventId the EventId of the incoming event * @return true if it is already present * @since GemFire 5.1 */ public boolean verifyIfDuplicate(EventID eventId) { return ((QueueStateImpl) this.queueManager.getState()).verifyIfDuplicate(eventId); }
/** * Test hook that returns a list of ServerLocation instances. Each ServerLocation describes a * redundant server. An empty list is returned if we have no redundant servers. */ public List<ServerLocation> getRedundants() { List result = Collections.emptyList(); if (this.queueManager != null) { QueueManager.QueueConnections cons = this.queueManager.getAllConnections(); List<Connection> backupCons = cons.getBackups(); if (backupCons.size() > 0) { result = new ArrayList(backupCons.size()); Iterator<Connection> it = backupCons.iterator(); while (it.hasNext()) { Connection con = it.next(); result.add(con.getServer()); } } } return result; }
QueueConnections qcs = this.queueManager.getAllConnectionsNoWait(); conn = qcs.getConnection(ep); if (conn != null) {
void checkForExpiry() { synchronized (threadIdToSequenceId) { Iterator iterator = threadIdToSequenceId.entrySet().iterator(); long currentTime = System.currentTimeMillis(); Map.Entry entry; SequenceIdAndExpirationObject seo; while (iterator.hasNext()) { entry = (Map.Entry) iterator.next(); seo = (SequenceIdAndExpirationObject) entry.getValue(); if ((currentTime - seo.getCreationTime() > this.expiryTime)) { if (seo.getAckSend() || (qManager.getPool().getSubscriptionRedundancy() == 0 && !qManager.getPool().isDurableClient())) { iterator.remove(); } } else { break; } } } }
public boolean verifyIfDuplicate(EventID eventId, boolean addToMap) { return ((QueueStateImpl) this.queueManager.getState()).verifyIfDuplicate(eventId); }
/** * Test hook that returns a string consisting of the host name and port of the primary server. * Null is returned if we have no primary. */ public ServerLocation getPrimary() { ServerLocation result = null; if (this.queueManager != null) { QueueManager.QueueConnections cons = this.queueManager.getAllConnections(); Connection con = cons.getPrimary(); result = con.getServer(); } return result; }