@ThriftService(value = "presto", idlName = "PrestoThriftService") public interface PrestoThriftService
private static String getServiceName(Class<?> serverInterface) { requireNonNull(serverInterface, "serverInterface is null"); String serviceName = getThriftServiceAnnotation(serverInterface).value(); if (!serviceName.isEmpty()) { return serviceName; } return serverInterface.getSimpleName(); }
public ThriftServiceMetadata(Class<?> serviceClass, ThriftCatalog catalog) { requireNonNull(serviceClass, "serviceClass is null"); ThriftService thriftService = getThriftServiceAnnotation(serviceClass); if (thriftService.value().isEmpty()) { name = serviceClass.getSimpleName(); } else { name = thriftService.value(); } if (thriftService.idlName().isEmpty()) { idlName = name; } else { idlName = thriftService.idlName(); } // A multimap from order to method name. Sorted by key (order), with nulls (i.e. no order) last. // Within each key, values (ThriftMethodMetadata) are sorted by method name. TreeMultimap<Integer, ThriftMethodMetadata> builder = TreeMultimap.create( Ordering.natural().nullsLast(), Ordering.natural().onResultOf(ThriftMethodMetadata::getName)); for (Method method : findAnnotatedMethods(serviceClass, ThriftMethod.class)) { if (method.isAnnotationPresent(ThriftMethod.class)) { builder.put(getMethodOrder(method), new ThriftMethodMetadata(method, catalog)); } } methods = builder.values().stream() .collect(toImmutableMap(ThriftMethodMetadata::getName, identity())); documentation = getThriftDocumentation(serviceClass); }
private static String getServiceName(Class<?> clientInterface) { requireNonNull(clientInterface, "clientInterface is null"); String serviceName = getThriftServiceAnnotation(clientInterface).value(); if (!serviceName.isEmpty()) { return serviceName; } return clientInterface.getSimpleName(); }
@ThriftService("testService") public interface Client { @ThriftMethod String test(); } }
private static String getServiceName(Class<?> serverInterface) { requireNonNull(serverInterface, "serverInterface is null"); String serviceName = getThriftServiceAnnotation(serverInterface).value(); if (!serviceName.isEmpty()) { return serviceName; } return serverInterface.getSimpleName(); }
@ThriftService("mismatch") public interface MismatchService { @ThriftMethod int extraClientArgs(int value, int extra); @ThriftMethod int extraServerArgs(); }
private static String getServiceName(Class<?> clientInterface) { requireNonNull(clientInterface, "clientInterface is null"); String serviceName = getThriftServiceAnnotation(clientInterface).value(); if (!serviceName.isEmpty()) { return serviceName; } return clientInterface.getSimpleName(); }
@ThriftService(value = "presto", idlName = "PrestoThriftService") public interface PrestoThriftService
@ThriftService(value = "renamed", idlName = "RenamedService") public interface RenamedService { @ThriftMethod void ping(); }
@ThriftService("scribe") public interface DriftScribe { @ThriftMethod("Log") DriftResultCode log(@ThriftHeader("header") String headerValue, List<DriftLogEntry> messages) throws TException; }
@ThriftService(value = "renamed", idlName = "RenamedService") public interface RenamedService { @ThriftMethod void ping(); }
@ThriftService public interface DriftAsyncScribe extends AutoCloseable { @ThriftMethod("Log") ListenableFuture<DriftResultCode> log(@ThriftHeader("header") String headerValue, List<DriftLogEntry> logEntries) throws TException; }
@ThriftService("clientService") public interface Client { @ThriftMethod String test(int id, String name) throws ClientException, TException; @ThriftMethod void testNoTException(int id, String name) throws ClientException; @ThriftMethod String testHeader(@ThriftHeader("headerA") String firstHeader, int id, @ThriftHeader("headerB") String secondHeader, String name) throws ClientException; @ThriftMethod(exception = @ThriftException(id = 0, type = ClientException.class)) ListenableFuture<String> testAsync(int id, String name); }
@ThriftService("throwing") public interface ThrowingService { DataSize MAX_FRAME_SIZE = new DataSize(10, KILOBYTE); @ThriftMethod void fail(String message, boolean retryable) throws ExampleException; @ThriftMethod byte[] generateTooLargeFrame() throws TException; @ThriftMethod String acceptBytes(byte[] bytes) throws TException; @ThriftMethod ListenableFuture<String> await(); @ThriftMethod String release(); }
@ThriftService("serverService") public static class TestService implements TestingInvocationTarget
@ThriftService("serverService") public static class TestService implements TestingInvocationTarget
@ThriftService("mismatch") public class MismatchServiceHandler
@ThriftService("echo") public interface EchoService
@ThriftDocumentation("Scribe logging service") @ThriftService("Scribe") public interface DriftScribe