This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Selector selector = Selector.open(); | |
channel.configureBlocking(false); | |
SelectionKey key = channel.register(selector, SelectionKey.OP_READ); | |
while(true) { | |
int readyChannels = selector.select(); | |
if(readyChannels == 0) continue; | |
Set selectedKeys = selector.selectedKeys(); | |
Iterator keyIterator = selectedKeys.iterator(); | |
while(keyIterator.hasNext()) { | |
SelectionKey key = keyIterator.next(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jd.promotion.common; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import redis.clients.jedis.*; | |
import redis.clients.jedis.exceptions.JedisConnectionException; | |
import redis.clients.jedis.exceptions.JedisException; | |
import java.util.List; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr> | |
<th> | |
<span class="requiredField">*</span>开始时间: | |
</th> | |
<td> | |
<input type="text" id="startTime" name="startTime" class="laydate-icon" | |
value="$!dateTool.format("yyyy-MM-dd HH:mm:ss",$!act.startTime)" | |
/> | |
</td> | |
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.iuni.order.common.mapper; | |
import org.nustaq.serialization.FSTObjectInput; | |
import org.nustaq.serialization.FSTObjectOutput; | |
import java.io.*; | |
// 3.0可用下边这个简单的接口了,FST并不支持添加删除字段! | |
// FSTCoder fst = new DefaultCoder(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
log_dir="/data/metricslog" | |
date_dir=`date +%Y-%m-%d --date='yesterday'` | |
cd $log_dir | |
while read line | |
do | |
mv ./nginx/$line/metrics.access.log ./nginx/$line/metrics.access.log-$date_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.各个节点安装必需的包 | |
yum install -y openssh openssh-clients vim libxslt libaio | |
2.配置ssh无密码认证(个人认为可以忽略的步骤) | |
(1)修改hosts.allow 将新的IP都加进去 | |
(2)修改ssh的配置文件 允许root登录 ,再重启ssh服务 | |
(3)在一台机器上ssh所有机器,获取所有的机器的公钥,再生成自己的ssh-key,无密码登录自己,把.ssh目录打包,传到每个机器上 | |
3.修改hosts文件 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..7};do | |
cd server$i | |
./stop.sh && ./start.sh | |
cd ../ | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd=`date -d yesterday "+%Y%m%d"` | |
sql="select count(1) c, status from t_customgift_${dd} where if_outapppush=1 group by status;" | |
mysql -h10.10.130.109 -ugrowth_log -pgrowth_uxin_com -Dgrowth -P3307 -e "${sql}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String apns(long uid, int type, String alert, long sn) { | |
String playload = APNS.newPayload().alertBody(alert).customField("type", type).build(); | |
int length = 13 + 9 + playload.getBytes(CharsetUtil.UTF_8).length; | |
ByteBuf bf = Unpooled.buffer(length); | |
bf.writeInt(length) | |
.writeByte(1) | |
.writeLong(sn) | |
.writeLong(uid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jd.market.easypayservice.common.util.mapper; | |
import com.esotericsoftware.kryo.Kryo; | |
import com.esotericsoftware.kryo.io.Input; | |
import com.esotericsoftware.kryo.io.Output; | |
import org.objenesis.strategy.StdInstantiatorStrategy; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; |
OlderNewer