Skip to content

Commit

Permalink
Merge branch 'revert-c43d56bd' into '2.7.7-ctrip'
Browse files Browse the repository at this point in the history
Revert "Merge branch 'expose-some-api' into '2.7.7-ctrip'"

See merge request framework/dubbo!57
  • Loading branch information
vio-lin committed Oct 25, 2022
2 parents c43d56b + 00ea8cc commit b30d83d
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 66 deletions.
2 changes: 1 addition & 1 deletion dubbo-dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<mortbay_jetty_version>6.1.26</mortbay_jetty_version>
<portlet_version>2.0</portlet_version>
<maven_flatten_version>1.1.0</maven_flatten_version>
<revision>2.7.7-ctrip.14-SNAPSHOT</revision>
<revision>2.7.7-ctrip.13</revision>
</properties>

<distributionManagement>
Expand Down
2 changes: 1 addition & 1 deletion dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<packaging>pom</packaging>

<properties>
<revision>2.7.7-ctrip.14-SNAPSHOT</revision>
<revision>2.7.7-ctrip.13</revision>
<maven_flatten_version>1.1.0</maven_flatten_version>
</properties>
<distributionManagement>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@
import org.apache.dubbo.common.utils.ArrayUtils;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.NetUtils;
import org.apache.dubbo.rpc.AdaptiveFutureFactory;
import org.apache.dubbo.rpc.AsyncRpcResult;
import org.apache.dubbo.rpc.Invocation;
import org.apache.dubbo.rpc.InvokeMode;
import org.apache.dubbo.rpc.InvokeModeParser;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.Result;
import org.apache.dubbo.rpc.RpcContext;
Expand All @@ -43,7 +41,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;

Expand All @@ -54,10 +51,6 @@ public abstract class AbstractInvoker<T> implements Invoker<T> {

protected final Logger logger = LoggerFactory.getLogger(getClass());

protected final InvokeModeParser invokeModeParser = ExtensionLoader.getExtensionLoader(InvokeModeParser.class).getDefaultExtension();

protected final AdaptiveFutureFactory adaptiveFutureFactory = ExtensionLoader.getExtensionLoader(AdaptiveFutureFactory.class).getDefaultExtension();

private final Class<T> type;

private final URL url;
Expand All @@ -66,7 +59,7 @@ public abstract class AbstractInvoker<T> implements Invoker<T> {

private volatile boolean available = true;

private final AtomicBoolean destroyed = new AtomicBoolean(false);
private AtomicBoolean destroyed = new AtomicBoolean(false);

public AbstractInvoker(Class<T> type, URL url) {
this(type, url, (Map<String, Object>) null);
Expand Down Expand Up @@ -162,7 +155,7 @@ public Result invoke(Invocation inv) throws RpcException {
invocation.addObjectAttachments(contextAttachments);
}

invocation.setInvokeMode(getInvokeMode(invocation));
invocation.setInvokeMode(RpcUtils.getInvokeMode(url, invocation));
RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);

AsyncRpcResult asyncResult;
Expand All @@ -187,22 +180,13 @@ public Result invoke(Invocation inv) throws RpcException {
} catch (Throwable e) {
asyncResult = AsyncRpcResult.newDefaultAsyncResult(null, e, invocation);
}

RpcContext.getContext().setFuture(getAdaptiveFuture(asyncResult));
RpcContext.getContext().setFuture(new FutureAdapter(asyncResult.getResponseFuture()));
return asyncResult;
}

protected InvokeMode getInvokeMode(Invocation invocation) {
return invokeModeParser.parse(getUrl(), invocation);
}

protected CompletableFuture<?> getAdaptiveFuture(AsyncRpcResult asyncResult) {
return adaptiveFutureFactory.getAdaptiveFuture(asyncResult);
}

protected ExecutorService getCallbackExecutor(URL url, Invocation inv) {
ExecutorService sharedExecutor = ExtensionLoader.getExtensionLoader(ExecutorRepository.class).getDefaultExtension().getExecutor(url);
if (InvokeMode.SYNC == getInvokeMode(inv)) {
if (InvokeMode.SYNC == RpcUtils.getInvokeMode(getUrl(), inv)) {
return new ThreadlessExecutor(sharedExecutor);
} else {
return sharedExecutor;
Expand All @@ -211,19 +195,4 @@ protected ExecutorService getCallbackExecutor(URL url, Invocation inv) {

protected abstract Result doInvoke(Invocation invocation) throws Throwable;

public static class DefaultInvokeModeParser implements InvokeModeParser {

@Override
public InvokeMode parse(URL url, Invocation invocation) {
return RpcUtils.getInvokeMode(url, invocation);
}
}

public static class DefaultAdaptiveFutureFactory implements AdaptiveFutureFactory {

@Override
public CompletableFuture<Object> getAdaptiveFuture(AsyncRpcResult asyncResult) {
return new FutureAdapter<>(asyncResult.getResponseFuture());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public Result invoke(Invocation invocation) throws RpcException {
}
}

protected CompletableFuture<Object> wrapWithFuture(Object value) {
private CompletableFuture<Object> wrapWithFuture(Object value) {
if (RpcContext.getContext().isAsyncStarted()) {
return ((AsyncContextImpl)(RpcContext.getContext().getAsyncContext())).getInternalFuture();
} else if (value instanceof CompletableFuture) {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ private ProtocolServer createServer(URL url) {
return new DubboProtocolServer(server);
}

protected void optimizeSerialization(URL url) throws RpcException {
private void optimizeSerialization(URL url) throws RpcException {
String className = url.getParameter(OPTIMIZER_KEY, "");
if (StringUtils.isEmpty(className) || optimizers.contains(className)) {
return;
Expand Down Expand Up @@ -407,7 +407,7 @@ public <T> Invoker<T> protocolBindingRefer(Class<T> serviceType, URL url) throws
return invoker;
}

protected ExchangeClient[] getClients(URL url) {
private ExchangeClient[] getClients(URL url) {
// whether to share connection

boolean useShareConnect = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* dubbo protocol support class.
*/
@SuppressWarnings("deprecation")
public final class LazyConnectExchangeClient implements ExchangeClient {
final class LazyConnectExchangeClient implements ExchangeClient {

/**
* when this warning rises from invocation, program probably have bug.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* dubbo protocol support class.
*/
@SuppressWarnings("deprecation")
public final class ReferenceCountExchangeClient implements ExchangeClient {
final class ReferenceCountExchangeClient implements ExchangeClient {

private final URL url;
private final AtomicInteger referenceCount = new AtomicInteger(0);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<arguments />
<checkstyle.skip>true</checkstyle.skip>
<rat.skip>true</rat.skip>
<revision>2.7.7-ctrip.14-SNAPSHOT</revision>
<revision>2.7.7-ctrip.13</revision>
</properties>
<distributionManagement>
<snapshotRepository>
Expand Down

0 comments on commit b30d83d

Please sign in to comment.