diff --git a/README.md b/README.md
index 444ec822095..b63ab5ec6ca 100644
--- a/README.md
+++ b/README.md
@@ -40,11 +40,33 @@ There's a [README](https://github.com/dubbo/dubbo-samples/blob/master/dubbo-samp
### Maven dependency
```xml
-
- com.alibaba
- dubbo
- 2.6.5
-
+
+ 2.6.5
+
+
+
+
+
+ com.alibaba
+ dubbo-dependencies-bom
+ ${dubbo.version}
+ pom
+ import
+
+
+
+
+
+
+ com.alibaba
+ dubbo
+ ${dubbo.version}
+
+
+ io.netty
+ netty-all
+
+
```
### Define service interfaces
diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java
index 9b3e5271b52..a33e1801fd6 100644
--- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java
@@ -127,7 +127,7 @@ else if ("!=".equals(separator)) {
values.add(content);
}
// The Value in the KV part, if Value have more than one items.
- else if (",".equals(separator)) { // Should be seperateed by ','
+ else if (",".equals(separator)) { // Should be separated by ','
if (values == null || values.isEmpty()) {
throw new ParseException("Illegal route rule \""
+ rule + "\", The error char '" + separator
diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouterFactory.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouterFactory.java
index 56976ed731a..b29f25e23dd 100644
--- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouterFactory.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouterFactory.java
@@ -25,7 +25,7 @@
*
* Example URLS used by Script Router Factory:
*
- * script://registyAddress?type=js&rule=xxxx
+ * script://registryAddress?type=js&rule=xxxx
* script:///path/to/routerfile.js?type=js&rule=xxxx
* script://D:\path\to\routerfile.js?type=js&rule=xxxx
* script://C:/path/to/routerfile.js?type=js&rule=xxxx
diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
index 2fd1af923c8..293d3bda158 100644
--- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
@@ -143,7 +143,7 @@ private List> selectMockInvoker(Invocation invocation) {
List> invokers = null;
//TODO generic invoker?
if (invocation instanceof RpcInvocation) {
- //Note the implicit contract (although the description is added to the interface declaration, but extensibility is a problem. The practice placed in the attachement needs to be improved)
+ //Note the implicit contract (although the description is added to the interface declaration, but extensibility is a problem. The practice placed in the attachment needs to be improved)
((RpcInvocation) invocation).setAttachment(Constants.INVOCATION_NEED_MOCK, Boolean.TRUE.toString());
//directory will return a list of normal invokers if Constants.INVOCATION_NEED_MOCK is present in invocation, otherwise, a list of mock invokers will return.
try {
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/compiler/support/ClassUtils.java b/dubbo-common/src/main/java/org/apache/dubbo/common/compiler/support/ClassUtils.java
index 40c050f79e5..e4db9a8cb5c 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/compiler/support/ClassUtils.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/compiler/support/ClassUtils.java
@@ -422,8 +422,8 @@ public static String getInitCode(Class> type) {
public static Map toMap(Map.Entry[] entries) {
Map map = new HashMap();
if (entries != null && entries.length > 0) {
- for (Map.Entry enrty : entries) {
- map.put(enrty.getKey(), enrty.getValue());
+ for (Map.Entry entry : entries) {
+ map.put(entry.getKey(), entry.getValue());
}
}
return map;
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/io/StreamUtils.java b/dubbo-common/src/main/java/org/apache/dubbo/common/io/StreamUtils.java
index 0bb950531fe..2a463c3e098 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/io/StreamUtils.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/io/StreamUtils.java
@@ -189,7 +189,7 @@ public synchronized void mark(int readlimit) {
@Override
public synchronized void reset() throws IOException {
if (!mInMarked) {
- throw new IOException("should mark befor reset!");
+ throw new IOException("should mark before reset!");
}
mInReset = true;
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/io/UnsafeByteArrayInputStream.java b/dubbo-common/src/main/java/org/apache/dubbo/common/io/UnsafeByteArrayInputStream.java
index 16bb0d6c479..c5b72bdc199 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/io/UnsafeByteArrayInputStream.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/io/UnsafeByteArrayInputStream.java
@@ -20,7 +20,7 @@
import java.io.InputStream;
/**
- * UnsafeByteArrayInputStrem.
+ * UnsafeByteArrayInputStream.
*/
public class UnsafeByteArrayInputStream extends InputStream {
protected byte mData[];
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/Assert.java b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/Assert.java
index 4c6582ed9c6..46b20892f71 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/Assert.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/Assert.java
@@ -28,9 +28,9 @@ public static void notNull(Object obj, String message) {
}
}
- public static void notNull(Object obj, RuntimeException exeception) {
+ public static void notNull(Object obj, RuntimeException exception) {
if (obj == null) {
- throw exeception;
+ throw exception;
}
}
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ConfigUtils.java b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ConfigUtils.java
index 436cf8f42eb..ea5de731379 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ConfigUtils.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ConfigUtils.java
@@ -213,7 +213,7 @@ public static Properties loadProperties(String fileName, boolean allowMultiFile)
* return empty Properties if no file found.
* merge multi properties file if found multi file
*
- * @throws IllegalStateException not allow multi-file, but multi-file exsit on class path.
+ * @throws IllegalStateException not allow multi-file, but multi-file exist on class path.
*/
public static Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional) {
Properties properties = new Properties();
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/PojoUtils.java b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/PojoUtils.java
index d8c00f31ce7..e9a9c63201a 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/PojoUtils.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/PojoUtils.java
@@ -175,9 +175,9 @@ private static Object generalize(Object pojo, Map history) {
try {
Object fieldValue = field.get(pojo);
if (history.containsKey(pojo)) {
- Object pojoGenerilizedValue = history.get(pojo);
- if (pojoGenerilizedValue instanceof Map
- && ((Map) pojoGenerilizedValue).containsKey(field.getName())) {
+ Object pojoGeneralizedValue = history.get(pojo);
+ if (pojoGeneralizedValue instanceof Map
+ && ((Map) pojoGeneralizedValue).containsKey(field.getName())) {
continue;
}
}
diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/qos/command/CommandContext.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/qos/command/CommandContext.java
index 2b6a4d9da2f..98f799de2a3 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/qos/command/CommandContext.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/qos/command/CommandContext.java
@@ -23,7 +23,7 @@ public class CommandContext extends org.apache.dubbo.qos.command.CommandContext
public CommandContext(org.apache.dubbo.qos.command.CommandContext context) {
super(context.getCommandName(), context.getArgs(), context.isHttp());
setRemote(context.getRemote());
- setOrginRequest(context.getOrginRequest());
+ setOriginRequest(context.getOriginRequest());
}
public CommandContext(String commandName) {
diff --git a/dubbo-compatible/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/CompatibleServiceAnnotationBeanPostProcessor.java b/dubbo-compatible/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/CompatibleServiceAnnotationBeanPostProcessor.java
index 5f4d9903521..7c87087dc9a 100644
--- a/dubbo-compatible/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/CompatibleServiceAnnotationBeanPostProcessor.java
+++ b/dubbo-compatible/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/CompatibleServiceAnnotationBeanPostProcessor.java
@@ -209,7 +209,7 @@ private BeanNameGenerator resolveBeanNameGenerator(BeanDefinitionRegistry regist
* {@link Service} Annotation.
*
* @param scanner {@link ClassPathBeanDefinitionScanner}
- * @param packageToScan pachage to scan
+ * @param packageToScan package to scan
* @param registry {@link BeanDefinitionRegistry}
* @return non-null
* @since 2.5.8
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java
index e82239588c5..4d8f0bdd29e 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java
@@ -509,7 +509,7 @@ private T getFieldValue(Object object, String fieldName, Class fieldType)
/**
* Generate a key based on the annotation.
*
- * @param annotations annotatoin value
+ * @param annotations annotation value
* @return unique key, never null will be returned.
* @since 2.7.0
*/
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java
index c08cc13e6a7..37fed800348 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java
@@ -208,7 +208,7 @@ private BeanNameGenerator resolveBeanNameGenerator(BeanDefinitionRegistry regist
* {@link Service} Annotation.
*
* @param scanner {@link ClassPathBeanDefinitionScanner}
- * @param packageToScan pachage to scan
+ * @param packageToScan package to scan
* @param registry {@link BeanDefinitionRegistry}
* @return non-null
* @since 2.5.8
diff --git a/dubbo-filter/dubbo-filter-cache/src/main/java/org/apache/dubbo/cache/Cache.java b/dubbo-filter/dubbo-filter-cache/src/main/java/org/apache/dubbo/cache/Cache.java
index fb2a329fc15..bba7aca0ee5 100644
--- a/dubbo-filter/dubbo-filter-cache/src/main/java/org/apache/dubbo/cache/Cache.java
+++ b/dubbo-filter/dubbo-filter-cache/src/main/java/org/apache/dubbo/cache/Cache.java
@@ -19,7 +19,7 @@
/**
* Cache interface to support storing and retrieval of value against a lookup key. It has two operation get and put .
* put -Storing value against a key.
- * get -Retrival of object.
+ * get -Retrieval of object.
* @see org.apache.dubbo.cache.support.lru.LruCache
* @see org.apache.dubbo.cache.support.jcache.JCache
* @see org.apache.dubbo.cache.support.expiring.ExpiringCache
diff --git a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/CommandContext.java b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/CommandContext.java
index 0dae5623813..0bd427b654a 100644
--- a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/CommandContext.java
+++ b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/CommandContext.java
@@ -24,7 +24,7 @@ public class CommandContext {
private String[] args;
private Channel remote;
private boolean isHttp;
- private Object orginRequest;
+ private Object originRequest;
public CommandContext(String commandName) {
this.commandName = commandName;
@@ -68,11 +68,11 @@ public void setHttp(boolean http) {
isHttp = http;
}
- public Object getOrginRequest() {
- return orginRequest;
+ public Object getOriginRequest() {
+ return originRequest;
}
- public void setOrginRequest(Object orginRequest) {
- this.orginRequest = orginRequest;
+ public void setOriginRequest(Object originRequest) {
+ this.originRequest = originRequest;
}
}
diff --git a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/decoder/TelnetCommandDecoder.java b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/decoder/TelnetCommandDecoder.java
index 8dfd039a1d4..52e58b50ba0 100644
--- a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/decoder/TelnetCommandDecoder.java
+++ b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/decoder/TelnetCommandDecoder.java
@@ -31,7 +31,7 @@ public static final CommandContext decode(String str) {
String[] targetArgs = new String[array.length - 1];
System.arraycopy(array, 1, targetArgs, 0, array.length - 1);
commandContext = CommandContextFactory.newInstance( name, targetArgs,false);
- commandContext.setOrginRequest(str);
+ commandContext.setOriginRequest(str);
}
}
diff --git a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/CommandContextTest.java b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/CommandContextTest.java
index 4cc7416bf47..5ec78b0b3bc 100644
--- a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/CommandContextTest.java
+++ b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/CommandContextTest.java
@@ -33,23 +33,23 @@ public class CommandContextTest {
public void test() throws Exception {
CommandContext context = new CommandContext("test", new String[]{"hello"}, true);
Object request = new Object();
- context.setOrginRequest(request);
+ context.setOriginRequest(request);
Channel channel = Mockito.mock(Channel.class);
context.setRemote(channel);
assertThat(context.getCommandName(), equalTo("test"));
assertThat(context.getArgs(), arrayContaining("hello"));
- assertThat(context.getOrginRequest(), is(request));
+ assertThat(context.getOriginRequest(), is(request));
assertTrue(context.isHttp());
assertThat(context.getRemote(), is(channel));
context = new CommandContext("command");
context.setRemote(channel);
- context.setOrginRequest(request);
+ context.setOriginRequest(request);
context.setArgs(new String[]{"world"});
context.setHttp(false);
assertThat(context.getCommandName(), equalTo("command"));
assertThat(context.getArgs(), arrayContaining("world"));
- assertThat(context.getOrginRequest(), is(request));
+ assertThat(context.getOriginRequest(), is(request));
assertFalse(context.isHttp());
assertThat(context.getRemote(), is(channel));
}
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
index 051c29e33c1..ba8706365ad 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
@@ -562,7 +562,7 @@ private void destroyUnusedInvokers(Map> oldUrlInvokerMap, Map
logger.debug("destroy invoker[" + invoker.getUrl() + "] success. ");
}
} catch (Exception e) {
- logger.warn("destroy invoker[" + invoker.getUrl() + "] faild. " + e.getMessage(), e);
+ logger.warn("destroy invoker[" + invoker.getUrl() + "] failed. " + e.getMessage(), e);
}
}
}
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/FailbackRegistry.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/FailbackRegistry.java
index 5d2d2f041f8..c7a4bb9bcba 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/FailbackRegistry.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/FailbackRegistry.java
@@ -272,7 +272,7 @@ public void unregister(URL url) {
}
throw new IllegalStateException("Failed to unregister " + url + " to registry " + getUrl().getAddress() + ", cause: " + t.getMessage(), t);
} else {
- logger.error("Failed to uregister " + url + ", waiting for retry, cause: " + t.getMessage(), t);
+ logger.error("Failed to unregister " + url + ", waiting for retry, cause: " + t.getMessage(), t);
}
// Record a failed registration request to a failed list, retry regularly
diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java
index c24e5e4d9ac..d1ed88b1251 100644
--- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java
+++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java
@@ -31,7 +31,7 @@ public class Response {
public static final byte OK = 20;
/**
- * clien side timeout.
+ * client side timeout.
*/
public static final byte CLIENT_TIMEOUT = 30;
diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
index 5ec3fbec44f..f79d99df504 100644
--- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
+++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
@@ -265,7 +265,7 @@ private void invokeCallback(ResponseCallback c) {
try {
callbackCopy.done(res.getResult());
} catch (Exception e) {
- logger.error("callback invoke error .reasult:" + res.getResult() + ",url:" + channel.getUrl(), e);
+ logger.error("callback invoke error .result:" + res.getResult() + ",url:" + channel.getUrl(), e);
}
} else if (res.getStatus() == Response.CLIENT_TIMEOUT || res.getStatus() == Response.SERVER_TIMEOUT) {
try {
diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractServer.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractServer.java
index b3bd6077144..c95183835b9 100644
--- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractServer.java
+++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractServer.java
@@ -202,7 +202,7 @@ public void connected(Channel ch) throws RemotingException {
public void disconnected(Channel ch) throws RemotingException {
Collection channels = getChannels();
if (channels.isEmpty()) {
- logger.warn("All clients has discontected from " + ch.getLocalAddress() + ". You can graceful shutdown now.");
+ logger.warn("All clients has disconnected from " + ch.getLocalAddress() + ". You can graceful shutdown now.");
}
super.disconnected(ch);
}
diff --git a/dubbo-remoting/dubbo-remoting-netty/src/main/java/org/apache/dubbo/remoting/transport/netty/NettyBackedChannelBuffer.java b/dubbo-remoting/dubbo-remoting-netty/src/main/java/org/apache/dubbo/remoting/transport/netty/NettyBackedChannelBuffer.java
index 2eb73a0db54..3bd911fedf6 100644
--- a/dubbo-remoting/dubbo-remoting-netty/src/main/java/org/apache/dubbo/remoting/transport/netty/NettyBackedChannelBuffer.java
+++ b/dubbo-remoting/dubbo-remoting-netty/src/main/java/org/apache/dubbo/remoting/transport/netty/NettyBackedChannelBuffer.java
@@ -261,7 +261,7 @@ public void readBytes(ChannelBuffer dst) {
@Override
public void readBytes(ChannelBuffer dst, int length) {
- // carefule
+ // careful
if (length > dst.writableBytes()) {
throw new IndexOutOfBoundsException();
}
diff --git a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyBackedChannelBuffer.java b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyBackedChannelBuffer.java
index 143660a3d93..c6e0c6ddee1 100644
--- a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyBackedChannelBuffer.java
+++ b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyBackedChannelBuffer.java
@@ -261,7 +261,7 @@ public void readBytes(ChannelBuffer dst) {
@Override
public void readBytes(ChannelBuffer dst, int length) {
- // carefule
+ // careful
if (length > dst.writableBytes()) {
throw new IndexOutOfBoundsException();
}
diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContext.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContext.java
index bf166066b6a..b3bf4152fe6 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContext.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContext.java
@@ -42,7 +42,7 @@ public interface AsyncContext {
void write(Object value);
/**
- * @return true if the aysnc context is started
+ * @return true if the async context is started
*/
boolean isAsyncStarted();
diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContextImpl.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContextImpl.java
index 0142f739153..77cf0bd17b8 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContextImpl.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContextImpl.java
@@ -26,7 +26,7 @@ public class AsyncContextImpl implements AsyncContext {
private static final Logger logger = LoggerFactory.getLogger(AsyncContextImpl.class);
private final AtomicBoolean started = new AtomicBoolean(false);
- private final AtomicBoolean stoped = new AtomicBoolean(false);
+ private final AtomicBoolean stopped = new AtomicBoolean(false);
private CompletableFuture future;
@@ -63,7 +63,7 @@ public boolean isAsyncStarted() {
@Override
public boolean stop() {
- return stoped.compareAndSet(false, true);
+ return stopped.compareAndSet(false, true);
}
@Override
diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/AccessLogFilter.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/AccessLogFilter.java
index 89eb070603d..382a354d77a 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/AccessLogFilter.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/AccessLogFilter.java
@@ -20,6 +20,7 @@
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
+import org.apache.dubbo.common.threadlocal.InternalThreadLocal;
import org.apache.dubbo.common.utils.ConcurrentHashSet;
import org.apache.dubbo.common.utils.ConfigUtils;
import org.apache.dubbo.common.utils.NamedThreadFactory;
@@ -29,11 +30,11 @@
import org.apache.dubbo.rpc.Result;
import org.apache.dubbo.rpc.RpcContext;
import org.apache.dubbo.rpc.RpcException;
-
-import com.alibaba.fastjson.JSON;
+import org.apache.dubbo.rpc.support.AccessLogData;
import java.io.File;
import java.io.FileWriter;
+import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
@@ -43,7 +44,6 @@
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
/**
@@ -67,88 +67,49 @@ public class AccessLogFilter implements Filter {
private static final String ACCESS_LOG_KEY = "dubbo.accesslog";
- private static final String FILE_DATE_FORMAT = "yyyyMMdd";
-
- private static final String MESSAGE_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
-
private static final int LOG_MAX_BUFFER = 5000;
private static final long LOG_OUTPUT_INTERVAL = 5000;
- private final ConcurrentMap> logQueue = new ConcurrentHashMap>();
+ private static final SimpleDateFormat FILE_DATE_FORMATTER = new SimpleDateFormat("yyyyMMdd");
- private final ScheduledExecutorService logScheduled = Executors.newScheduledThreadPool(2, new NamedThreadFactory("Dubbo-Access-Log", true));
+ private static final SimpleDateFormat MESSAGE_DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- private volatile ScheduledFuture> logFuture = null;
+ private final ConcurrentMap> logQueue = new ConcurrentHashMap>();
- private void init() {
- if (logFuture == null) {
- synchronized (logScheduled) {
- if (logFuture == null) {
- logFuture = logScheduled.scheduleWithFixedDelay(new LogTask(), LOG_OUTPUT_INTERVAL, LOG_OUTPUT_INTERVAL, TimeUnit.MILLISECONDS);
- }
- }
- }
- }
+ private static final ScheduledExecutorService logScheduled = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("Dubbo-Access-Log", true));
- private void log(String accesslog, String logmessage) {
- init();
- Set logSet = logQueue.get(accesslog);
- if (logSet == null) {
- logQueue.putIfAbsent(accesslog, new ConcurrentHashSet());
- logSet = logQueue.get(accesslog);
- }
- if (logSet.size() < LOG_MAX_BUFFER) {
- logSet.add(logmessage);
+ private static final InternalThreadLocal INLINE_MESSAGE_DATE_FORMATTER = new InternalThreadLocal() {
+ @Override
+ protected SimpleDateFormat initialValue() {
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
}
+ };
+
+ /**
+ * Default constructor initialize demon thread for writing into access log file with names with access log key
+ * defined in url accesslog
+ */
+ public AccessLogFilter() {
+ logScheduled.scheduleWithFixedDelay(this::writeLogToFile, LOG_OUTPUT_INTERVAL, LOG_OUTPUT_INTERVAL, TimeUnit.MILLISECONDS);
}
+ /**
+ * This method logs the access log for service method invocation call.
+ *
+ * @param invoker service
+ * @param inv Invocation service method.
+ * @return Result from service method.
+ * @throws RpcException
+ */
+
@Override
public Result invoke(Invoker> invoker, Invocation inv) throws RpcException {
try {
- String accesslog = invoker.getUrl().getParameter(Constants.ACCESS_LOG_KEY);
- if (ConfigUtils.isNotEmpty(accesslog)) {
- RpcContext context = RpcContext.getContext();
- String serviceName = invoker.getInterface().getName();
- String version = invoker.getUrl().getParameter(Constants.VERSION_KEY);
- String group = invoker.getUrl().getParameter(Constants.GROUP_KEY);
- StringBuilder sn = new StringBuilder();
- sn.append("[").append(new SimpleDateFormat(MESSAGE_DATE_FORMAT).format(new Date())).append("] ").append(context.getRemoteHost()).append(":").append(context.getRemotePort())
- .append(" -> ").append(context.getLocalHost()).append(":").append(context.getLocalPort())
- .append(" - ");
- if (null != group && group.length() > 0) {
- sn.append(group).append("/");
- }
- sn.append(serviceName);
- if (null != version && version.length() > 0) {
- sn.append(":").append(version);
- }
- sn.append(" ");
- sn.append(inv.getMethodName());
- sn.append("(");
- Class>[] types = inv.getParameterTypes();
- if (types != null && types.length > 0) {
- boolean first = true;
- for (Class> type : types) {
- if (first) {
- first = false;
- } else {
- sn.append(",");
- }
- sn.append(type.getName());
- }
- }
- sn.append(") ");
- Object[] args = inv.getArguments();
- if (args != null && args.length > 0) {
- sn.append(JSON.toJSONString(args));
- }
- String msg = sn.toString();
- if (ConfigUtils.isDefault(accesslog)) {
- LoggerFactory.getLogger(ACCESS_LOG_KEY + "." + invoker.getInterface().getName()).info(msg);
- } else {
- log(accesslog, msg);
- }
+ String accessLogKey = invoker.getUrl().getParameter(Constants.ACCESS_LOG_KEY);
+ if (ConfigUtils.isNotEmpty(accessLogKey)) {
+ AccessLogData logData = buildAccessLogData(invoker, inv);
+ log(accessLogKey, logData);
}
} catch (Throwable t) {
logger.warn("Exception in AcessLogFilter of service(" + invoker + " -> " + inv + ")", t);
@@ -156,50 +117,97 @@ public Result invoke(Invoker> invoker, Invocation inv) throws RpcException {
return invoker.invoke(inv);
}
- private class LogTask implements Runnable {
- @Override
- public void run() {
- try {
- if (logQueue != null && logQueue.size() > 0) {
- for (Map.Entry> entry : logQueue.entrySet()) {
- try {
- String accesslog = entry.getKey();
- Set logSet = entry.getValue();
- File file = new File(accesslog);
- File dir = file.getParentFile();
- if (null != dir && !dir.exists()) {
- dir.mkdirs();
- }
- if (logger.isDebugEnabled()) {
- logger.debug("Append log to " + accesslog);
- }
- if (file.exists()) {
- String now = new SimpleDateFormat(FILE_DATE_FORMAT).format(new Date());
- String last = new SimpleDateFormat(FILE_DATE_FORMAT).format(new Date(file.lastModified()));
- if (!now.equals(last)) {
- File archive = new File(file.getAbsolutePath() + "." + last);
- file.renameTo(archive);
- }
- }
- FileWriter writer = new FileWriter(file, true);
- try {
- for (Iterator iterator = logSet.iterator();
- iterator.hasNext();
- iterator.remove()) {
- writer.write(iterator.next());
- writer.write("\r\n");
- }
- writer.flush();
- } finally {
- writer.close();
- }
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
+ private void log(String accessLog, AccessLogData accessLogData) {
+ Set logSet = logQueue.get(accessLog);
+ if (logSet == null) {
+ logQueue.putIfAbsent(accessLog, new ConcurrentHashSet());
+ logSet = logQueue.get(accessLog);
+ }
+ if (logSet.size() < LOG_MAX_BUFFER) {
+ logSet.add(accessLogData);
+ }
+ }
+
+ private void writeLogToFile() {
+ if (!logQueue.isEmpty()) {
+ for (Map.Entry> entry : logQueue.entrySet()) {
+ try {
+ String accessLog = entry.getKey();
+ Set logSet = entry.getValue();
+ if (ConfigUtils.isDefault(accessLog)) {
+ processWithServiceLogger(logSet);
+ } else {
+ File file = new File(accessLog);
+ createIfLogDirAbsent(file);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Append log to " + accessLog);
}
+ renameFile(file);
+ processWithAccessKeyLogger(logSet, file);
}
+
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
}
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
+ }
+ }
+ }
+
+ private void processWithAccessKeyLogger(Set logSet, File file) throws IOException {
+ FileWriter writer = new FileWriter(file, true);
+ try {
+ for (Iterator iterator = logSet.iterator();
+ iterator.hasNext();
+ iterator.remove()) {
+ writer.write(iterator.next().getLogMessage(MESSAGE_DATE_FORMATTER));
+ writer.write("\r\n");
+ }
+ writer.flush();
+ } finally {
+ writer.close();
+ }
+ }
+
+ private AccessLogData buildAccessLogData(Invoker> invoker, Invocation inv) {
+ RpcContext context = RpcContext.getContext();
+ AccessLogData logData = AccessLogData.newLogData();
+ logData.setServiceName(invoker.getInterface().getName());
+ logData.setMethodName(inv.getMethodName());
+ logData.setVersion(invoker.getUrl().getParameter(Constants.VERSION_KEY));
+ logData.setGroup(invoker.getUrl().getParameter(Constants.GROUP_KEY));
+ logData.setInvocationTime(new Date());
+ logData.setLocalHost(context.getLocalHost());
+ logData.setLocalPort(context.getLocalPort());
+ logData.setRemoteHost(context.getRemoteHost());
+ logData.setRemotePort(context.getRemotePort());
+ logData.setTypes(inv.getParameterTypes());
+ logData.setArguments(inv.getArguments());
+ return logData;
+ }
+
+ private void processWithServiceLogger(Set logSet) {
+ for (Iterator iterator = logSet.iterator();
+ iterator.hasNext();
+ iterator.remove()) {
+ AccessLogData logData = iterator.next();
+ LoggerFactory.getLogger(ACCESS_LOG_KEY + "." + logData.getServiceName()).info(logData.getLogMessage(MESSAGE_DATE_FORMATTER));
+ }
+ }
+
+ private void createIfLogDirAbsent(File file) {
+ File dir = file.getParentFile();
+ if (null != dir && !dir.exists()) {
+ dir.mkdirs();
+ }
+ }
+
+ private void renameFile(File file) {
+ if (file.exists()) {
+ String now = FILE_DATE_FORMATTER.format(new Date());
+ String last = FILE_DATE_FORMATTER.format(new Date(file.lastModified()));
+ if (!now.equals(last)) {
+ File archive = new File(file.getAbsolutePath() + "." + last);
+ file.renameTo(archive);
}
}
}
diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/tps/DefaultTPSLimiter.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/tps/DefaultTPSLimiter.java
index 71b579bc75d..a623e2e6bdf 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/tps/DefaultTPSLimiter.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/tps/DefaultTPSLimiter.java
@@ -24,7 +24,7 @@
import java.util.concurrent.ConcurrentMap;
/**
- * DefaultTPSLimiter is a default implementation for tps filter. It is an in memory based implementation for stroring
+ * DefaultTPSLimiter is a default implementation for tps filter. It is an in memory based implementation for storing
* tps information. It internally use
*
* @see org.apache.dubbo.rpc.filter.TpsLimitFilter
diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/AccessLogData.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/AccessLogData.java
new file mode 100644
index 00000000000..e7f18c0af13
--- /dev/null
+++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/AccessLogData.java
@@ -0,0 +1,249 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.dubbo.rpc.support;
+
+import com.alibaba.fastjson.JSON;
+import org.apache.dubbo.common.utils.StringUtils;
+
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * AccessLogData is a container for log event data. In internally uses map and store each filed of log as value. It does not generate any
+ * dynamic value e.g. time stamp, local jmv machine host address etc. It does not allow any null or empty key.
+ */
+public final class AccessLogData {
+ /**
+ * Access log keys
+ */
+ private enum KEYS {
+ VERSION, GROUP, SERVICE, METHOD_NAME, INVOCATION_TIME, TYPES
+ ,ARGUMENTS, REMOTE_HOST, REMOTE_PORT, LOCAL_HOST, LOCAL_PORT
+ }
+
+ /**
+ * This is used to store log data in key val format.
+ */
+ private Map data;
+
+ /**
+ * Default constructor.
+ */
+ private AccessLogData() {
+ data = new HashMap<>();
+ }
+
+ /**
+ * Get new instance of log data.
+ *
+ * @return instance of AccessLogData
+ */
+ public static AccessLogData newLogData() {
+ return new AccessLogData();
+ }
+
+ /**
+ * Sets the access log key
+ * @param accessLogKey
+ */
+ public void setAccessLogKey(String accessLogKey) {
+
+ }
+ /**
+ * Add version information.
+ *
+ * @param version
+ */
+ public void setVersion(String version) {
+ set(KEYS.VERSION, version);
+ }
+
+ /**
+ * Add service name.
+ *
+ * @param serviceName
+ */
+ public void setServiceName(String serviceName) {
+ set(KEYS.SERVICE, serviceName);
+ }
+
+ /**
+ * Add group name
+ *
+ * @param group
+ */
+ public void setGroup(String group) {
+ set(KEYS.GROUP, group);
+ }
+
+ /**
+ * Set the invocation date. As an argument it accept date string.
+ *
+ * @param invocationTime
+ */
+ public void setInvocationTime(Date invocationTime) {
+ set(KEYS.INVOCATION_TIME, invocationTime);
+ }
+
+ /**
+ * Set caller remote host
+ *
+ * @param remoteHost
+ */
+ public void setRemoteHost(String remoteHost) {
+ set(KEYS.REMOTE_HOST, remoteHost);
+ }
+
+ /**
+ * Set caller remote port.
+ *
+ * @param remotePort
+ */
+ public void setRemotePort(Integer remotePort) {
+ set(KEYS.REMOTE_PORT, remotePort);
+ }
+
+ /**
+ * Set local host
+ *
+ * @param localHost
+ */
+ public void setLocalHost(String localHost) {
+ set(KEYS.LOCAL_HOST, localHost);
+ }
+
+ /**
+ * Set local port of exported service
+ *
+ * @param localPort
+ */
+ public void setLocalPort(Integer localPort) {
+ set(KEYS.LOCAL_PORT, localPort);
+ }
+
+ /**
+ * Set target method name.
+ *
+ * @param methodName
+ */
+ public void setMethodName(String methodName) {
+ set(KEYS.METHOD_NAME, methodName);
+ }
+
+ /**
+ * Set invocation's method's input parameter's types
+ *
+ * @param types
+ */
+ public void setTypes(Class[] types) {
+ set(KEYS.TYPES, types != null ? Arrays.copyOf(types, types.length) : null);
+ }
+
+ /**
+ * Sets invocation arguments
+ *
+ * @param arguments
+ */
+ public void setArguments(Object[] arguments) {
+ set(KEYS.ARGUMENTS, arguments != null ? Arrays.copyOf(arguments, arguments.length) : null);
+ }
+
+ /**
+ * Return gthe service of access log entry
+ * @return
+ */
+ public String getServiceName() {
+ return get(KEYS.SERVICE).toString();
+ }
+
+
+ public String getLogMessage(SimpleDateFormat sdf) {
+ StringBuilder sn = new StringBuilder();
+
+ sn.append("[")
+ .append(sdf.format(get(KEYS.INVOCATION_TIME)))
+ .append("] ")
+ .append(get(KEYS.REMOTE_HOST))
+ .append(":")
+ .append(get(KEYS.REMOTE_PORT))
+ .append(" -> ")
+ .append(get(KEYS.LOCAL_HOST))
+ .append(":")
+ .append(get(KEYS.LOCAL_PORT))
+ .append(" - ");
+
+ String group = get(KEYS.GROUP) != null ? get(KEYS.GROUP).toString() : "";
+ if (StringUtils.isNotEmpty(group.toString())) {
+ sn.append(group).append("/");
+ }
+
+ sn.append(get(KEYS.SERVICE));
+
+ String version = get(KEYS.VERSION) != null ? get(KEYS.VERSION).toString() : "";
+ if (StringUtils.isNotEmpty(version.toString())) {
+ sn.append(":").append(version);
+ }
+
+ sn.append(" ");
+ sn.append(get(KEYS.METHOD_NAME));
+
+ sn.append("(");
+ Class>[] types = get(KEYS.TYPES) != null? (Class>[]) get(KEYS.TYPES) : new Class[0];
+ boolean first = true;
+ for (Class> type : types) {
+ if (first) {
+ first = false;
+ } else {
+ sn.append(",");
+ }
+ sn.append(type.getName());
+ }
+ sn.append(") ");
+
+
+ Object[] args = get(KEYS.ARGUMENTS) !=null ? (Object[]) get(KEYS.ARGUMENTS) : null;
+ if (args != null && args.length > 0) {
+ sn.append(JSON.toJSONString(args));
+ }
+
+ return sn.toString();
+ }
+
+ /**
+ * Return value of key
+ *
+ * @param key
+ * @return
+ */
+ private Object get(KEYS key) {
+ return data.get(key);
+ }
+
+ /**
+ * Add log key along with his value.
+ *
+ * @param key Any not null or non empty string
+ * @param value Any object including null.
+ */
+ private void set(KEYS key, Object value) {
+ data.put(key, value);
+ }
+
+}
diff --git a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/AccessLogFilterTest.java b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/AccessLogFilterTest.java
index 05b1aa91f2a..d44bfc5160e 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/AccessLogFilterTest.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/AccessLogFilterTest.java
@@ -55,6 +55,15 @@ public void testDefault() {
accessLogFilter.invoke(invoker, invocation);
}
+ @Test
+ public void testDefaultWithMultipleLog() throws InterruptedException {
+ URL url = URL.valueOf("test://test:11/test?accesslog=true&group=dubbo&version=1.1");
+ Invoker invoker = new MyInvoker(url);
+ Invocation invocation = new MockInvocation();
+ accessLogFilter.invoke(invoker, invocation);
+ Thread.sleep(7000);
+ }
+
@Test
public void testCustom() {
URL url = URL.valueOf("test://test:11/test?accesslog=custom-access.log");
@@ -63,4 +72,15 @@ public void testCustom() {
accessLogFilter.invoke(invoker, invocation);
}
+ @Test
+ public void testCustomWithMultipleLog() throws InterruptedException {
+ URL url = URL.valueOf("test://test:11/test?accesslog=custom-access.log");
+ Invoker invoker = new MyInvoker(url);
+ Invocation invocation = new MockInvocation();
+ for(int i=0;i<10;i++) {
+ accessLogFilter.invoke(invoker, invocation);
+ }
+ Thread.sleep(7000);
+ }
+
}
\ No newline at end of file
diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboInvoker.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboInvoker.java
index 93343c0c26f..ee269358997 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboInvoker.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboInvoker.java
@@ -97,7 +97,7 @@ protected Result doInvoke(final Invocation invocation) throws Throwable {
Result result;
if (isAsyncFuture) {
- // register resultCallback, sometimes we need the asyn result being processed by the filter chain.
+ // register resultCallback, sometimes we need the async result being processed by the filter chain.
result = new AsyncRpcResult(futureAdapter, futureAdapter.getResultFuture(), false);
} else {
result = new SimpleAsyncRpcResult(futureAdapter, futureAdapter.getResultFuture(), false);
diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java
index 2d35af42748..834711515f8 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java
@@ -36,7 +36,7 @@
final class ReferenceCountExchangeClient implements ExchangeClient {
private final URL url;
- private final AtomicInteger refenceCount = new AtomicInteger(0);
+ private final AtomicInteger referenceCount = new AtomicInteger(0);
// private final ExchangeHandler handler;
private final ConcurrentMap ghostClientMap;
@@ -45,7 +45,7 @@ final class ReferenceCountExchangeClient implements ExchangeClient {
public ReferenceCountExchangeClient(ExchangeClient client, ConcurrentMap ghostClientMap) {
this.client = client;
- refenceCount.incrementAndGet();
+ referenceCount.incrementAndGet();
this.url = client.getUrl();
if (ghostClientMap == null) {
throw new IllegalStateException("ghostClientMap can not be null, url: " + url);
@@ -148,7 +148,7 @@ public void close() {
@Override
public void close(int timeout) {
- if (refenceCount.decrementAndGet() <= 0) {
+ if (referenceCount.decrementAndGet() <= 0) {
if (timeout == 0) {
client.close();
} else {
@@ -189,6 +189,6 @@ public boolean isClosed() {
}
public void incrementAndGetCount() {
- refenceCount.incrementAndGet();
+ referenceCount.incrementAndGet();
}
}
diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/ListTelnetHandler.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/ListTelnetHandler.java
index 5a933814de3..94337623de9 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/ListTelnetHandler.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/ListTelnetHandler.java
@@ -46,7 +46,7 @@ public String telnet(Channel channel, String message) {
detail = true;
} else {
if (service != null && service.length() > 0) {
- return "Invaild parameter " + part;
+ return "Invalid parameter " + part;
}
service = part;
}