Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
tinycedar committed Jan 11, 2019
1 parent 36ae036 commit 8c9eb86
Show file tree
Hide file tree
Showing 22 changed files with 52 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static <S> S load(Class<S> service, String activateName, ClassLoader load
* @return
*/
@SuppressWarnings("rawtypes")
public static <S> List<Class> getAllExtendsionClass(Class<S> service) {
public static <S> List<Class> getAllExtensionClass(Class<S> service) {
return findAllExtensionClass(service, null, findClassLoader());
}

Expand All @@ -110,7 +110,7 @@ public static <S> List<Class> getAllExtendsionClass(Class<S> service) {
* @return
*/
@SuppressWarnings("rawtypes")
public static <S> List<Class> getAllExtendsionClass(Class<S> service, ClassLoader loader) {
public static <S> List<Class> getAllExtensionClass(Class<S> service, ClassLoader loader) {
return findAllExtensionClass(service, null, loader);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private static InetAddress getLocalAddress0() {
return localAddress;
}
} catch (Throwable e) {
LOGGER.warn("Failed to retriving ip address, " + e.getMessage(), e);
LOGGER.warn("Failed to retrieving ip address, " + e.getMessage(), e);
}
try {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
Expand All @@ -126,17 +126,17 @@ private static InetAddress getLocalAddress0() {
return address;
}
} catch (Throwable e) {
LOGGER.warn("Failed to retriving ip address, " + e.getMessage(), e);
LOGGER.warn("Failed to retrieving ip address, " + e.getMessage(), e);
}
}
}
} catch (Throwable e) {
LOGGER.warn("Failed to retriving ip address, " + e.getMessage(), e);
LOGGER.warn("Failed to retrieving ip address, " + e.getMessage(), e);
}
}
}
} catch (Throwable e) {
LOGGER.warn("Failed to retriving ip address, " + e.getMessage(), e);
LOGGER.warn("Failed to retrieving ip address, " + e.getMessage(), e);
}
LOGGER.error("Could not get local host ip address, will use 127.0.0.1 instead.");
return localAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

package com.alibaba.fescar.core.protocol;

