hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hubertzh...@apache.org
Subject incubator-hawq git commit: HAWQ-236. Meta data hit ratio is -0.0 when file len is zero.
Date Wed, 09 Dec 2015 06:29:06 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 3c777449e -> b0972d7e5


HAWQ-236. Meta data hit ratio is -0.0 when file len is zero.


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

Branch: refs/heads/master
Commit: b0972d7e5910f0bd29afe42a206645235ded7266
Parents: 3c77744
Author: hubertzhang <hzhang@pivotal.io>
Authored: Wed Dec 9 14:28:31 2015 +0800
Committer: hubertzhang <hzhang@pivotal.io>
Committed: Wed Dec 9 14:28:31 2015 +0800

----------------------------------------------------------------------
 src/backend/cdb/cdbdatalocality.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b0972d7e/src/backend/cdb/cdbdatalocality.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbdatalocality.c b/src/backend/cdb/cdbdatalocality.c
index 3cacd74..5341d4f 100644
--- a/src/backend/cdb/cdbdatalocality.c
+++ b/src/backend/cdb/cdbdatalocality.c
@@ -1095,7 +1095,7 @@ static void AOGetSegFileDataLocation(Relation relation,
 		fclose(fpaoseg);
 		for (int i = 0; i < fileCount; i++) {
 			BlockLocation *locations = NULL;
-			int block_num;
+			int block_num =0;
 			Relation_File *file;
 
 			int segno = i + 1;
@@ -1110,7 +1110,7 @@ static void AOGetSegFileDataLocation(Relation relation,
 
 			if (!context->keep_hash || !isRelationHash) {
 				FormatAOSegmentFileName(basepath, segno, -1, 0, &segno, segfile_path);
-				double hit_ratio;
+				double hit_ratio=0.0;
 				locations = fetch_hdfs_data_block_location(segfile_path, logic_len,
 						&block_num, relation->rd_node, segno, &hit_ratio);
 				*allblocks += block_num;
@@ -2659,6 +2659,7 @@ static void allocate_random_relation(Relation_Data* rel_data,
 
 
 	/*find the insert node for each block*/
+	uint64_t before_run_find_insert_host = gettime_microsec();
 	int *hostOccurTimes = (int *) palloc(sizeof(int) * context->dds_context.size);
 	for (int fi = 0; fi < fileCount; fi++) {
 		Relation_File *rel_file = file_vector[fi];
@@ -2702,6 +2703,12 @@ static void allocate_random_relation(Relation_Data* rel_data,
 	}
 	pfree(hostOccurTimes);
 
+	uint64_t end_run_find_insert_host = gettime_microsec();
+	int run_find_insert_host = end_run_find_insert_host - before_run_find_insert_host;
+	if(debug_datalocality_time){
+		elog(LOG, "find insert host time: %d us. \n", run_find_insert_host);
+	}
+
 	/*three stage allocation algorithm*/
 	for (int fi = 0; fi < fileCount; fi++) {
 		Relation_File *rel_file = file_vector[fi];


Mime
View raw message