Created
November 27, 2012 08:36
-
-
Save sqs/4153149 to your computer and use it in GitHub Desktop.
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 collection.JavaConversions._ | |
import java.net.URI | |
import java.net.ConnectException | |
import java.util.concurrent.TimeUnit | |
import com.couchbase.client.protocol.views.ViewRow | |
import com.couchbase.client.CouchbaseClient | |
import com.couchbase.client.protocol.views.Query | |
import java.util.concurrent.TimeUnit | |
import com.couchbase.client.protocol.views.ComplexKey | |
import com.couchbase.client.protocol.views.Stale | |
object Main extends App { | |
val uris = List(URI.create("http://case.local.compose.cc:8091/pools")) | |
val client = new CouchbaseClient(uris, "comments", "baileydog") | |
val view = client.asyncGetView("all", "author").get(6000, TimeUnit.MILLISECONDS) | |
val query = new Query() | |
query.setLimit(5) | |
query.setStale(Stale.FALSE) | |
val res = client.query(view, query).toList | |
println("Res = " + res) | |
client.shutdown() | |
System.exit(0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment