/** * Returns available schema names. */ @ThriftMethod("prestoListSchemaNames") List<String> listSchemaNames() throws PrestoThriftServiceException, TException;
if (thriftMethod.value().isEmpty()) { name = method.getName(); name = thriftMethod.value(); this.oneway = thriftMethod.oneway(); this.idempotent = thriftMethod.idempotent();
private ImmutableMap<Short, ThriftType> buildExceptionMap(ThriftCatalog catalog, ThriftMethod thriftMethod) boolean mixedStyle = (thriftMethod.exception().length > 0) && stream(method.getAnnotatedExceptionTypes()).anyMatch(type -> type.isAnnotationPresent(ThriftId.class)); checkArgument(!mixedStyle, "ThriftMethod [%s] uses a mix of @ThriftException and @ThriftId", methodName(method)); Set<Type> exceptionTypes = new HashSet<>(); for (ThriftException thriftException : thriftMethod.exception()) { 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());
/** * Returns metadata for a given table. * * @param schemaTableName schema and table name * @return metadata for a given table, or a {@literal null} value inside if it does not exist */ @ThriftMethod("prestoGetTableMetadata") PrestoThriftNullableTableMetadata getTableMetadata( @ThriftField(name = "schemaTableName") PrestoThriftSchemaTableName schemaTableName) throws PrestoThriftServiceException, TException;
/** * Returns tables for the given schema name. * * @param schemaNameOrNull a structure containing schema name or {@literal null} * @return a list of table names with corresponding schemas. If schema name is null then returns * a list of tables for all schemas. Returns an empty list if a schema does not exist */ @ThriftMethod("prestoListTables") List<PrestoThriftSchemaTableName> listTables( @ThriftField(name = "schemaNameOrNull") PrestoThriftNullableSchemaName schemaNameOrNull) throws PrestoThriftServiceException, TException;
/** * 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); }
/** * 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);
/** * Returns available schema names. */ @ThriftMethod("prestoListSchemaNames") List<String> listSchemaNames() throws PrestoThriftServiceException, TException;
/** * Returns metadata for a given table. * * @param schemaTableName schema and table name * @return metadata for a given table, or a {@literal null} value inside if it does not exist */ @ThriftMethod("prestoGetTableMetadata") PrestoThriftNullableTableMetadata getTableMetadata( @ThriftField(name = "schemaTableName") PrestoThriftSchemaTableName schemaTableName) throws PrestoThriftServiceException, TException;
@ThriftMethod public int extraClientArgs(int value) { return value; }
/** * Returns tables for the given schema name. * * @param schemaNameOrNull a structure containing schema name or {@literal null} * @return a list of table names with corresponding schemas. If schema name is null then returns * a list of tables for all schemas. Returns an empty list if a schema does not exist */ @ThriftMethod("prestoListTables") List<PrestoThriftSchemaTableName> listTables( @ThriftField(name = "schemaNameOrNull") PrestoThriftNullableSchemaName schemaNameOrNull) throws PrestoThriftServiceException, TException;
@ThriftMethod void inferredException() throws ExceptionA;
@ThriftMethod List<Integer> echoListInteger(List<Integer> value) throws NullValueException;
@ThriftMethod void ping(); }
@ThriftMethod void inferredException() throws ExceptionA;
@ThriftMethod String release(); }
@ThriftMethod void nonThriftException() throws IllegalArgumentException;
@ThriftMethod void ping(); }
@ThriftMethod double echoOptionalDouble(OptionalDouble value) throws EmptyOptionalException;