Skip to content

Instantly share code, notes, and snippets.

@xiaodongw
Created March 19, 2013 06:41
Show Gist options
  • Select an option

  • Save xiaodongw/5194148 to your computer and use it in GitHub Desktop.

Select an option

Save xiaodongw/5194148 to your computer and use it in GitHub Desktop.
package com.test.thrift;
import java.util.HashMap;
import java.util.Map;
import org.apache.thrift.TException;
public class MyServiceImpl implements MyService.Iface {
@Override
public void ping() throws TException {
System.out.println("Ping at " + Thread.currentThread().getId());
}
@Override
public boolean postTweet(MyStruct s) throws TException {
System.out.println("Post tweet at " + Thread.currentThread().getId());
return true;
}
@Override
public MyStruct search(String query) throws TException {
System.out.println("search at " + Thread.currentThread().getId());
Map<String,Long> values = new HashMap<String, Long>();
values.put("1", 1L);
MyStruct s = new MyStruct(5, "alfred", values);
return s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment