Skip to content

Instantly share code, notes, and snippets.

@daschl
daschl / gist:8020877
Last active December 31, 2015 17:29
wrk load test exception
2013-12-18 12:30:40.697 ERROR 26191 --- [nio-8080-exec-5] .m.m.a.ExceptionHandlerExceptionResolver : Failed to invoke @ExceptionHandler method: public org.springframework.http.ResponseEntity<org.springframework.data.rest.webmvc.support.ExceptionMessage> org.springframework.data.rest.webmvc.AbstractRepositoryRestController.handleNotReadable(org.springframework.http.converter.HttpMessageNotReadableException)
java.lang.IllegalStateException: No suitable resolver for argument [0] [type=org.springframework.http.converter.HttpMessageNotReadableException]
HandlerMethod details:
Controller [org.springframework.data.rest.webmvc.RepositoryEntityController]
Method [public org.springframework.http.ResponseEntity<org.springframework.data.rest.webmvc.support.ExceptionMessage> org.springframework.data.rest.webmvc.AbstractRepositoryRestController.handleNotReadable(org.springframework.http.converter.HttpMessageNotReadableException)]
at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(I
package com.couchbase.bootcache;
import com.couchbase.client.CouchbaseClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration;
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
compile group: 'net.spy', name:'spymemcached', version: '2.10.3'
}
apply plugin: 'checkstyle'
checkstyleMain {
ignoreFailures = false
reports {
include ( '**/*.java')
xml {
destination "${rootProject.buildDir}/reports/checkstyle/main.xml"
}
}
/**
* Copyright (C) 2009-2013 Couchbase, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@daschl
daschl / Benchmark.java
Created December 23, 2013 08:01
is there a easier way?
package io.netty.jmh.buffer;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.buffer.UnpooledByteBufAllocator;
import io.netty.jmh.util.AbstractMicrobenchmark;
import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
import org.openjdk.jmh.annotations.State;
use std::io::net::tcp::TcpListener;
use std::io::{Listener, Acceptor};
use std::io::net::ip::{SocketAddr, Ipv4Addr};
fn main() {
let listen_socket = SocketAddr {
ip: Ipv4Addr(127, 0, 0, 1),
port: 9999
};
@daschl
daschl / Main.java
Created January 24, 2014 16:14
Incr with default ;)
import com.couchbase.client.CouchbaseClient;
import com.couchbase.client.internal.HttpCompletionListener;
import com.couchbase.client.internal.HttpFuture;
import com.couchbase.client.internal.ViewFuture;
import com.couchbase.client.protocol.views.*;
import net.spy.memcached.internal.OperationFuture;
import net.spy.memcached.ops.Mutator;
import net.spy.memcached.ops.Operation;
import net.spy.memcached.ops.OperationCallback;
import net.spy.memcached.ops.OperationStatus;
@daschl
daschl / gist:8934453
Last active August 29, 2015 13:56
any idea how I can make this nicer?
public Promise<String> load() {
final Deferred<String,Promise<String>> deferred = Promises.defer(env.reactorEnv());
addNode().consume(new Consumer<Boolean>() {
@Override
public void accept(Boolean success) {
if(success) {
addService().consume(new Consumer<Boolean>() {
@Override
public void accept(Boolean success) {
@daschl
daschl / gist:8934949
Created February 11, 2014 13:38
Much nicer
addNode().mapMany(new Function<Boolean, Composable<Boolean>>() {
@Override
public Composable<Boolean> apply(Boolean success) {
return addService();
}
}).mapMany(new Function<Boolean, Composable<String>>() {
@Override
public Composable<String> apply(Boolean success) {
return loadRawConfig();
}