Skip to content

Commit

Permalink
Remove obsolete function definitions and macros
Browse files Browse the repository at this point in the history
During refactoring continuous aggregates some function defintions
for functions that got removed were not removed from the header
file. Additionally a few other header files had function definitions
that no longer had an implementation or macros that were not used.
  • Loading branch information
svenklemm committed Sep 21, 2020
1 parent c85a0c4 commit e1a00eb
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 48 deletions.
4 changes: 0 additions & 4 deletions src/catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ typedef struct FormData_hypertable

typedef FormData_hypertable *Form_hypertable;

/* replication_factor can be NULL, thus it should not be used through the struct from the tuple */
#define HYPERTABLE_TUPLE_SIZE(isnull) \
(offsetof(FormData_hypertable, replication_factor) + (isnull ? 0 : sizeof(int16)))

/* Hypertable primary index attribute numbers */
enum Anum_hypertable_pkey_idx
{
Expand Down
6 changes: 0 additions & 6 deletions src/chunk_data_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,5 @@ extern int ts_chunk_data_node_delete_by_node_name(const char *node_name);
extern TSDLLEXPORT List *
ts_chunk_data_node_scan_by_node_name_and_hypertable_id(const char *node_name, int32 hypertable_id,
MemoryContext mctx);
extern TSDLLEXPORT bool ts_chunk_data_node_contains_non_replicated_chunks(List *chunk_data_nodes);

extern TSDLLEXPORT void ts_chunk_data_node_update_foreign_table_server(Oid relid,
Oid new_server_id);
extern TSDLLEXPORT void
ts_chunk_data_node_update_foreign_table_server_if_needed(int32 chunk_id, Oid existing_server_id);

#endif /* TIMESCALEDB_CHUNK_DATA_NODE_H */
13 changes: 2 additions & 11 deletions src/chunk_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,6 @@ ts_chunk_index_create_from_adjusted_index_info(int32 hypertable_id, Relation hyp
get_rel_name(RelationGetRelid(hypertable_idxrel)));
}

static inline Oid
chunk_index_get_schemaid(Form_chunk_index chunk_index, bool missing_ok)
{
return ts_chunk_get_schema_id(chunk_index->chunk_id, missing_ok);
}

#define chunk_index_tuple_get_schema(tuple) \
chunk_index_get_schema((FormData_chunk_index *) GETSTRUCT(tuple));

/*
* Create all indexes on a chunk, given the indexes that exists on the chunk's
* hypertable.
Expand Down Expand Up @@ -626,7 +617,7 @@ chunk_index_tuple_delete(TupleInfo *ti, void *data)
bool should_free;
HeapTuple tuple = ts_scanner_fetch_heap_tuple(ti, false, &should_free);
FormData_chunk_index *chunk_index = (FormData_chunk_index *) GETSTRUCT(tuple);
Oid schemaid = chunk_index_get_schemaid(chunk_index, true);
Oid schemaid = ts_chunk_get_schema_id(chunk_index->chunk_id, true);
ChunkIndexDeleteData *cid = data;

ts_catalog_delete_tid(ti->scanrel, ts_scanner_get_tuple_tid(ti));
Expand Down Expand Up @@ -1041,7 +1032,7 @@ chunk_index_tuple_set_tablespace(TupleInfo *ti, void *data)
bool should_free;
HeapTuple tuple = ts_scanner_fetch_heap_tuple(ti, false, &should_free);
FormData_chunk_index *chunk_index = (FormData_chunk_index *) GETSTRUCT(tuple);
Oid schemaoid = chunk_index_get_schemaid(chunk_index, false);
Oid schemaoid = ts_chunk_get_schema_id(chunk_index->chunk_id, false);
Oid indexrelid = get_relname_relid(NameStr(chunk_index->index_name), schemaoid);
AlterTableCmd *cmd = makeNode(AlterTableCmd);
List *cmds = NIL;
Expand Down
1 change: 0 additions & 1 deletion src/chunk_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ typedef struct ChunkIndexMapping
extern void ts_chunk_index_create(Relation hypertable_rel, int32 hypertable_id,
Relation hypertable_idxrel, int32 chunk_id, Relation chunkrel);

extern List *ts_get_expr_index_attnames(IndexInfo *ii, Relation htrel);
void ts_adjust_indexinfo_attnos(IndexInfo *indexinfo, Oid ht_relid, Relation template_indexrel,
Relation chunkrel);
extern void ts_chunk_index_create_from_adjusted_index_info(int32 hypertable_id,
Expand Down
4 changes: 0 additions & 4 deletions src/net/conn.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,4 @@ extern void ts_connection_destroy(Connection *conn);
extern int ts_connection_set_timeout_millis(Connection *conn, unsigned long millis);
extern const char *ts_connection_get_and_clear_error(Connection *conn);

/* Called in init.c */
extern void ts_connection_init(void);
extern void ts_connection_fini(void);

