|
|
@ -17,10 +17,15 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
|
|
|
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
|
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.concurrent.LinkedTransferQueue;
|
|
|
|
|
|
|
|
import java.util.concurrent.SynchronousQueue;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Config service impl.
|
|
|
|
* Config service impl.
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -100,6 +105,7 @@ public class ConfigServiceImpl implements ConfigService {
|
|
|
|
.eq(ConfigAllInfo::getTenantId, config.getTenantId());
|
|
|
|
.eq(ConfigAllInfo::getTenantId, config.getTenantId());
|
|
|
|
|
|
|
|
|
|
|
|
config.setGmtCreate(null);
|
|
|
|
config.setGmtCreate(null);
|
|
|
|
|
|
|
|
config.setCapacity(getQueueCapacityByType(config));
|
|
|
|
config.setContent(ContentUtil.getPoolContent(config));
|
|
|
|
config.setContent(ContentUtil.getPoolContent(config));
|
|
|
|
config.setMd5(Md5Util.getTpContentMd5(config));
|
|
|
|
config.setMd5(Md5Util.getTpContentMd5(config));
|
|
|
|
|
|
|
|
|
|
|
@ -111,4 +117,17 @@ public class ConfigServiceImpl implements ConfigService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据队列类型获取队列大小.
|
|
|
|
|
|
|
|
* <p>
|
|
|
|
|
|
|
|
* 不支持设置队列大小 {@link SynchronousQueue} {@link LinkedTransferQueue}
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param config
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private Integer getQueueCapacityByType(ConfigAllInfo config) {
|
|
|
|
|
|
|
|
List<Integer> noCapacityBlockingQueues = Lists.newArrayList(4, 5);
|
|
|
|
|
|
|
|
return noCapacityBlockingQueues.contains(config.getQueueType()) ? 0 : config.getCapacity();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|