@SuppressWarnings("InterfaceNeverImplemented") @com.facebook.swift.service.ThriftService public interface CheckpointManager extends AutoCloseable { @ThriftMethod public String getCheckpoint(String application, String environment, int shard); @ThriftMethod public void deleteCheckpoint(String application, String environment, int shard); @Override void close(); }
@ThriftService("RocksServiceCommon") public interface Async extends Closeable { void close(); } void close();
@ThriftService("RocksServiceCommon") public interface RocksServiceCommon extends Closeable { @ThriftService("RocksServiceCommon") public interface Async extends Closeable { void close(); } void close(); }
@ThriftService public interface GenericInterface { @ThriftMethod GenericStruct<String> echo(GenericStruct<String> gen); public static interface Client extends GenericInterface, AutoCloseable { @Override public void close(); } }
@ThriftService("DerivedServiceTwo") public interface DerivedServiceTwo extends BaseService { @ThriftMethod public void fooTwo(); }
@ThriftService public interface AsyncScribe extends AutoCloseable { @ThriftMethod(value = "Log") public ListenableFuture<ResultCode> log(List<LogEntry> logEntries) throws TException; }
@ThriftService("scribe") public interface Scribe extends Closeable { @ThriftMethod("Log") ResultCode log(List<LogEntry> messages) throws TException; @Override void close(); }
@ThriftService public static final class ConflictingMethodsServiceOne { @ThriftMethod public void doSomething() {} }
@ThriftService public class ScribeHandler { @ThriftMethod("Log") public ResultCode log(List<LogEntry> messages) { return ResultCode.OK; } }
/** * A broken thrift service interface class, where one of the thrift methods has a parameter of a * type that is not valid to pass via thrift */ @ThriftService public interface MalformedService { @ThriftMethod void foo(MalformedService bar); }
@ThriftService("DerivedServiceOne") public interface DerivedServiceOne extends BaseService { @ThriftMethod public void fooOne(); }
@ThriftService public interface OneWayService { @ThriftMethod public void verifyConnectionState() throws TException; @ThriftMethod(oneway = true) public void onewayMethod() throws TException; @ThriftMethod(oneway = true) public void onewayThrow() throws TException, OneWayException; }
@ThriftService("DelayedMap") public static interface Service { @ThriftMethod public String getValueSlowly(long timeout, TimeUnit unit, String key) throws TException; @ThriftMethod public void putValueSlowly(long timeout, TimeUnit unit, String key, String value) throws TException; @ThriftMethod public List<String> getMultipleValues(long timeout, TimeUnit unit, List<String> keys) throws TException; @ThriftMethod(oneway = true) public void onewayPutValueSlowly(long timeout, TimeUnit unit, String key, String value); }
@ThriftService("DelayedMap") public static interface AsyncService { @ThriftMethod public ListenableFuture<String> getValueSlowly(long timeout, TimeUnit unit, String key); @ThriftMethod public ListenableFuture<Void> putValueSlowly(long timeout, TimeUnit unit, String key, String value); @ThriftMethod public ListenableFuture<List<String>> getMultipleValues(long timeout, TimeUnit unit, List<String> keys); @ThriftMethod(oneway = true) public ListenableFuture<Void> onewayPutValueSlowly(long timeout, TimeUnit unit, String key, String value); }
@ThriftService public class SimpleService { @ThriftMethod public void sleep(int seconds) { Uninterruptibles.sleepUninterruptibly(seconds, TimeUnit.SECONDS); } }
@ThriftService public class ConflictingLogService { @ThriftMethod public void Log(List<String> messages) throws TException { } }
@ThriftService("CombinedService") public interface CombinedService extends DerivedServiceOne, DerivedServiceTwo { @ThriftMethod public void fooCombined(); }
@ThriftService private static class ExampleService { // Intentionally empty: this is just a placeholder } }
@ThriftService("BaseService") public interface BaseService { @ThriftMethod public void fooBase(); }
@ThriftService public static final class ConflictingMethodsServiceTwo { @ThriftMethod public void doSomething() {} } }