#endif /* TIMESCALEDB_NET_CONN_H */
5 changes: 0 additions & 5 deletions src/plan_add_hashagg.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,5 @@
* */

extern void ts_plan_add_hashagg(PlannerInfo *root, RelOptInfo *input_rel, RelOptInfo *output_rel);
extern double ts_custom_group_estimate_time_bucket(PlannerInfo *root, FuncExpr *expr,
double path_rows);
extern double ts_custom_group_estimate_date_trunc(PlannerInfo *root, FuncExpr *expr,
double path_rows);
extern double ts_custom_group_estimate_expr(PlannerInfo *root, Node *expr, double path_rows);

#endif /* TIMESCALEDB_PLAN_ADD_HASHAGG_H */
2 changes: 0 additions & 2 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ extern TSDLLEXPORT List *ts_get_reloptions(Oid relid);

#define is_inheritance_table(relid) (is_inheritance_child(relid) || is_inheritance_parent(relid))

#define DATUM_GET(values, attno) values[attno - 1]

static inline int64
int64_min(int64 a, int64 b)
{
Expand Down
13 changes: 1 addition & 12 deletions tsl/src/continuous_aggs/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,11 @@
#ifndef TIMESCALEDB_TSL_CONTINUOUS_AGGS_OPTIONS_H
#define TIMESCALEDB_TSL_CONTINUOUS_AGGS_OPTIONS_H
#include <postgres.h>
#include <c.h>

#include "with_clause_parser.h"
#include "continuous_agg.h"

extern int64 continuous_agg_parse_refresh_lag(Oid column_type,
WithClauseResult *with_clause_options);
extern int64
continuous_agg_parse_ignore_invalidation_older_than(Oid column_type,
WithClauseResult *with_clause_options);

extern int64 continuous_agg_parse_max_interval_per_job(Oid column_type,
WithClauseResult *with_clause_options,
int64 bucket_width);

extern void continuous_agg_update_options(ContinuousAgg *cagg,
WithClauseResult *with_clause_options);

#endif
#endif /* TIMESCALEDB_TSL_CONTINUOUS_AGGS_OPTIONS_H */
1 change: 0 additions & 1 deletion tsl/src/data_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ extern List *data_node_array_to_node_name_list(ArrayType *nodearr);
extern List *data_node_oids_to_node_name_list(List *data_node_oids, AclMode mode);
extern void data_node_name_list_check_acl(List *data_node_names, AclMode mode);
extern Datum data_node_ping(PG_FUNCTION_ARGS);
extern Datum data_node_set_chunk_default_data_node(PG_FUNCTION_ARGS);

/* This should only be used for testing */
extern Datum data_node_add_without_dist_id(PG_FUNCTION_ARGS);
Expand Down
2 changes: 0 additions & 2 deletions tsl/src/remote/txn_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@ extern void remote_txn_store_destroy(RemoteTxnStore *store);
for (hash_seq_init(&store->scan, store->hashtable); \
NULL != (remote_txn = (RemoteTxn *) hash_seq_search(&store->scan));)

#define remote_txn_store_foreach_break(store) (hash_seq_term(&ums->scan); break)

#endif /* TIMESCALEDB_TSL_REMOTE_TXN_STORE_H */

0 comments on commit e1a00eb

Please sign in to comment.