Created
March 19, 2013 06:41
-
-
Save xiaodongw/5194148 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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