public void run() { SearchLoadAndWriteProcessor processor = SearchLoadAndWriteProcessor.getProcessor(); processor.initialize((LocalRegion)region, "key1", null); processor.testNetSearchMessageDoGet(region.getName(), "key1", 1500, 1500, 1500); } }
static SearchLoadAndWriteProcessor getProcessor() { SearchLoadAndWriteProcessor processor = new SearchLoadAndWriteProcessor(); processor.processorId = getProcessorKeeper().put(processor); return processor; }
if (requestorTimedOut) { logFine("incomingNetSearchReply() - requestorTimedOut", this); signalTimedOut(); computeRemainingTimeout(); if (value != null || authorative) { synchronized (this) { this.authorative = authorative; this.versionTag = versionTag; logFine("incomingNetSearchReply() - got obj", this); signalDone(); logFine("incomingNetSearchReply() - null obj, no more time", this); signalDone(); // @todo: is this a bug? should call signalTimedOut? logFine("incomingNetSearchReply() - null obj, sendNetSearchRequest", this); sendNetSearchRequest(); logFine("incomingNetSearchReply() - requestInProgress is false", this); checkIfDone();
/** * This is the response from the accepted responder. */ protected void incomingNetWriteReply(boolean netWriteSuccessful,Exception e, boolean exe) { synchronized (this) { this.remoteException = e; this.netWriteSucceeded = netWriteSuccessful; computeRemainingTimeout(); signalDone(); } }
/** * This is the response from the accepted responder. * Grab the result and store it.Unlike 2.0 where the * the response was a 2 phase operation, here it is a * single phase operation. */ protected void incomingNetLoadReply(Object obj, long lastModifiedTime, Object callbackArg, Exception e, boolean serialized, boolean requestorTimedOut) { synchronized (this) { if (requestorTimedOut) { signalTimedOut(); return; } this.result = obj; this.lastModified = lastModifiedTime; this.remoteException = e; this.aCallbackArgument = callbackArg; computeRemainingTimeout(); this.isSerialized = serialized; signalDone(); } } @SuppressWarnings("hiding")
try { SearchLoadAndWriteProcessor processor = SearchLoadAndWriteProcessor.getProcessor(); processor.initialize(this, "preUpdate", null); try { if (!isNewKey) { processor.doNetWrite(event, netWriteRecipients, localWriter, SearchLoadAndWriteProcessor.BEFOREUPDATE); processor.doNetWrite(event, netWriteRecipients, localWriter, SearchLoadAndWriteProcessor.BEFORECREATE); processor.release();
searcher = SearchLoadAndWriteProcessor.getProcessor(); removeSearcher = true; searcher.initialize((LocalRegion)this.region,this.key, this.aCallbackArgument); obj = searcher.doNetSearch(); if (searcher.resultIsSerialized()) { obj = EntryEventImpl.deserialize((byte[])obj); obj = searcher.doNetLoad(); if (searcher.resultIsSerialized()) { obj = EntryEventImpl.deserialize((byte[])obj); searcher.remove();
SearchLoadAndWriteProcessor.getProcessor(); try { processor.initialize(this, key, aCallbackArgument); processor.doSearchAndLoad(event, txState, localValue); if (clientEvent != null && clientEvent.getVersionTag() == null) { clientEvent.setVersionTag(event.getVersionTag()); lastModified = processor.getLastModified(); processor.release();
private synchronized void sendNetSearchRequest() { InternalDistributedMember nextResponder = nextAppropriateResponder(); if (nextResponder != null) { // Make a request to the next responder in the queue RegionAttributes attrs = this.region.getAttributes(); setSelectedNode(nextResponder); this.requestInProgress = true; this.remoteGetInProgress = true; NetSearchRequestMessage.sendMessage(this, this.regionName, this.key, nextResponder,this.remainingTimeout, attrs.getEntryTimeToLive().getTimeout(), attrs.getEntryIdleTimeout().getTimeout() ); } else { this.remoteGetInProgress = false; checkIfDone(); } } /**
/** return true if a CacheWriter was actually invoked */ boolean doNetWrite(CacheEvent event, Set netWriteRecipients, CacheWriter localWriter, int paction) throws CacheWriterException, TimeoutException { int action = paction; this.requestInProgress = true; Scope scope = this.region.scope; if (localWriter != null) { doLocalWrite(localWriter, event, action); this.requestInProgress = false; return true; } if (scope == Scope.LOCAL && (region.getPartitionAttributes() == null)) { return false; } CacheEvent listenerEvent = getEventForListener(event); if (action == BEFOREUPDATE && listenerEvent.getOperation().isCreate()) { action = BEFORECREATE; } boolean cacheWrote = netWrite(getEventForListener(event), action, netWriteRecipients); this.requestInProgress = false; return cacheWrote; }
load(event); return; load(event); return; obj = doLocalLoad(loader, true); Assert.assertTrue(obj != Token.INVALID && obj != Token.LOCAL_INVALID); netSearchForBlob(); if (this.result != null) { Assert.assertTrue(this.result != Token.INVALID && load(event);
public void memberDeparted(final InternalDistributedMember id, final boolean crashed) { synchronized (membersLock) { pendingResponders.remove(id); } synchronized (this) { if (id.equals(selectedNode) && (this.requestInProgress) && (this.remoteGetInProgress)) { selectedNode = null; selectedNodeDead = true; computeRemainingTimeout(); logFine(this + ": processing loss of member ", id); this.lastNotifySpot = 3; notifyAll(); // signal the waiter; we are not done; but we need the waiter to call sendNetSearchRequest } if(responseQueue != null) responseQueue.remove(id); checkIfDone(); } // this.advisor.getLogWriter().info( // "DEBUG: netsearch id " + this.processorId + " received memberDeparted event for " + id); }
CacheLoader loader = ((AbstractRegion)region).basicGetLoader(); if (scope.isLocal()) { Object obj = doLocalLoad(loader, false); event.setNewValue(obj); searchAndLoad(event, txState, localValue);
obj = doLocalLoad(loader, false); event.setNewValue(obj); Assert.assertTrue(obj != Token.INVALID && obj != Token.LOCAL_INVALID); if (scope.isDistributed()) { this.isSerialized = false; obj = doNetLoad(); Assert.assertTrue(obj != Token.INVALID && obj != Token.LOCAL_INVALID); if (this.isSerialized && obj != null) { obj = doLocalLoad(loader, false); Assert.assertTrue(obj != Token.INVALID && obj != Token.LOCAL_INVALID); event.setNewValue(obj); obj = doNetLoad(); if (this.isSerialized && obj != null) { event.setSerializedNewValue((byte[])obj);
public void memberDeparted(final InternalDistributedMember id, final boolean crashed) { synchronized (membersLock) { pendingResponders.remove(id); } synchronized (this) { if (id.equals(selectedNode) && (this.requestInProgress) && (this.remoteGetInProgress)) { selectedNode = null; selectedNodeDead = true; computeRemainingTimeout(); if (logger.isDebugEnabled()) { logger.debug("{}: processing loss of member {}", this, id); } this.lastNotifySpot = 3; notifyAll(); // signal the waiter; we are not done; but we need the waiter to call sendNetSearchRequest } if(responseQueue != null) responseQueue.remove(id); checkIfDone(); } }
try { SearchLoadAndWriteProcessor processor = SearchLoadAndWriteProcessor.getProcessor(); processor.initialize(this, "preUpdate", null); try { if (!isNewKey) { processor.doNetWrite(event, netWriteRecipients, localWriter, SearchLoadAndWriteProcessor.BEFOREUPDATE); processor.doNetWrite(event, netWriteRecipients, localWriter, SearchLoadAndWriteProcessor.BEFORECREATE); processor.release();
searcher = SearchLoadAndWriteProcessor.getProcessor(); removeSearcher = true; searcher.initialize((LocalRegion)this.region,this.key, this.aCallbackArgument); obj = searcher.doNetSearch(); if (searcher.resultIsSerialized()) { obj = EntryEventImpl.deserialize((byte[])obj); obj = searcher.doNetLoad(); if (searcher.resultIsSerialized()) { obj = EntryEventImpl.deserialize((byte[])obj); searcher.remove();
SearchLoadAndWriteProcessor.getProcessor(); try { processor.initialize(this, key, aCallbackArgument); processor.doSearchAndLoad(event, txState, localValue); if (clientEvent != null && clientEvent.getVersionTag() == null) { clientEvent.setVersionTag(event.getVersionTag()); lastModified = processor.getLastModified(); processor.release();
private synchronized void sendNetSearchRequest() { InternalDistributedMember nextResponder = nextAppropriateResponder(); if (nextResponder != null) { // Make a request to the next responder in the queue RegionAttributes attrs = this.region.getAttributes(); setSelectedNode(nextResponder); this.requestInProgress = true; this.remoteGetInProgress = true; NetSearchRequestMessage.sendMessage(this, this.regionName, this.key, nextResponder,this.remainingTimeout, attrs.getEntryTimeToLive().getTimeout(), attrs.getEntryIdleTimeout().getTimeout() ); } else { this.remoteGetInProgress = false; checkIfDone(); } } /**