mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-13 04:15:22 +00:00
doc[zfoo]: 修改文档注释
This commit is contained in:
1 parent
c4cdf272eb
commit
745ce86878
116 files changed
+160
-162
No files matched your search
@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.zfoo.hotswap.manager.HotSwapManager;
|
||||
import com.zfoo.hotswap.service.HotSwapServiceMBean;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HotSwapContext {
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.lang.instrument.Instrumentation;
|
||||
* 甚至能够替换和修改某些类的定义。有了这样的功能,开发者就可以实现更为灵活的运行时虚拟机监控和 Java 类操作了,
|
||||
* 这样的特性实际上提供了一种虚拟机级别支持的 AOP 实现方式,使得开发者无需对 JDK 做任何升级和改动,就可以实现某些 AOP 的功能了。
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
*/
|
||||
public class HotSwapAgent {
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HotSwapManager implements IHotSwapManager {
|
||||
|
||||
private static final HotSwapManager HOT_SWAP_MANAGER = new HotSwapManager();
|
||||
|
||||
private static Map<String, ClassFileDef> classFileDefMap = new HashMap<>();
|
||||
private static final Map<String, ClassFileDef> classFileDefMap = new HashMap<>();
|
||||
|
||||
public static volatile byte[] updateBytes;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.zfoo.hotswap.model.ClassFileDef;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IHotSwapManager {
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.zfoo.hotswap.model;
|
||||
import com.zfoo.util.security.MD5Utils;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ClassFileDef {
|
||||
|
||||
@@ -36,7 +36,7 @@ import java.util.Map;
|
||||
* 根据JMX描述,MBean接口包括一些可读或者可写的属性,还有一些定义好的方法,这些方法能够被MBean管理应用程序调用。
|
||||
* 实现类,类名必须为接口sufixMBean的前缀。也就是Hello。如果不按这个命名注册MBean就会有问题。
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.zfoo.hotswap.service;
|
||||
import javax.management.MXBean;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@MXBean
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.io.IOException;
|
||||
import java.lang.instrument.ClassDefinition;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class HotSwapUtils {
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.junit.Test;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
*/
|
||||
@Ignore
|
||||
public class ApplicationTest {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
*/
|
||||
public class HotswapClass {
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.zfoo.protocol.util.StringUtils;
|
||||
import com.zfoo.scheduler.util.TimeUtils;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class DiskFileSystemVO implements Comparable<DiskFileSystemVO> {
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.zfoo.protocol.util.StringUtils;
|
||||
import com.zfoo.scheduler.util.TimeUtils;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class MemoryVO implements Comparable<MemoryVO> {
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class MonitorVO {
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.zfoo.protocol.util.StringUtils;
|
||||
import com.zfoo.scheduler.util.TimeUtils;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class SarVO implements Comparable<SarVO> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.zfoo.protocol.util.StringUtils;
|
||||
import com.zfoo.scheduler.util.TimeUtils;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class UptimeVO implements Comparable<UptimeVO> {
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* Oshi库封装的工具类,通过此工具类,可获取系统、硬件相关信息
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class OSUtils {
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.junit.Test;
|
||||
import oshi.SystemInfo;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ApplicationTest {
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.core.Ordered;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class OrmContext implements ApplicationListener<ApplicationContextEvent>, Ordered {
|
||||
|
||||
@@ -20,16 +20,16 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ConcurrentFileChannelHeapMap<V extends IPacket> implements LpMap<V>, Closeable {
|
||||
|
||||
private ReentrantLock fileChannelLock = new ReentrantLock();
|
||||
private final ReentrantLock fileChannelLock = new ReentrantLock();
|
||||
|
||||
private FileChannelMap<V> fileChannelMap;
|
||||
private final FileChannelMap<V> fileChannelMap;
|
||||
|
||||
private ConcurrentHeapMap<V> concurrentHeapMap;
|
||||
private final ConcurrentHeapMap<V> concurrentHeapMap;
|
||||
|
||||
public ConcurrentFileChannelHeapMap(String dbPath, Class<V> clazz) {
|
||||
fileChannelMap = new FileChannelMap<>(dbPath, clazz);
|
||||
|
||||
@@ -20,13 +20,13 @@ import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ConcurrentFileChannelMap<V extends IPacket> implements LpMap<V>, Closeable {
|
||||
|
||||
|
||||
private FileChannelMap<V> fileChannelMap;
|
||||
private final FileChannelMap<V> fileChannelMap;
|
||||
|
||||
public ConcurrentFileChannelMap(String dbPath, Class<V> clazz) {
|
||||
fileChannelMap = new FileChannelMap<>(dbPath, clazz);
|
||||
|
||||
@@ -20,14 +20,14 @@ import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ConcurrentHeapMap<V extends IPacket> implements LpMap<V> {
|
||||
|
||||
private ConcurrentNavigableMap<Long, V> map = new ConcurrentSkipListMap<>();
|
||||
private final ConcurrentNavigableMap<Long, V> map = new ConcurrentSkipListMap<>();
|
||||
|
||||
private AtomicLong maxIndexAtomic = new AtomicLong(0);
|
||||
private final AtomicLong maxIndexAtomic = new AtomicLong(0);
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,14 +19,14 @@ import java.io.IOException;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class FileChannelHeapMap<V extends IPacket> implements LpMap<V>, Closeable {
|
||||
|
||||
private FileChannelMap<V> fileChannelMap;
|
||||
private final FileChannelMap<V> fileChannelMap;
|
||||
|
||||
private HeapMap<V> heapMap;
|
||||
private final HeapMap<V> heapMap;
|
||||
|
||||
public FileChannelHeapMap(String dbPath, int initialCapacity, Class<V> clazz) {
|
||||
fileChannelMap = new FileChannelMap<>(dbPath, clazz);
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class FileChannelMap<V extends IPacket> implements LpMap<V>, Closeable {
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.nio.channels.FileChannel;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class FileHeapMap<V extends IPacket> implements LpMap<V> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import io.netty.util.collection.LongObjectHashMap;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HeapMap<V extends IPacket> implements LpMap<V> {
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.function.BiConsumer;
|
||||
* 类型固定的map,key为long,value为IPacket
|
||||
* 其中long必须大于等于0,value可以为null
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface LpMap<V extends IPacket> {
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.bson.Document;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IOrmManager {
|
||||
|
||||
@@ -58,7 +58,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class OrmManager implements IOrmManager {
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
/**
|
||||
* 对数据库进行(增,删,改)的相关方法
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IAccessor {
|
||||
|
||||
@@ -24,14 +24,13 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.mongodb.client.model.Filters.eq;
|
||||
import static com.mongodb.client.model.Filters.in;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class MongodbAccessor implements IAccessor {
|
||||
@@ -137,7 +136,7 @@ public class MongodbAccessor implements IAccessor {
|
||||
public <E extends IEntity<?>> E load(Object pk, Class<E> entityClazz) {
|
||||
var collection = OrmContext.getOrmManager().getCollection(entityClazz);
|
||||
var result = new ArrayList<E>(1);
|
||||
collection.find(eq("_id", pk)).forEach((Consumer<E>) document -> result.add(document));
|
||||
collection.find(eq("_id", pk)).forEach(document -> result.add(document));
|
||||
if (CollectionUtils.isEmpty(result)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.anno;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Documented
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.anno;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Documented
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.anno;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Documented
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.anno;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Documented
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.lang.annotation.*;
|
||||
/**
|
||||
* Mongodb不支持中文分词
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Documented
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.anno;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Documented
|
||||
|
||||
@@ -41,7 +41,7 @@ import java.util.function.BiConsumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class EntityCaches<PK extends Comparable<PK>, E extends IEntity<PK>> implements IEntityCaches<PK, E> {
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IEntityCaches<PK extends Comparable<PK>, E extends IEntity<PK>> {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
package com.zfoo.orm.model.config;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class CacheStrategy {
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.config;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HostConfig {
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.config;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class OrmConfig {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
package com.zfoo.orm.model.config;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class PersisterStrategy {
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.orm.model.vo.EntityDef;
|
||||
import com.zfoo.protocol.util.StringUtils;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public enum PersisterTypeEnum {
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.entity;
|
||||
import com.zfoo.protocol.util.StringUtils;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IEntity<PK extends Comparable<PK>> {
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.zfoo.orm.model.cache.EntityCaches;
|
||||
import com.zfoo.orm.model.vo.EntityDef;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class AbstractOrmPersister implements IOrmPersister {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
package com.zfoo.orm.model.persister;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IOrmPersister {
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.scheduler.util.TimeUtils;
|
||||
* <p>
|
||||
* 需要持久化的一个节点
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class PNode<E extends IEntity<?>> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.zfoo.orm.model.entity.IEntity;
|
||||
/**
|
||||
* 对数据库进行(查找)的相关方法
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IQuery {
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.query;
|
||||
import com.zfoo.orm.model.entity.IEntity;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class MongodbQuery implements IQuery {
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class Page {
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class EntityDef {
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.model.vo;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class IndexDef {
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class IndexTextDef {
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.orm.schema;
|
||||
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class NamespaceHandler extends NamespaceHandlerSupport {
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class OrmDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.function.Consumer;
|
||||
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class MongoIdUtils {
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.ArrayList;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
/**
|
||||
* 必须要用复制集群才能使用事务
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import org.junit.Test;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import com.zfoo.orm.model.cache.IEntityCaches;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Component
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.junit.Test;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 1.0
|
||||
* @since 2019-08-13 11:15
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.regex.Pattern;
|
||||
import static com.mongodb.client.model.Filters.eq;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 1.0
|
||||
* @since 2018-07-11 12:20
|
||||
*/
|
||||
@@ -32,7 +32,7 @@ import static com.mongodb.client.model.Filters.eq;
|
||||
public class SingleMongoTest {
|
||||
|
||||
// To connect to mongodb server
|
||||
private MongoClient mongoClient = MongoClients.create(MongoClientSettings.builder()
|
||||
private final MongoClient mongoClient = MongoClients.create(MongoClientSettings.builder()
|
||||
.applyToClusterSettings(builder -> builder.hosts(Arrays.asList(new ServerAddress("localhost", 27017))))
|
||||
// .applyToConnectionPoolSettings(builder -> builder.applySettings(ConnectionPoolSettings.builder().maxSize(300).build()))
|
||||
// .credential(MongoCredential.createCredential("root", "admin", "123456".toCharArray()))
|
||||
@@ -40,7 +40,7 @@ public class SingleMongoTest {
|
||||
|
||||
// If MongoDB in secure mode, authentication is required.
|
||||
// Now connect to your databases
|
||||
private MongoDatabase mongodb = mongoClient.getDatabase("test");
|
||||
private final MongoDatabase mongodb = mongoClient.getDatabase("test");
|
||||
|
||||
@Test
|
||||
public void findTest() {
|
||||
@@ -55,13 +55,13 @@ public class SingleMongoTest {
|
||||
// 查找并且遍历集合student的所有文档
|
||||
MongoCollection<Document> collection = mongodb.getCollection("student");
|
||||
System.out.println("Collection created successfully");
|
||||
collection.find().forEach((Consumer<Document>) document -> System.out.println(document));
|
||||
collection.find().forEach(document -> System.out.println(document));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void findEqTest() {
|
||||
var collection = mongodb.getCollection("student");
|
||||
collection.find(eq("_id", 1)).forEach((Consumer<Document>) document -> System.out.println(document));
|
||||
collection.find(eq("_id", 1)).forEach(document -> System.out.println(document));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -69,7 +69,7 @@ public class SingleMongoTest {
|
||||
var pattern = Pattern.compile("jay");
|
||||
var query = new BasicDBObject("name", pattern);
|
||||
var collection = mongodb.getCollection("student");
|
||||
collection.find(query).forEach((Consumer<Document>) document -> System.out.println(document));
|
||||
collection.find(query).forEach(document -> System.out.println(document));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -94,7 +94,7 @@ public class SingleMongoTest {
|
||||
.append("name", "hello mongodb");
|
||||
collection.insertOne(document);
|
||||
|
||||
collection.find().forEach((Consumer<Document>) doc -> System.out.println(doc.toJson()));
|
||||
collection.find().forEach(doc -> System.out.println(doc.toJson()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -123,7 +123,7 @@ public class SingleMongoTest {
|
||||
// 更新一个文档,updateOne方法第一个参数是查询条件,如果查出多条也只修改第一条;第二个参数是修改条件。
|
||||
collection.updateOne(eq("age", 10), new Document("$set", new Document("name", "new hello mongodb")));
|
||||
|
||||
collection.find().forEach((Consumer<Document>) doc -> System.out.println(doc.toJson()));
|
||||
collection.find().forEach(doc -> System.out.println(doc.toJson()));
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ public class SingleMongoTest {
|
||||
// 更新一个文档
|
||||
collection.updateMany(eq("age", 10), new Document("$set", new Document("name", "new hello mongodb")));
|
||||
|
||||
collection.find().forEach((Consumer<Document>) doc -> System.out.println(doc.toJson()));
|
||||
collection.find().forEach(doc -> System.out.println(doc.toJson()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -145,7 +145,7 @@ public class SingleMongoTest {
|
||||
// 删除一个文档
|
||||
collection.deleteOne(eq("_id", 1));
|
||||
|
||||
collection.find().forEach((Consumer<Document>) doc -> System.out.println(doc.toJson()));
|
||||
collection.find().forEach(doc -> System.out.println(doc.toJson()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -343,7 +343,7 @@ public class SingleMongoTest {
|
||||
public void run() {
|
||||
for (var j = 0; j < count; j++) {
|
||||
try {
|
||||
collection.find(eq("_id", j)).forEach((Consumer<Document>) document -> {
|
||||
collection.find(eq("_id", j)).forEach(document -> {
|
||||
if (document == null) {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.zfoo.orm.client;
|
||||
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 1.0
|
||||
* @since 2019-05-01 23:34
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.orm.model.entity.IEntity;
|
||||
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@EntityCache(cacheStrategy = "thousand", persister = @Persister("time30s"))
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@EntityCache(cacheStrategy = "thousand", persister = @Persister("time30s"))
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.junit.Test;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.zfoo.protocol.IPacket;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class MyPacket implements IPacket {
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class PageTest {
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
/**
|
||||
* MongoDB分布式唯一Id测试
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Ignore
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "zfoo",
|
||||
"version": "0.0.0",
|
||||
"description": "This is a common config for all projects",
|
||||
"author": "jaysunxiao@gmail.com",
|
||||
"author": "godotg@gmail.com",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
},
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<storage:scan package="com.zfoo.**.resource"/>
|
||||
<!-- 如果是类路径一classpath开头,如果是其它目录则以file开头-->
|
||||
<storage:resource location="classpath:/excel"/>
|
||||
<!-- <storage:resource location="file:C:\Users\jaysunxiao\Desktop\excel"/>-->
|
||||
<!-- <storage:resource location="file:C:\Users\godotg\Desktop\excel"/>-->
|
||||
</storage:storage>
|
||||
|
||||
</beans>
|
||||
</beans>
|
||||
@@ -21,7 +21,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class EnumUtils {
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class ThreadUtils {
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
/**
|
||||
* png格式验证码
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ArithmeticCaptcha extends AbstractCaptcha {
|
||||
@@ -133,4 +133,4 @@ public class ArithmeticCaptcha extends AbstractCaptcha {
|
||||
this.arithmeticString = arithmeticString;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ import java.io.OutputStream;
|
||||
/**
|
||||
* Gif验证码类
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class GifCaptcha extends AbstractCaptcha {
|
||||
@@ -37,7 +37,7 @@ public class GifCaptcha extends AbstractCaptcha {
|
||||
try {
|
||||
char[] captchaChars = captcha.toCharArray(); // 获取验证码数组
|
||||
// 随机生成每个文字的颜色
|
||||
Color fontColor[] = new Color[length];
|
||||
Color[] fontColor = new Color[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
fontColor[i] = color();
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.io.OutputStream;
|
||||
/**
|
||||
* png格式验证码
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class PngCaptcha extends AbstractCaptcha {
|
||||
@@ -79,4 +79,4 @@ public class PngCaptcha extends AbstractCaptcha {
|
||||
return toBase64("data:image/png;base64,");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class Encoder {
|
||||
@@ -52,7 +52,7 @@ public class Encoder {
|
||||
// for the decompressor. Late addition: construct the table according to
|
||||
// file size for noticeable speed improvement on small files. Please direct
|
||||
// questions about this implementation to ames!jaw.
|
||||
int masks[] =
|
||||
int[] masks =
|
||||
{
|
||||
0x0000,
|
||||
0x0001,
|
||||
@@ -91,9 +91,10 @@ public class Encoder {
|
||||
// fit in it exactly). Use the VAX insv instruction to insert each
|
||||
// code in turn. When the buffer fills up empty it and start over.
|
||||
// 图片的宽高
|
||||
private int imgW, imgH;
|
||||
private byte[] pixAry;
|
||||
private int initCodeSize; // 验证码位数
|
||||
private final int imgW;
|
||||
private final int imgH;
|
||||
private final byte[] pixAry;
|
||||
private final int initCodeSize; // 验证码位数
|
||||
private int remaining; // 剩余数量
|
||||
private int curPixel; // 像素
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
package com.zfoo.util.captcha.gif;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class Quant {
|
||||
@@ -51,9 +51,9 @@ public class Quant {
|
||||
|
||||
/* defs for freq and bias */
|
||||
protected static final int intbiasshift = 16; /* bias for fractions */
|
||||
protected static final int intbias = (((int) 1) << intbiasshift);
|
||||
protected static final int intbias = (1 << intbiasshift);
|
||||
protected static final int gammashift = 10; /* gamma = 1024 */
|
||||
protected static final int gamma = (((int) 1) << gammashift);
|
||||
protected static final int gamma = (1 << gammashift);
|
||||
protected static final int betashift = 10;
|
||||
protected static final int beta = (intbias >> betashift); /* beta = 1/1024 */
|
||||
protected static final int betagamma =
|
||||
@@ -62,18 +62,18 @@ public class Quant {
|
||||
/* defs for decreasing radius factor */
|
||||
protected static final int initrad = (netsize >> 3); /* for 256 cols, radius starts */
|
||||
protected static final int radiusbiasshift = 6; /* at 32.0 biased by 6 bits */
|
||||
protected static final int radiusbias = (((int) 1) << radiusbiasshift);
|
||||
protected static final int radiusbias = (1 << radiusbiasshift);
|
||||
protected static final int initradius = (initrad * radiusbias); /* and decreases by a */
|
||||
protected static final int radiusdec = 30; /* factor of 1/30 each cycle */
|
||||
|
||||
/* defs for decreasing alpha factor */
|
||||
protected static final int alphabiasshift = 10; /* alpha starts at 1.0 */
|
||||
protected static final int initalpha = (((int) 1) << alphabiasshift);
|
||||
protected static final int initalpha = (1 << alphabiasshift);
|
||||
/* radbias and alpharadbias used for radpower calculation */
|
||||
protected static final int radbiasshift = 8;
|
||||
protected static final int radbias = (((int) 1) << radbiasshift);
|
||||
protected static final int radbias = (1 << radbiasshift);
|
||||
protected static final int alpharadbshift = (alphabiasshift + radbiasshift);
|
||||
protected static final int alpharadbias = (((int) 1) << alpharadbshift);
|
||||
protected static final int alpharadbias = (1 << alpharadbshift);
|
||||
protected int alphadec; /* biased by 10 bits */
|
||||
|
||||
/* Types and Global Variables
|
||||
@@ -433,7 +433,7 @@ public class Quant {
|
||||
int bestpos, bestbiaspos, bestd, bestbiasd;
|
||||
int[] n;
|
||||
|
||||
bestd = ~(((int) 1) << 31);
|
||||
bestd = ~(1 << 31);
|
||||
bestbiasd = bestd;
|
||||
bestpos = -1;
|
||||
bestbiaspos = bestpos;
|
||||
@@ -471,4 +471,4 @@ public class Quant {
|
||||
bias[bestpos] -= betagamma;
|
||||
return (bestbiaspos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ import java.util.Base64;
|
||||
/**
|
||||
* 验证码抽象类
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class AbstractCaptcha {
|
||||
@@ -282,4 +282,4 @@ public abstract class AbstractCaptcha {
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
package com.zfoo.util.captcha.model;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public enum CaptchaCharEnum {
|
||||
@@ -34,6 +34,4 @@ public enum CaptchaCharEnum {
|
||||
*/
|
||||
ARAB_ENGLISH,
|
||||
|
||||
;
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import java.awt.*;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public enum CaptchaFontEnum {
|
||||
@@ -53,7 +53,7 @@ public enum CaptchaFontEnum {
|
||||
|
||||
private static final Font DEFAULT_FONT = new Font("Arial", Font.BOLD, 32);
|
||||
|
||||
private Font font;
|
||||
private final Font font;
|
||||
|
||||
CaptchaFontEnum() {
|
||||
InputStream inputStream = null;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
package com.zfoo.util.math;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class Combinatorics {// |kɒmbinəˋtɒ:riks|n.组合学
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.util.math;
|
||||
/**
|
||||
* 改进的hash算法虽然发布比较均匀,但是没有Java自带的hash算法速度快,所以需要知道自己需要什么
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class HashUtils {
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.Collection;
|
||||
* <p>
|
||||
* 这是因为0.1无法准确的表示为double。因此应该使用new BigDecimal(String)。
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class NumberUtils {
|
||||
|
||||
@@ -20,14 +20,14 @@ import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class RandomSelector<T> {
|
||||
|
||||
private int cursor = 0;
|
||||
|
||||
private TreeMap<Integer, T> elementMap = new TreeMap<>();
|
||||
private final TreeMap<Integer, T> elementMap = new TreeMap<>();
|
||||
|
||||
public void addElement(@Nullable T value, int weight) {
|
||||
if (value == null || weight <= 0) {
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.*;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class RandomUtils {
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.Set;
|
||||
/**
|
||||
* 词法分析器
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class LexicalAnalysis {
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HostAndPort {
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 网络相关工具
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class NetUtils {
|
||||
|
||||
Loaded 100 of 116 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user