/** * Returns a batch of rows for the given split. * * @param splitId split id as returned in split batch * @param columns a list of column names to return * @param maxBytes maximum size of returned data in bytes * @param nextToken token from a previous batch or {@literal null} if it is the first call * @return a batch of table data */ @ThriftMethod(value = "prestoGetRows", exception = @ThriftException(type = PrestoThriftServiceException.class, id = 1)) ListenableFuture<PrestoThriftPageResult> getRows( @ThriftField(name = "splitId") PrestoThriftId splitId, @ThriftField(name = "columns") List<String> columns, @ThriftField(name = "maxBytes") long maxBytes, @ThriftField(name = "nextToken") PrestoThriftNullableToken nextToken); }
checkArgument(!exceptions.containsKey(thriftException.id()), "ThriftMethod [%s] exception list contains multiple values for field ID [%s]", methodName(method), thriftException.id()); checkArgument(!exceptionTypes.contains(thriftException.type()), "ThriftMethod [%s] exception list contains multiple values for type [%s]", methodName(method), thriftException.type().getSimpleName()); exceptions.put(thriftException.id(), catalog.getThriftType(thriftException.type())); exceptionTypes.add(thriftException.type());
/** * Returns a batch of splits. * * @param schemaTableName schema and table name * @param desiredColumns a superset of columns to return; empty set means "no columns", {@literal null} set means "all columns" * @param outputConstraint constraint on the returned data * @param maxSplitCount maximum number of splits to return * @param nextToken token from a previous split batch or {@literal null} if it is the first call * @return a batch of splits */ @ThriftMethod(value = "prestoGetSplits", exception = @ThriftException(type = PrestoThriftServiceException.class, id = 1)) ListenableFuture<PrestoThriftSplitBatch> getSplits( @ThriftField(name = "schemaTableName") PrestoThriftSchemaTableName schemaTableName, @ThriftField(name = "desiredColumns") PrestoThriftNullableColumnSet desiredColumns, @ThriftField(name = "outputConstraint") PrestoThriftTupleDomain outputConstraint, @ThriftField(name = "maxSplitCount") int maxSplitCount, @ThriftField(name = "nextToken") PrestoThriftNullableToken nextToken);
/** * Returns a batch of index splits for the given batch of keys. * This method is called if index join strategy is chosen for a query. * * @param schemaTableName schema and table name * @param indexColumnNames specifies columns and their order for keys * @param outputColumnNames a list of column names to return * @param keys keys for which records need to be returned; includes only unique and non-null values * @param outputConstraint constraint on the returned data * @param maxSplitCount maximum number of splits to return * @param nextToken token from a previous split batch or {@literal null} if it is the first call * @return a batch of splits */ @ThriftMethod(value = "prestoGetIndexSplits", exception = @ThriftException(type = PrestoThriftServiceException.class, id = 1)) ListenableFuture<PrestoThriftSplitBatch> getIndexSplits( @ThriftField(name = "schemaTableName") PrestoThriftSchemaTableName schemaTableName, @ThriftField(name = "indexColumnNames") List<String> indexColumnNames, @ThriftField(name = "outputColumnNames") List<String> outputColumnNames, @ThriftField(name = "keys") PrestoThriftPageResult keys, @ThriftField(name = "outputConstraint") PrestoThriftTupleDomain outputConstraint, @ThriftField(name = "maxSplitCount") int maxSplitCount, @ThriftField(name = "nextToken") PrestoThriftNullableToken nextToken);
@ThriftMethod(exception = { @ThriftException(id = 3, type = ExceptionA.class), @ThriftException(id = 3, type = ExceptionB.class), }) void testDuplicateExceptionFieldMethod() throws ExceptionA, ExceptionB;
@ThriftMethod(exception = { @ThriftException(id = 1, type = ExceptionA.class), @ThriftException(id = 2, type = ExceptionA.class), }) void testDuplicateExceptionType() throws ExceptionA;
@ThriftMethod(exception = { @ThriftException(id = 3, type = ExceptionA.class), @ThriftException(id = 3, type = ExceptionB.class), }) void testDuplicateExceptionFieldMethod() throws ExceptionA, ExceptionB;
@ThriftMethod(exception = { @ThriftException(id = 1, type = ExceptionA.class), @ThriftException(id = 2, type = ExceptionA.class), }) void testDuplicateExceptionType() throws ExceptionA;
@ThriftMethod(exception = {@ThriftException(id = 1, type = ExceptionA.class), @ThriftException(id = 2, type = ExceptionB.class)}) void annotatedExceptionsMethod() throws ExceptionA, ExceptionB;
@ThriftMethod(exception = {@ThriftException(id = 1, type = ExceptionA.class), @ThriftException(id = 2, type = ExceptionB.class)}) void annotatedExceptionsMethod() throws ExceptionA, ExceptionB;
@ThriftMethod(exception = @ThriftException(id = 1, type = ExceptionB.class)) void invalidInferredExceptionSecond() throws ExceptionA, ExceptionB;
@ThriftMethod(exception = @ThriftException(id = 0, type = TestServiceException.class)) public ListenableFuture<String> testAsync(int id, String name) { this.methodName = "testAsync"; this.id = id; this.name = name; return Futures.transform(resultsSupplier.get(), String::valueOf, directExecutor()); }
@ThriftMethod(exception = @ThriftException(id = 0, type = TestServiceException.class)) public ListenableFuture<String> testAsync(int id, String name) { this.methodName = "testAsync"; this.id = id; this.name = name; return Futures.transform(resultsSupplier.get(), String::valueOf, directExecutor()); }
@ThriftMethod(exception = @ThriftException(id = 1, type = ExceptionA.class)) void invalidInferredExceptionFirst() throws ExceptionA, ExceptionB;
@ThriftMethod(exception = @ThriftException(id = 1, type = ExceptionB.class)) void invalidInferredExceptionSecond() throws ExceptionA, ExceptionB;
@ThriftMethod(exception = @ThriftException(id = 0, type = ClientException.class)) ListenableFuture<String> testAsync(int id, String name); }
@ThriftMethod(exception = @ThriftException(id = 1, type = ExceptionA.class)) void invalidInferredExceptionFirst() throws ExceptionA, ExceptionB;
@ThriftMethod(exception = @ThriftException(id = 5, type = ExceptionA.class)) void testExceptionMixedAnnotationStyle() throws ExceptionA, @ThriftId(6) ExceptionB; }
@ThriftMethod(exception = @ThriftException(id = 5, type = ExceptionA.class)) void testExceptionMixedAnnotationStyle() throws ExceptionA, @ThriftId(6) ExceptionB; }
/** * Returns a batch of rows for the given split. * * @param splitId split id as returned in split batch * @param columns a list of column names to return * @param maxBytes maximum size of returned data in bytes * @param nextToken token from a previous batch or {@literal null} if it is the first call * @return a batch of table data */ @ThriftMethod(value = "prestoGetRows", exception = @ThriftException(type = PrestoThriftServiceException.class, id = 1)) ListenableFuture<PrestoThriftPageResult> getRows( @ThriftField(name = "splitId") PrestoThriftId splitId, @ThriftField(name = "columns") List<String> columns, @ThriftField(name = "maxBytes") long maxBytes, @ThriftField(name = "nextToken") PrestoThriftNullableToken nextToken); }