提交 d3df58bd 编写于 作者: H Heikki Linnakangas

Remove "complete" flag from workfile.

It was only used in logging. Doesn't seem worth the trouble to keep it
around.
上级 c853b1ca
...@@ -1994,19 +1994,4 @@ void destroy_agg_hash_table(AggState *aggstate) ...@@ -1994,19 +1994,4 @@ void destroy_agg_hash_table(AggState *aggstate)
} }
} }
/*
* Marks workfile set as complete
*/
void
agg_hash_mark_spillset_complete(AggState *aggstate)
{
Assert(aggstate != NULL);
Assert(aggstate->hhashtable != NULL);
Assert(aggstate->hhashtable->work_set != NULL);
workfile_set *work_set = aggstate->hhashtable->work_set;
workfile_mgr_mark_complete(work_set);
}
/* EOF */ /* EOF */
...@@ -1534,22 +1534,4 @@ ntuplestore_create_spill_files(NTupleStore *nts) ...@@ -1534,22 +1534,4 @@ ntuplestore_create_spill_files(NTupleStore *nts)
MemoryContextSwitchTo(oldcxt); MemoryContextSwitchTo(oldcxt);
} }
/*
* Mark the associated workfile set as complete
*/
void
ntuplestore_mark_workset_complete(NTupleStore *nts)
{
Assert(nts != NULL);
if (nts->work_set == NULL)
{
return;
}
if (nts->workfiles_created)
{
elog(gp_workfile_caching_loglevel, "Tuplestore: Marking workset as complete");
workfile_mgr_mark_complete(nts->work_set);
}
}
/* EOF */ /* EOF */
...@@ -326,7 +326,6 @@ workfile_mgr_populate_set(const void *resource, const void *param) ...@@ -326,7 +326,6 @@ workfile_mgr_populate_set(const void *resource, const void *param)
work_set->metadata.operator_work_mem = set_info->operator_work_mem; work_set->metadata.operator_work_mem = set_info->operator_work_mem;
work_set->set_plan = NULL; work_set->set_plan = NULL;
work_set->complete = false;
work_set->no_files = 0; work_set->no_files = 0;
work_set->size = 0L; work_set->size = 0L;
work_set->in_progress_size = 0L; work_set->in_progress_size = 0L;
...@@ -730,32 +729,15 @@ workfile_mgr_close_set(workfile_set *work_set) ...@@ -730,32 +729,15 @@ workfile_mgr_close_set(workfile_set *work_set)
{ {
Assert(work_set!=NULL); Assert(work_set!=NULL);
elog(gp_workfile_caching_loglevel, "closing workfile set: complete=%d location: %s, size=" INT64_FORMAT elog(gp_workfile_caching_loglevel, "closing workfile set: location: %s, size=" INT64_FORMAT
" in_progress_size=" INT64_FORMAT, " in_progress_size=" INT64_FORMAT,
work_set->complete, work_set->path, work_set->path,
work_set->size, work_set->in_progress_size); work_set->size, work_set->in_progress_size);
CacheEntry *cache_entry = CACHE_ENTRY_HEADER(work_set); CacheEntry *cache_entry = CACHE_ENTRY_HEADER(work_set);
Cache_Release(workfile_mgr_cache, cache_entry); Cache_Release(workfile_mgr_cache, cache_entry);
} }
/*
* Mark a workfile_set as complete. This means it should be cached upon closing,
* as it can be re-used.
* If the operator is canceled or fails after this, the workfile set can
* still be re-used.
* This should be done after all the data has been flushed to disk.
* After this point, assume anyone can read and re-use this set.
*/
void workfile_mgr_mark_complete(workfile_set *work_set)
{
Assert(work_set != NULL);
Assert(!work_set->complete);
work_set->complete = true;
}
/* /*
* This function is called at transaction commit or abort to delete closed * This function is called at transaction commit or abort to delete closed
* workfiles. * workfiles.
......
...@@ -224,7 +224,6 @@ extern bool agg_hash_stream(AggState *aggstate); ...@@ -224,7 +224,6 @@ extern bool agg_hash_stream(AggState *aggstate);
extern bool agg_hash_next_pass(AggState *aggstate); extern bool agg_hash_next_pass(AggState *aggstate);
extern bool agg_hash_continue_pass(AggState *aggstate); extern bool agg_hash_continue_pass(AggState *aggstate);
extern void destroy_agg_hash_table(AggState *aggstate); extern void destroy_agg_hash_table(AggState *aggstate);
extern void agg_hash_mark_spillset_complete(AggState *aggstate);
extern HashAggEntry *agg_hash_iter(AggState *aggstate); extern HashAggEntry *agg_hash_iter(AggState *aggstate);
......
...@@ -74,7 +74,5 @@ extern void ntuplestore_acc_seek_eof(NTupleStoreAccessor *tsa); ...@@ -74,7 +74,5 @@ extern void ntuplestore_acc_seek_eof(NTupleStoreAccessor *tsa);
extern int ntuplestore_count_slot_acc(NTupleStore *nts, NTupleStoreAccessor* tsa1, NTupleStoreAccessor *tsa2); extern int ntuplestore_count_slot_acc(NTupleStore *nts, NTupleStoreAccessor* tsa1, NTupleStoreAccessor *tsa2);
extern void ntuplestore_acc_set_invalid(NTupleStoreAccessor *tsa); extern void ntuplestore_acc_set_invalid(NTupleStoreAccessor *tsa);
extern bool ntuplestore_acc_is_before(NTupleStoreAccessor *tsa1, NTupleStoreAccessor *tsa2); extern bool ntuplestore_acc_is_before(NTupleStoreAccessor *tsa1, NTupleStoreAccessor *tsa2);
/* workfile set functions */
extern void ntuplestore_mark_workset_complete(NTupleStore *nts);
extern bool ntuplestore_created_reusable_workfiles(NTupleStore *nts);
#endif /* TUPSTORE_NEW_H */ #endif /* TUPSTORE_NEW_H */
...@@ -107,9 +107,6 @@ typedef struct workfile_set ...@@ -107,9 +107,6 @@ typedef struct workfile_set
/* For non-physical workfile sets, pointer to the serialized plan */ /* For non-physical workfile sets, pointer to the serialized plan */
workfile_set_plan *set_plan; workfile_set_plan *set_plan;
/* Set to true during operator execution once set is complete */
bool complete;
} workfile_set; } workfile_set;
/* The key for an entry stored in the Queryspace Hashtable */ /* The key for an entry stored in the Queryspace Hashtable */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册