public class UncompatibleVersionException extends Exception {
public class IncompatibleVersionException extends Exception {

public UncompatibleVersionException(String message) {
public IncompatibleVersionException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static String getChannelVersion(Channel c) {
return VERSION_MAP.get(NetUtil.toStringAddress(c.remoteAddress()));
}

public static String checkVersion(String version) throws UncompatibleVersionException {
public static String checkVersion(String version) throws IncompatibleVersionException {
// TODO: check
return version;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ private static RpcContext buildChannelHolder(TransactionRole clientRole, String
*
* @param request the request
* @param channel the channel
* @throws UncompatibleVersionException the uncompatible version exception
* @throws IncompatibleVersionException the incompatible version exception
*/
public static void registerTMChannel(RegisterTMRequest request, Channel channel)
throws UncompatibleVersionException {
throws IncompatibleVersionException {
Version.checkVersion(request.getVersion());
RpcContext rpcContext = buildChannelHolder(TransactionRole.TMROLE, request.getVersion(),
request.getApplicationId(),
Expand All @@ -143,10 +143,10 @@ public static void registerTMChannel(RegisterTMRequest request, Channel channel)
*
* @param resourceManagerRequest the resource manager request
* @param channel the channel
* @throws UncompatibleVersionException the uncompatible version exception
* @throws IncompatibleVersionException the incompatible version exception
*/
public static void registerRMChannel(RegisterRMRequest resourceManagerRequest, Channel channel)
throws UncompatibleVersionException {
throws IncompatibleVersionException {
Version.checkVersion(resourceManagerRequest.getVersion());
Set<String> dbkeySet = dbKeytoSet(resourceManagerRequest.getResourceIds());
RpcContext rpcContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void onRegRmMessage(long msgId, ChannelHandlerContext ctx, RegisterRMRequ

boolean isSuccess = false;
try {
if (null == checkAuthHandler || null != checkAuthHandler && checkAuthHandler.regResourceManagerChecKAuth(
if (null == checkAuthHandler || null != checkAuthHandler && checkAuthHandler.regResourceManagerCheckAuth(
message)) {
ChannelManager.registerRMChannel(message, ctx.channel());
Version.putChannelVersion(ctx.channel(), message.getVersion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ public void setGroup(String group) {
}

/**
* Destory channel.
* Destroy channel.
*
* @param channel the channel
*/
Expand All @@ -485,7 +485,7 @@ public void destroyChannel(Channel channel) {
}

/**
* Destory channel.
* Destroy channel.
*
* @param serverAddress the server address
* @param channel the channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ protected Channel getNewChannel(InetSocketAddress address) {
try {
f.await(this.nettyClientConfig.getConnectTimeoutMillis(), TimeUnit.MILLISECONDS);
if (f.isCancelled()) {
throw new FrameworkException("connect concelled, can not connect to fescar-server.");
throw new FrameworkException("connect cancelled, can not connect to fescar-server.");
} else if (!f.isSuccess()) {
throw new FrameworkException("connect failed, can not connect to fescar-server.");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class MessageCodecHandler extends ByteToMessageCodec<RpcMessage> {

private static final Logger LOGGER = LoggerFactory.getLogger(MessageCodecHandler.class);
private static short MAGIC = (short)0xdada;
private static int HEAD_LENGHT = 14;
private static int HEAD_LENGTH = 14;
private static final int FLAG_REQUEST = 0x80;
private static final int FLAG_ASYNC = 0x40;
private static final int FLAG_HEARTBEAT = 0x20;
Expand Down Expand Up @@ -122,11 +122,11 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) t
LOGGER.info("please notice magicIndex is not zero offset!!!");
}
in.skipBytes(magicIndex - in.readerIndex());
if (in.readableBytes() < HEAD_LENGHT) {
if (in.readableBytes() < HEAD_LENGTH) {
LOGGER.error("decode less than header length");
return;
}
byte[] buffer = new byte[HEAD_LENGHT];
byte[] buffer = new byte[HEAD_LENGTH];
in.readBytes(buffer);
ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
short magic = byteBuffer.getShort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public Class<? extends Channel> getClientChannelClazz() {
}

/**
* Enable nactive boolean.
* Enable native boolean.
*
* @return the boolean
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public Channel makeObject(NettyPoolKey key) throws Exception {
}
if (LOGGER.isInfoEnabled()) {
LOGGER.info(
"register sucesss, cost " + (System.currentTimeMillis() - start) + " ms, version:"
"register success, cost " + (System.currentTimeMillis() - start) + " ms, version:"
+ getVersion(response, key.getTransactionRole()) + ",role:" + key.getTransactionRole().name()
+ ",channel:" + channelToServer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public interface RegisterCheckAuthHandler {
boolean regTransactionManagerCheckAuth(RegisterTMRequest request);

/**
* Reg resource manager chec k auth boolean.
* Reg resource manager check auth boolean.
*
* @param request the request
* @return the boolean
*/
boolean regResourceManagerChecKAuth(RegisterRMRequest request);
boolean regResourceManagerCheckAuth(RegisterRMRequest request);
}
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ public void onRegisterMsgSuccess(String serverAddress, Channel channel, Object r

if (LOGGER.isInfoEnabled()) {
LOGGER.info(
"register RM sucesss. server version:" + ((RegisterRMResponse)response).getVersion()
"register RM success. server version:" + ((RegisterRMResponse)response).getVersion()
+ ",channel:" + channel);
}
if (customerKeys == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void destroy() {

/**
* Send request.
* handle asyn branch commit and rollback
* handle async branch commit and rollback
*
* @param dbKey the db key
* @param clientIp the client ip
Expand Down Expand Up @@ -356,7 +356,7 @@ private void handleDisconnect(ChannelHandlerContext ctx) {
}
} else {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("remove unuse channel:" + ctx.channel());
LOGGER.info("remove unused channel:" + ctx.channel());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public class FileTransactionStoreManager implements TransactionStoreManager {
private static final AtomicLong FILE_TRX_NUM = new AtomicLong(0);
private static final AtomicLong FILE_FLUSH_NUM = new AtomicLong(0);
private static final int MARK_SIZE = 4;
private static final int MAX_POOL_TIMEMILLS = 2 * 1000;
private static final int MAX_FLUSH_TIMEMILLS = 2 * 1000;
private static final int MAX_POOL_TIME_MILLS = 2 * 1000;
private static final int MAX_FLUSH_TIME_MILLS = 2 * 1000;
private static final int MAX_FLUSH_NUM = 10;
private static int PER_FILE_BLOCK_SIZE = 65535 * 8;
private static long MAX_TRX_TIMEOUT_MILLS = 30 * 60 * 1000;
private static volatile long trxStartTimeMills = System.currentTimeMillis();
private static final boolean ENABLE_SCHEDULE_FUSH = true;
private static final boolean ENABLE_SCHEDULE_FLUSH = true;
private File currDataFile;
private RandomAccessFile currRaf;
private FileChannel currFileChannel;
Expand Down Expand Up @@ -263,10 +263,10 @@ class WriteDataFileRunnable implements Runnable {
public void run() {
while (!stopping) {
try {
TransactionWriteFuture transactionWriteFuture = transactionWriteFutureQueue.poll(MAX_POOL_TIMEMILLS,
TransactionWriteFuture transactionWriteFuture = transactionWriteFutureQueue.poll(MAX_POOL_TIME_MILLS,
TimeUnit.MILLISECONDS);
if (null == transactionWriteFuture) {
flushOnCondtion();
flushOnCondition();
continue;
}
if (transactionWriteFuture.isTimeout()) {
Expand All @@ -276,7 +276,7 @@ public void run() {
if (writeDataFile(transactionWriteFuture.getWriteStore().encode())) {
transactionWriteFuture.setResult(Boolean.TRUE);
FILE_TRX_NUM.incrementAndGet();
flushOnCondtion();
flushOnCondition();
} else {
transactionWriteFuture.setResult(Boolean.FALSE);
}
Expand Down Expand Up @@ -314,12 +314,12 @@ private boolean writeDataFile(byte[] bs) {
return false;
}

private void flushOnCondtion() {
if (!ENABLE_SCHEDULE_FUSH) { return; }
private void flushOnCondition() {
if (!ENABLE_SCHEDULE_FLUSH) { return; }
long diff = FILE_TRX_NUM.get() - FILE_FLUSH_NUM.get();
if (diff == 0) { return; }
if (diff % MAX_FLUSH_NUM == 0
|| System.currentTimeMillis() - currDataFile.lastModified() > MAX_FLUSH_TIMEMILLS) {
|| System.currentTimeMillis() - currDataFile.lastModified() > MAX_FLUSH_TIME_MILLS) {
try {
currFileChannel.force(false);
} catch (IOException exx) {
Expand Down
2 changes: 1 addition & 1 deletion server/src/test/java/WriteStoreTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public Collection<GlobalSession> allSessions() {
}

@Override
public List<GlobalSession> findGlobalSessions(SessionCondition condtion) {
public List<GlobalSession> findGlobalSessions(SessionCondition condition) {
List<GlobalSession> globalSessions = new ArrayList<>();
int begin = 10000;
int num = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class GlobalTransactionScanner extends AbstractAutoProxyCreator implement
private final FailureHandler failureHandlerHook;

/**
* Instantiates a new Global transaction scaner.
* Instantiates a new Global transaction scanner.
*
* @param txServiceGroup the tx service group
*/
Expand All @@ -81,7 +81,7 @@ public GlobalTransactionScanner(String txServiceGroup) {
}

/**
* Instantiates a new Global transaction scaner.
* Instantiates a new Global transaction scanner.
*
* @param txServiceGroup the tx service group
* @param mode the mode
Expand All @@ -91,7 +91,7 @@ public GlobalTransactionScanner(String txServiceGroup, int mode) {
}

/**
* Instantiates a new Global transaction scaner.
* Instantiates a new Global transaction scanner.
*
* @param applicationId the application id
* @param txServiceGroup the default server group
Expand All @@ -101,7 +101,7 @@ public GlobalTransactionScanner(String applicationId, String txServiceGroup) {
}

/**
* Instantiates a new Global transaction scaner.
* Instantiates a new Global transaction scanner.
*
* @param applicationId the application id
* @param txServiceGroup the tx service group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public @interface GlobalTransactional {

/**
* Global transacton timeoutMills in MILLISECONDS.
* Global transaction timeoutMills in MILLISECONDS.
* @return timeoutMills in MILLISECONDS.
*/
int timeoutMills() default 60000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ private String formatMethod(Method method) {
sb.append("(");

int paramPos = 0;
for (Class<?> claz : params) {
sb.append(claz.getName());
for (Class<?> clazz : params) {
sb.append(clazz.getName());
if (++paramPos < params.length) {
sb.append(",");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class MethodDesc {
/**
* Instantiates a new Method desc.
*
* @param transactionAnnotation the trasaction annotation
* @param transactionAnnotation the transaction annotation
* @param method the method
*/
public MethodDesc(GlobalTransactional transactionAnnotation, Method method) {
Expand All @@ -43,18 +43,18 @@ public MethodDesc(GlobalTransactional transactionAnnotation, Method method) {
}

/**
* Gets trasaction annotation.
* Gets transaction annotation.
*
* @return the trasaction annotation
* @return the transaction annotation
*/
public GlobalTransactional getTransactionAnnotation() {
return transactionAnnotation;
}

/**
* Sets trasaction annotation.
* Sets transaction annotation.
*
* @param transactionAnnotation the trasaction annotation
* @param transactionAnnotation the transaction annotation
*/
public void setTransactionAnnotation(GlobalTransactional transactionAnnotation) {
this.transactionAnnotation = transactionAnnotation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.springframework.jdbc.core.JdbcTemplate;

public class DataSourceBasicTest {
public void runBussiness(JdbcTemplate jdbcTemplate) {
public void runBusiness(JdbcTemplate jdbcTemplate) {
// jdbcTemplate.update("insert into user0 (id, name, gmt) values (?, ?, ?)",
// new Object[] { 1, "xxx", new Date() });
jdbcTemplate.update("update user0 set name = 'yyyy' where id = ?", new Object[] {1});
Expand Down Expand Up @@ -86,7 +86,7 @@ public BranchStatus branchRollback(String xid, long branchId, String resourceId,
// directJdbcTemplate.execute("truncate table user0");

RootContext.bind("test_xid");
clientTest.runBussiness(jdbcTemplate);
clientTest.runBusiness(jdbcTemplate);

context.close();
System.exit(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface TransactionalExecutor {
Object execute() throws Throwable;

/**
* Global transacton timeout in MILLISECONDS.
* Global transaction timeout in MILLISECONDS.
*
* @return timeout in MILLISECONDS.
*/
Expand Down

0 comments on commit 8c9eb86

Please sign in to comment.