You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by iw...@apache.org on 2016/01/04 05:27:07 UTC

[2/3] incubator-hawq git commit: HAWQ-295. New metadata flush strategy remove 1 entry every time flush due to flush condition wrong: change datatype cast.

HAWQ-295. New metadata flush strategy remove 1 entry every time flush due to flush condition wrong: change datatype cast.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/22b1f6e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/22b1f6e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/22b1f6e7

Branch: refs/heads/master
Commit: 22b1f6e7c042df69248d4e23aaa00c52bc089c25
Parents: 4e64593
Author: stanlyxiang <st...@gmail.com>
Authored: Thu Dec 31 11:08:01 2015 +0800
Committer: stanlyxiang <st...@gmail.com>
Committed: Thu Dec 31 11:08:01 2015 +0800

----------------------------------------------------------------------
 src/backend/cdb/cdbmetadatacache_process.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/22b1f6e7/src/backend/cdb/cdbmetadatacache_process.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbmetadatacache_process.c b/src/backend/cdb/cdbmetadatacache_process.c
index 43cfd5b..273923a 100644
--- a/src/backend/cdb/cdbmetadatacache_process.c
+++ b/src/backend/cdb/cdbmetadatacache_process.c
@@ -409,9 +409,9 @@ ProcessMetadataCacheCheck()
     RelFileNode rnode;
     HdfsFileInfo *file_info;
 
-    double free_block_ratio = (FREE_BLOCK_NUM * 1.0) / metadata_cache_block_capacity;
+    double free_block_ratio = ((double)FREE_BLOCK_NUM) / metadata_cache_block_capacity;
     long cache_entry_num = hash_get_num_entries(MetadataCache);
-    double cache_entry_ratio = (cache_entry_num * 1.0) / metadata_cache_max_hdfs_file_num;
+    double cache_entry_ratio = ((double)cache_entry_num) / metadata_cache_max_hdfs_file_num;
 
     elog(DEBUG1, "[MetadataCache] ProcessMetadataCacheCheck free_block_ratio:%f", free_block_ratio);
 
@@ -443,9 +443,9 @@ ProcessMetadataCacheCheck()
             DestroyHdfsFileInfo(file_info);
             total_remove_files++;
 
-            double cache_entry_ratio = (hash_get_num_entries(MetadataCache) * 1.0) / metadata_cache_max_hdfs_file_num;
+            double cache_entry_ratio = ((double)hash_get_num_entries(MetadataCache)) / metadata_cache_max_hdfs_file_num;
 
-            if (((FREE_BLOCK_NUM * 1.0) / metadata_cache_block_capacity) >= metadata_cache_free_block_normal_ratio
+            if ((((double)FREE_BLOCK_NUM) / metadata_cache_block_capacity) >= metadata_cache_free_block_normal_ratio
             		&& cache_entry_ratio < metadata_cache_reduce_ratio)
             {
                 break;