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
<!-- 릴리즈시 의존라이브러리 포함 --> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-shade-plugin</artifactId> | |
<version>2.1</version> | |
<executions> | |
<execution> | |
<phase>package</phase> | |
<goals> | |
<goal>shade</goal> |
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 net.heartsavior.spring.jedis; | |
import org.apache.commons.pool.impl.GenericObjectPool.Config; | |
import org.springframework.beans.factory.config.AbstractFactoryBean; | |
import redis.clients.jedis.JedisPool; | |
import redis.clients.jedis.Protocol; | |
public class JedisPoolFactoryBean extends AbstractFactoryBean<JedisPool> { |
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 storm.starter; | |
import backtype.storm.Config; | |
import backtype.storm.LocalCluster; | |
import backtype.storm.spout.SpoutOutputCollector; | |
import backtype.storm.task.OutputCollector; | |
import backtype.storm.task.TopologyContext; | |
import backtype.storm.topology.OutputFieldsDeclarer; | |
import backtype.storm.topology.TopologyBuilder; | |
import backtype.storm.topology.base.BaseRichBolt; |
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
import urllib | |
from time import sleep | |
url_template = "https://m.mypeople.daum.net/img/i1.daumcdn.net/air21.sticker/pc/still_img/sticker_%03d.png" | |
start_range=0 | |
end_range=1500 # 2013/08/14 last id : 1457 | |
sleep_for_crawl_success = 1 | |
sleep_for_crawl_fail = 2 | |
for sticker_id in range(start_range, end_range+1): |
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
var randomized_words = [ 'anguilliform', 'concenter', 'ciao', 'kyloe', 'psychologize', | |
'paddywhack', 'misshaping', 'fleshless', 'invigilated', 'jointless', | |
'circumambulation', 'adown', 'avaunt', 'cachinnate', 'protistan', 'alkanet', | |
'extravagate', 'ochone', 'ta', 'meristematic', 'keck', 'unremunerative', | |
'frapping', 'anent', 'concertize', 'bechance', 'nontaxable', 'bhindi', 'olearia', | |
'transduce', 'humph', 'malamute', 'barhopping', 'triangulate', 'premandibular', | |
'stodge', 'crankle', 'souk', 'cose', 'ligate', 'brava', 'syne', 'chez', 'biomass', | |
'blithesome', 'trinomially', 'appetence', 'kindheartedly', 'venge', 'annulation', | |
'trophallactic', 'semiautomatically', 'particulate', 'valleculate', 'dewan', 'exudation', | |
'lavolta', 'coze', 'goodby', 'vitrified', 'outpace', 'putaminous', 'orthopteran', |
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
Jedis j = new Jedis(HOSTNAME, PORT); | |
j.set("foo", "314"); | |
Pipeline p = j.pipelined(); | |
p.multi(); | |
Response<String> r = p.get("foo"); | |
Response<String> multiResp = p.exec(); | |
p.sync(); | |
multiResp.get(); // to achieve r.get() | |
System.out.println(r.get()); |
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 net.heartsavior.dev; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Random; | |
import java.util.Set; |
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 net.heartsavior.dev; | |
import redis.clients.jedis.Jedis; | |
import redis.clients.jedis.exceptions.JedisConnectionException; | |
public class JedisConnectionSuddenlyBrokenTest { | |
public static void main(String[] args) throws InterruptedException { | |
Jedis jedis = new Jedis("127.0.0.1", 6379); | |
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
public class ListCommandsTest extends JedisCommandTestBase { | |
public void blpopWithForceKill() throws InterruptedException { | |
Thread th = new Thread(new Runnable() { | |
@Override | |
public void run() { | |
jedis.blpop(100, "foo"); | |
} | |
}); | |
th.start(); |
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
import org.apache.commons.pool2.impl.GenericObjectPoolConfig; | |
import redis.clients.jedis.JedisShardInfo; | |
import redis.clients.jedis.ShardedJedis; | |
import redis.clients.jedis.ShardedJedisPool; | |
import redis.clients.jedis.exceptions.JedisConnectionException; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.util.ArrayList; | |
import java.util.List; |