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
curl -X PUT -H "content-type: text/plain" -H "Link:</riak/hb/second>; riaktag=\"foo\", </riak/hb/third>; riaktag=\"bar\"" http://localhost:8098/riak/hb/first --data "hello" | |
curl -X PUT -H "content-type: text/plain" -H "Link:</riak/hb/fourth>; riaktag=\"foo\"" http://localhost:8098/riak/hb/second --data "the second" | |
curl -X PUT -H "content-type: text/plain" -H "Link:</riak/hb/fourth>; riaktag=\"foo\"" http://localhost:8098/riak/hb/third --data "the third" | |
curl -X PUT -H "content-type: text/plain" http://localhost:8098/riak/hb/fourth --data "the fourth" | |
curl http://localhost:8098/riak/hb/first/_,_,_ | |
--8HqEju2sgApIRPbKHHeXAQoG7gB | |
Content-Type: multipart/mixed; boundary=UizUa6dptfMwKJ1RnAIPHy9Hio5 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
* Copyright 2009 Red Hat, Inc. | |
* | |
* Red Hat licenses this file to you under the Apache License, version 2.0 | |
* (the "License"); you may not use this file except in compliance with the | |
* License. You may obtain a copy of the License at: | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
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
flatten : true | |
destination : ./lib | |
# https://github.com/twitter/commons/blob/master/build-support/commons/ivy/ivysettings.xml | |
repositories : | |
- http://mirrors.ibiblio.org/pub/mirrors/maven2/ | |
- https://repository.apache.org/content/groups/public/ | |
- https://oss.sonatype.org/content/repositories/google-releases/ | |
- http://repository.jboss.org/nexus/content/groups/public/ | |
- http://download.java.net/maven/2/ |
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
公開されているライブラリを単に使いたいだけなら、 | |
<repositories> | |
<repository> | |
<id>maven.twttr.com</id> | |
<name>Twitter Maven2 Repository</name> | |
<url>http://maven.twttr.com/</url> | |
</repository> | |
</repositories> |
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 riak; | |
import static org.jboss.netty.channel.Channels.pipeline; | |
import org.jboss.netty.channel.ChannelPipeline; | |
import org.jboss.netty.channel.ChannelPipelineFactory; | |
import org.jboss.netty.handler.codec.http.HttpClientCodec; | |
import org.jboss.netty.handler.codec.http.HttpContentDecompressor; | |
public class HttpClientPipelineFactory implements ChannelPipelineFactory { |
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
static final int MAX_SHUTDOWN_WAIT = 500; | |
void shutdown(ExecutorService pool) { | |
pool.shutdown(); | |
try { | |
for (int wait = 100; (wait < MAX_SHUTDOWN_WAIT) | |
&& ((pool.isShutdown() == false) || (pool.isTerminated() == false)); wait *= 2) { | |
if (pool.awaitTermination(wait, TimeUnit.SECONDS)) { | |
break; | |
} else { |
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 java.util.concurrent.TimeUnit; | |
public class Seconds { | |
public static void main(String[] args) { | |
long milis = TimeUnit.SECONDS.toMillis(1303372302L); | |
long micro = TimeUnit.MICROSECONDS.toMillis(69170L); | |
System.out.println(micro); | |
System.out.println(milis); |
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 org.handwerkszeug.riak.example.servlet; | |
import java.io.IOException; | |
import java.net.InetSocketAddress; | |
import javax.servlet.ServletException; | |
import javax.servlet.ServletOutputStream; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
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 t2.riak.pages; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.eclipse.jetty.continuation.Continuation; | |
import org.eclipse.jetty.continuation.ContinuationSupport; | |
import org.handwerkszeug.riak.RiakAction; | |
import org.handwerkszeug.riak.model.RiakContentsResponse; | |
import org.handwerkszeug.riak.model.RiakResponse; |
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 java.util.Collection; | |
import java.util.Set; | |
import java.util.concurrent.ConcurrentHashMap; | |
/** | |
* @author taichi | |
* @param <K> | |
* @param <V> | |
*/ | |
public class ConcurrentMultiMap<K, V, C extends Collection<V>> { |