Skip to content
Browse files

ISPN-1910 - State transfer should not force all invocations to be syn…

…chronous

I removed this limitation and replay support altogether, since it was no longer used.
  • Loading branch information...
1 parent 91441ac commit 29701b7d8e2a77052d2aa94593e35357a6b10d8b @danberindei danberindei committed with galderz
View
13 core/src/main/java/org/infinispan/cacheviews/CacheViewsManagerImpl.java
@@ -32,7 +32,6 @@
import org.infinispan.notifications.cachemanagerlistener.annotation.Merged;
import org.infinispan.notifications.cachemanagerlistener.annotation.ViewChanged;
import org.infinispan.notifications.cachemanagerlistener.event.ViewChangedEvent;
-import org.infinispan.remoting.MembershipArithmetic;
import org.infinispan.remoting.responses.Response;
import org.infinispan.remoting.responses.SuccessfulResponse;
import org.infinispan.remoting.rpc.ResponseMode;
@@ -212,7 +211,7 @@ public void join(String cacheName, CacheViewListener listener) throws Exception
CacheViewControlCommand.Type.REQUEST_JOIN, self);
// If we get a SuspectException we can ignore it, the new coordinator will come asking for our state anyway
Map<Address,Response> rspList = transport.invokeRemotely(Collections.singleton(coordinator), cmd,
- ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null, false);
+ ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null);
checkRemoteResponse(cacheName, cmd, rspList);
}
}
@@ -231,7 +230,7 @@ public void leave(String cacheName) {
final CacheViewControlCommand cmd = new CacheViewControlCommand(cacheName,
CacheViewControlCommand.Type.REQUEST_LEAVE, self);
// ignore any response from the other members
- transport.invokeRemotely(members, cmd, ResponseMode.ASYNCHRONOUS, timeout, false, null, false);
+ transport.invokeRemotely(members, cmd, ResponseMode.ASYNCHRONOUS, timeout, false, null);
} catch (Exception e) {
log.debugf(e, "%s: Error while leaving cache view", cacheName);
}
@@ -301,7 +300,7 @@ private CacheView clusterPrepareView(final String cacheName, final CacheView pen
@Override
public Map<Address, Response> call() throws Exception {
Map<Address, Response> rspList = transport.invokeRemotely(pendingView.getMembers(), cmd,
- ResponseMode.SYNCHRONOUS, timeout, false, null, false);
+ ResponseMode.SYNCHRONOUS, timeout, false, null);
return rspList;
}
});
@@ -343,7 +342,7 @@ private void clusterRollbackView(final String cacheName, int committedViewId, Li
CacheViewControlCommand.Type.ROLLBACK_VIEW, self, newViewId, null, committedViewId, null);
// wait until we get all the responses, but ignore the results
Map<Address, Response> rspList = transport.invokeRemotely(validTargets, cmd,
- ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null, false);
+ ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null);
checkRemoteResponse(cacheName, cmd, rspList);
} catch (Throwable t) {
log.cacheViewRollbackFailure(t, committedViewId, cacheName);
@@ -375,7 +374,7 @@ private void clusterCommitView(final String cacheName, final int viewId, List<Ad
CacheViewControlCommand.Type.COMMIT_VIEW, self, viewId);
// wait until we get all the responses, but ignore the results
Map<Address, Response> rspList = transport.invokeRemotely(validTargets, cmd,
- ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null, false);
+ ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null);
checkRemoteResponse(cacheName, cmd, rspList);
} catch (Throwable t) {
log.cacheViewCommitFailure(t, viewId, cacheName);
@@ -661,7 +660,7 @@ private void recoverViews() {
@Override
public Map<Address, Response> call() throws Exception {
return transport.invokeRemotely(Collections.singleton(member), cmd,
- ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, true, null, false);
+ ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, true, null);
}
});
futures.add(future);
View
2 core/src/main/java/org/infinispan/manager/DefaultCacheManager.java
@@ -594,7 +594,7 @@ public void removeCache(String cacheName) {
if (transport != null) {
Configuration c = getConfiguration(cacheName);
// Use sync replication timeout
- transport.invokeRemotely(null, cmd, ResponseMode.SYNCHRONOUS, c.getSyncReplTimeout(), false, null, false);
+ transport.invokeRemotely(null, cmd, ResponseMode.SYNCHRONOUS, c.getSyncReplTimeout(), false, null);
}
// Once sent to the cluster, remove the local cache
cmd.perform(null);
View
4 core/src/main/java/org/infinispan/marshall/jboss/ExternalizerTable.java
@@ -78,8 +78,6 @@
import org.infinispan.marshall.exts.SetExternalizer;
import org.infinispan.marshall.exts.SingletonListExternalizer;
import org.infinispan.remoting.responses.ExceptionResponse;
-import org.infinispan.remoting.responses.ExtendedResponse;
-import org.infinispan.remoting.responses.RequestIgnoredResponse;
import org.infinispan.remoting.responses.SuccessfulResponse;
import org.infinispan.remoting.responses.UnsuccessfulResponse;
import org.infinispan.remoting.responses.UnsureResponse;
@@ -245,10 +243,8 @@ private void loadInternalMarshallables() {
addInternalExternalizer(new Immutables.ImmutableMapWrapperExternalizer());
addInternalExternalizer(new MarshalledValue.Externalizer(globalMarshaller));
- addInternalExternalizer(new ExtendedResponse.Externalizer());
addInternalExternalizer(new SuccessfulResponse.Externalizer());
addInternalExternalizer(new ExceptionResponse.Externalizer());
- addInternalExternalizer(new RequestIgnoredResponse.Externalizer());
addInternalExternalizer(new UnsuccessfulResponse.Externalizer());
addInternalExternalizer(new UnsureResponse.Externalizer());
View
84 core/src/main/java/org/infinispan/remoting/responses/ExtendedResponse.java
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009 Red Hat Inc. and/or its affiliates and other
- * contributors as indicated by the @author tags. All rights reserved.
- * See the copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.remoting.responses;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.Set;
-
-import org.infinispan.marshall.AbstractExternalizer;
-import org.infinispan.marshall.Ids;
-import org.infinispan.util.Util;
-
-/**
- * A response with extended information
- *
- * @author Jason T. Greene
- */
-public class ExtendedResponse extends ValidResponse {
- private final boolean replayIgnoredRequests;
- private final Response response;
-
- public ExtendedResponse(Response response, boolean replayIgnoredRequests) {
- this.response = response;
- this.replayIgnoredRequests = replayIgnoredRequests;
- }
-
- public boolean isReplayIgnoredRequests() {
- return replayIgnoredRequests;
- }
-
- public Response getResponse() {
- return response;
- }
-
- public boolean isSuccessful() {
- return response.isSuccessful();
- }
-
- public static class Externalizer extends AbstractExternalizer<ExtendedResponse> {
- @Override
- public void writeObject(ObjectOutput output, ExtendedResponse er) throws IOException {
- output.writeBoolean(er.replayIgnoredRequests);
- output.writeObject(er.response);
- }
-
- @Override
- public ExtendedResponse readObject(ObjectInput input) throws IOException, ClassNotFoundException {
- boolean replayIgnoredRequests = input.readBoolean();
- Response response = (Response) input.readObject();
- return new ExtendedResponse(response, replayIgnoredRequests);
- }
-
- @Override
- public Integer getId() {
- return Ids.EXTENDED_RESPONSE;
- }
-
- @Override
- public Set<Class<? extends ExtendedResponse>> getTypeClasses() {
- return Util.<Class<? extends ExtendedResponse>>asSet(ExtendedResponse.class);
- }
- }
-}
View
76 core/src/main/java/org/infinispan/remoting/responses/RequestIgnoredResponse.java
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009 Red Hat Inc. and/or its affiliates and other
- * contributors as indicated by the @author tags. All rights reserved.
- * See the copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.remoting.responses;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.Set;
-
-import org.infinispan.marshall.AbstractExternalizer;
-import org.infinispan.marshall.Ids;
-import org.infinispan.util.Util;
-
-/**
- * Indicates that the request was ignored,
- *
- * @author Jason T. Greene
- */
-public class RequestIgnoredResponse extends InvalidResponse {
- public static final RequestIgnoredResponse INSTANCE = new RequestIgnoredResponse();
-
- private RequestIgnoredResponse() {
- }
-
- @Override
- public boolean isValid() {
- return true;
- }
-
- @Override
- public String toString() {
- return "RequestIgnoredResponse";
- }
-
- public static class Externalizer extends AbstractExternalizer<RequestIgnoredResponse> {
- @Override
- public void writeObject(ObjectOutput output, RequestIgnoredResponse object) throws IOException {
- // no-op
- }
-
- @Override
- public RequestIgnoredResponse readObject(ObjectInput input) throws IOException, ClassNotFoundException {
- return INSTANCE;
- }
-
- @Override
- public Integer getId() {
- return Ids.REQUEST_IGNORED_RESPONSE;
- }
-
- @Override
- public Set<Class<? extends RequestIgnoredResponse>> getTypeClasses() {
- return Util.<Class<? extends RequestIgnoredResponse>>asSet(RequestIgnoredResponse.class);
- }
- }
-}
View
2 core/src/main/java/org/infinispan/remoting/rpc/RpcManagerImpl.java
@@ -145,7 +145,7 @@ private boolean useReplicationQueue(boolean sync) {
responseFilter = new IgnoreExtraResponsesValidityFilter(cacheMembers, getAddress());
}
}
- Map<Address, Response> result = t.invokeRemotely(recipients, rpcCommand, mode, timeout, usePriorityQueue, responseFilter, stateTransferEnabled);
+ Map<Address, Response> result = t.invokeRemotely(recipients, rpcCommand, mode, timeout, usePriorityQueue, responseFilter);
if (statisticsEnabled) replicationCount.incrementAndGet();
return result;
} catch (CacheException e) {
View
4 core/src/main/java/org/infinispan/remoting/transport/Transport.java
@@ -77,6 +77,7 @@ void initialize(@ComponentName(GLOBAL_MARSHALLER) StreamingMarshaller marshaller
/**
* Invokes an RPC call on other caches in the cluster.
*
+ *
* @param recipients a list of Addresses to invoke the call on. If this is null, the call is broadcast to the
* entire cluster.
* @param rpcCommand the cache command to invoke
@@ -85,12 +86,11 @@ void initialize(@ComponentName(GLOBAL_MARSHALLER) StreamingMarshaller marshaller
* @param usePriorityQueue if true, a priority queue is used to deliver messages. May not be supported by all
* implementations.
* @param responseFilter a response filter with which to filter out failed/unwanted/invalid responses.
- * @param supportReplay whether replays of missed messages is supported
* @return a map of responses from each member contacted.
* @throws Exception in the event of problems.
*/
Map<Address, Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout,
- boolean usePriorityQueue, ResponseFilter responseFilter, boolean supportReplay) throws Exception;
+ boolean usePriorityQueue, ResponseFilter responseFilter) throws Exception;
/**
* @return true if the current Channel is the coordinator of the cluster.
View
95 core/src/main/java/org/infinispan/remoting/transport/jgroups/CommandAwareRpcDispatcher.java
@@ -29,8 +29,6 @@
import org.infinispan.remoting.InboundInvocationHandler;
import org.infinispan.remoting.RpcException;
import org.infinispan.remoting.responses.ExceptionResponse;
-import org.infinispan.remoting.responses.ExtendedResponse;
-import org.infinispan.remoting.responses.RequestIgnoredResponse;
import org.infinispan.remoting.responses.Response;
import org.infinispan.util.Util;
import org.infinispan.util.concurrent.TimeoutException;
@@ -54,7 +52,6 @@
import java.io.NotSerializableException;
import java.util.Collections;
import java.util.HashMap;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
@@ -116,13 +113,13 @@ private boolean isValid(Message req) {
* @param recipients Guaranteed not to be null. Must <b>not</b> contain self.
*/
public RspList<Object> invokeRemoteCommands(final List<Address> recipients, final ReplicableCommand command, final ResponseMode mode, final long timeout,
- final boolean anycasting, final boolean oob, final RspFilter filter, final boolean supportReplay,
+ final boolean anycasting, final boolean oob, final RspFilter filter,
boolean asyncMarshalling) throws InterruptedException {
if (asyncMarshalling) {
asyncExecutor.submit(new Callable<RspList<Object>>() {
@Override
public RspList<Object> call() throws Exception {
- return processCalls(command, recipients == null, supportReplay, timeout, filter, recipients, mode,
+ return processCalls(command, recipients == null, timeout, filter, recipients, mode,
req_marshaller, CommandAwareRpcDispatcher.this, oob, anycasting);
}
});
@@ -130,7 +127,7 @@ private boolean isValid(Message req) {
} else {
RspList<Object> response;
try {
- response = processCalls(command, recipients == null, supportReplay, timeout, filter, recipients, mode,
+ response = processCalls(command, recipients == null, timeout, filter, recipients, mode,
req_marshaller, this, oob, anycasting);
} catch (InterruptedException e) {
throw e;
@@ -146,14 +143,14 @@ private boolean isValid(Message req) {
}
public Response invokeRemoteCommand(final Address recipient, final ReplicableCommand command, final ResponseMode mode,
- final long timeout, final boolean oob, final boolean supportReplay,
+ final long timeout, final boolean oob,
boolean asyncMarshalling) throws InterruptedException {
if (asyncMarshalling) {
asyncExecutor.submit(new Callable<Response>() {
@Override
public Response call() throws Exception {
- return processSingleCall(command, supportReplay, timeout, recipient, mode,
+ return processSingleCall(command, timeout, recipient, mode,
req_marshaller, CommandAwareRpcDispatcher.this, oob, transport);
}
});
@@ -161,7 +158,7 @@ public Response call() throws Exception {
} else {
Response response;
try {
- response = processSingleCall(command, supportReplay, timeout, recipient, mode,
+ response = processSingleCall(command, timeout, recipient, mode,
req_marshaller, this, oob, transport);
} catch (InterruptedException e) {
throw e;
@@ -174,9 +171,9 @@ public Response call() throws Exception {
}
public RspList<Object> broadcastRemoteCommands(ReplicableCommand command, ResponseMode mode, long timeout,
- boolean anycasting, boolean oob, RspFilter filter, boolean supportReplay,
+ boolean anycasting, boolean oob, RspFilter filter,
boolean asyncMarshalling) throws InterruptedException {
- return invokeRemoteCommands(null, command, mode, timeout, anycasting, oob, filter, supportReplay, asyncMarshalling);
+ return invokeRemoteCommands(null, command, mode, timeout, anycasting, oob, filter, asyncMarshalling);
}
private boolean containsOnlyNulls(RspList<Object> l) {
@@ -250,14 +247,13 @@ private static Buffer marshallCall(Marshaller marshaller, ReplicableCommand comm
return buf;
}
- private static Response processSingleCall(ReplicableCommand command, boolean supportReplay, long timeout,
- Address destination, ResponseMode origMode,
+ private static Response processSingleCall(ReplicableCommand command, long timeout,
+ Address destination, ResponseMode mode,
Marshaller marshaller, CommandAwareRpcDispatcher card, boolean oob,
JGroupsTransport transport) throws Exception {
if (trace) log.tracef("Replication task sending %s to single recipient %s", command, destination);
// Replay capability requires responses from all members!
- ResponseMode mode = supportReplay ? ResponseMode.GET_ALL : origMode;
Response retval;
Buffer buf;
buf = marshallCall(marshaller, command);
@@ -266,47 +262,24 @@ private static Response processSingleCall(ReplicableCommand command, boolean sup
// we only bother parsing responses if we are not in ASYNC mode.
if (trace) log.tracef("Response: %s", retval);
- if (mode != ResponseMode.GET_NONE) {
- if (retval != null) {
- if (!transport.checkResponse(retval, fromJGroupsAddress(destination))) {
- if (trace) log.tracef("Invalid response from %s", destination);
- throw new TimeoutException("Received an invalid response " + retval + " from " + destination);
- }
-
- if (supportReplay) {
- boolean replay = false;
- if (retval instanceof ExtendedResponse) {
- ExtendedResponse extended = (ExtendedResponse) retval;
- replay = extended.isReplayIgnoredRequests();
- retval = extended.getResponse();
- }
-
- if (replay) {
- Message msg = constructMessage(buf, destination, oob, mode);
- //Since we are making a sync call make sure we don't bundle
- //See ISPN-192 for more details
- msg.setFlag(Message.DONT_BUNDLE);
+ if (mode == ResponseMode.GET_NONE)
+ return null;
- if (trace) log.tracef("Replaying message to ignoring sender: %s", destination);
- Response rv2 = card.sendMessage(msg, new RequestOptions(ResponseMode.GET_ALL, timeout, false));
- if (rv2 != null) retval = rv2;
- }
- }
+ if (retval != null) {
+ if (!transport.checkResponse(retval, fromJGroupsAddress(destination))) {
+ if (trace) log.tracef("Invalid response from %s", destination);
+ throw new TimeoutException("Received an invalid response " + retval + " from " + destination);
}
- return retval;
- } else {
- return null;
}
+
+ return retval;
}
- private static RspList<Object> processCalls(ReplicableCommand command, boolean broadcast, boolean supportReplay, long timeout,
- RspFilter filter, List<Address> dests, ResponseMode origMode,
+ private static RspList<Object> processCalls(ReplicableCommand command, boolean broadcast, long timeout,
+ RspFilter filter, List<Address> dests, ResponseMode mode,
Marshaller marshaller, CommandAwareRpcDispatcher card, boolean oob, boolean anycasting) throws Exception {
if (trace) log.tracef("Replication task sending %s to addresses %s", command, dests);
- // Replay capability requires responses from all members!
- ResponseMode mode = supportReplay ? ResponseMode.GET_ALL : origMode;
-
RspList<Object> retval = null;
Buffer buf;
if (broadcast || FORCE_MCAST) {
@@ -365,34 +338,8 @@ private static Response processSingleCall(ReplicableCommand command, boolean sup
if (retval == null)
throw new NotSerializableException("RpcDispatcher returned a null. This is most often caused by args for "
+ command.getClass().getSimpleName() + " not being serializable.");
-
- if (supportReplay) {
- boolean replay = false;
- List<Address> ignorers = new LinkedList<Address>();
- for (Map.Entry<Address, Rsp<Object>> entry : retval.entrySet()) {
- Object value = entry.getValue().getValue();
- if (value instanceof RequestIgnoredResponse) {
- ignorers.add(entry.getKey());
- } else if (value instanceof ExtendedResponse) {
- ExtendedResponse extended = (ExtendedResponse) value;
- replay |= extended.isReplayIgnoredRequests();
- entry.getValue().setValue(extended.getResponse());
- }
- }
-
- if (replay && !ignorers.isEmpty()) {
- Message msg = constructMessage(buf, null, oob, mode);
- //Since we are making a sync call make sure we don't bundle
- //See ISPN-192 for more details
- msg.setFlag(Message.DONT_BUNDLE);
-
- RequestOptions opts = new RequestOptions(ResponseMode.GET_ALL, timeout, anycasting, filter);
- RspList<Object> responses = card.castMessage(ignorers, msg, opts);
- if (responses != null)
- retval.putAll(responses);
- }
- }
}
+
return retval;
}
View
13 core/src/main/java/org/infinispan/remoting/transport/jgroups/JGroupsTransport.java
@@ -63,7 +63,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
@@ -425,8 +424,8 @@ public Address getAddress() {
// ------------------------------------------------------------------------------------------------------------------
@Override
- public Map<Address, Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter,
- boolean supportReplay) throws Exception {
+ public Map<Address, Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter)
+ throws Exception {
if (recipients != null && recipients.isEmpty()) {
// don't send if dest list is empty
@@ -459,8 +458,8 @@ public Address getAddress() {
if (broadcast) {
rsps = dispatcher.broadcastRemoteCommands(rpcCommand, toJGroupsMode(mode), timeout, recipients != null,
- usePriorityQueue, toJGroupsFilter(responseFilter), supportReplay,
- asyncMarshalling);
+ usePriorityQueue, toJGroupsFilter(responseFilter),
+ asyncMarshalling);
} else {
if (jgAddressList == null || !jgAddressList.isEmpty()) {
boolean singleRecipient = jgAddressList != null && jgAddressList.size() == 1;
@@ -476,11 +475,11 @@ public Address getAddress() {
if (singleRecipient) {
if (singleJGAddress == null) singleJGAddress = jgAddressList.get(0);
singleResponse = dispatcher.invokeRemoteCommand(singleJGAddress, rpcCommand, toJGroupsMode(mode), timeout,
- usePriorityQueue, supportReplay, asyncMarshalling);
+ usePriorityQueue, asyncMarshalling);
} else {
rsps = dispatcher.invokeRemoteCommands(jgAddressList, rpcCommand, toJGroupsMode(mode), timeout,
recipients != null, usePriorityQueue, toJGroupsFilter(responseFilter),
- supportReplay, asyncMarshalling);
+ asyncMarshalling);
}
}
}
View
2 core/src/test/java/org/infinispan/api/mvcc/PutForExternalReadTest.java
@@ -179,7 +179,7 @@ public void testExceptionSuppression() throws Exception {
when(mockTransport.getViewId()).thenReturn(originalTransport.getViewId());
when(mockTransport.invokeRemotely(anyAddresses(), (CacheRpcCommand) anyObject(), anyResponseMode(),
- anyLong(), anyBoolean(), (ResponseFilter) anyObject(), anyBoolean()))
+ anyLong(), anyBoolean(), (ResponseFilter) anyObject()))
.thenThrow(new RuntimeException("Barf!"));
try {
View
2 core/src/test/java/org/infinispan/invalidation/BaseInvalidationTest.java
@@ -224,7 +224,7 @@ public void testCacheMode() throws Exception {
when(mockTransport.getAddress()).thenReturn(addressOne);
when(mockTransport.invokeRemotely((List<Address>) anyObject(), (CacheRpcCommand) anyObject(),
eq(isSync ? ResponseMode.SYNCHRONOUS : ResponseMode.ASYNCHRONOUS_WITH_SYNC_MARSHALLING),
- anyLong(), anyBoolean(), (ResponseFilter) anyObject(), anyBoolean())).thenReturn(null);
+ anyLong(), anyBoolean(), (ResponseFilter) anyObject())).thenReturn(null);
cache1.put("k", "v");
View
4 core/src/test/java/org/infinispan/jmx/RpcManagerMBeanTest.java
@@ -168,8 +168,8 @@ public void testSuccessRatio() throws Exception {
Transport transport = mock(Transport.class);
when(transport.getMembers()).thenReturn(memberList);
when(transport.getAddress()).thenReturn(null);
- when(transport.invokeRemotely(any(Collection.class), any(ReplicableCommand.class), any(ResponseMode.class), anyLong(), anyBoolean(), any(ResponseFilter.class),
- anyBoolean())).thenThrow(new RuntimeException());
+ when(transport.invokeRemotely(any(Collection.class), any(ReplicableCommand.class), any(ResponseMode.class),
+ anyLong(), anyBoolean(), any(ResponseFilter.class))).thenThrow(new RuntimeException());
rpcManager.setTransport(transport);
cache1.put("a5", "b5");
assert false : "rpc manager should have thrown an exception";
View
15 core/src/test/java/org/infinispan/marshall/VersionAwareMarshallerTest.java
@@ -59,9 +59,6 @@
import org.infinispan.marshall.jboss.JBossMarshallingTest.ObjectThatContainsACustomReadObjectMethod;
import org.infinispan.remoting.MIMECacheEntry;
import org.infinispan.remoting.responses.ExceptionResponse;
-import org.infinispan.remoting.responses.ExtendedResponse;
-import org.infinispan.remoting.responses.RequestIgnoredResponse;
-import org.infinispan.remoting.responses.SuccessfulResponse;
import org.infinispan.remoting.responses.UnsuccessfulResponse;
import org.infinispan.remoting.transport.Address;
import org.infinispan.remoting.transport.jgroups.JGroupsAddress;
@@ -219,21 +216,9 @@ public void testSingletonListMarshalling() throws Exception {
}
public void testImmutableResponseMarshalling() throws Exception {
- marshallAndAssertEquality(RequestIgnoredResponse.INSTANCE);
marshallAndAssertEquality(UnsuccessfulResponse.INSTANCE);
}
- public void testExtendedResponseMarshalling() throws Exception {
- SuccessfulResponse sr = SuccessfulResponse.create("Blah");
- ExtendedResponse extended = new ExtendedResponse(sr, false);
- byte[] bytes = marshaller.objectToByteBuffer(extended);
- ExtendedResponse readObj = (ExtendedResponse) marshaller.objectFromByteBuffer(bytes);
- assert extended.getResponse().equals(readObj.getResponse()) :
- "Writen[" + extended.getResponse() + "] and read[" + readObj.getResponse() + "] objects should be the same";
- assert extended.isReplayIgnoredRequests() == readObj.isReplayIgnoredRequests() :
- "Writen[" + extended.isReplayIgnoredRequests() + "] and read[" + readObj.isReplayIgnoredRequests() + "] objects should be the same";
- }
-
public void testReplicableCommandsMarshalling() throws Exception {
String cacheName = EmbeddedCacheManager.DEFAULT_CACHE_NAME;
ClusteredGetCommand c2 = new ClusteredGetCommand("key", cacheName, Collections.<Flag>emptySet());
View
6 core/src/test/java/org/infinispan/replication/SyncReplTest.java
@@ -199,8 +199,7 @@ public void testMixingSyncAndAsyncOnSameTransport() throws Exception {
when(
mockTransport.invokeRemotely((List<Address>) anyObject(),
(CacheRpcCommand) anyObject(), eq(ResponseMode.SYNCHRONOUS), anyLong(),
- anyBoolean(), (ResponseFilter) anyObject(), anyBoolean())).thenReturn(
- emptyResponses);
+ anyBoolean(), (ResponseFilter) anyObject())).thenReturn(emptyResponses);
// check that the replication call was sync
cache1.put("k", "v");
@@ -215,8 +214,7 @@ public void testMixingSyncAndAsyncOnSameTransport() throws Exception {
when(
mockTransport.invokeRemotely((List<Address>) anyObject(),
(CacheRpcCommand) anyObject(), eq(ResponseMode.ASYNCHRONOUS), anyLong(),
- anyBoolean(), (ResponseFilter) anyObject(), anyBoolean())).thenReturn(
- emptyResponses);
+ anyBoolean(), (ResponseFilter) anyObject())).thenReturn(emptyResponses);
asyncCache1.put("k", "v");
// check that the replication call was async
View
3 spring/src/test/java/org/infinispan/spring/mock/MockTransport.java
@@ -55,8 +55,7 @@ public void initialize(final StreamingMarshaller marshaller,
@Override
public Map<Address, Response> invokeRemotely(final Collection<Address> recipients,
final ReplicableCommand rpcCommand, final ResponseMode mode, final long timeout,
- final boolean usePriorityQueue, final ResponseFilter responseFilter,
- final boolean supportReplay) throws Exception {
+ final boolean usePriorityQueue, final ResponseFilter responseFilter) throws Exception {
return null;
}

0 comments on commit 29701b7

Please sign in to comment.
Something went wrong with that request. Please try again.