Skip to content

Commit a9c5191

Browse files
committed
fixup
1 parent d255adf commit a9c5191

File tree

2 files changed

+54
-7
lines changed

2 files changed

+54
-7
lines changed

sr_index2.pl

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,15 @@ ($)
6666
while(<>) {
6767
if (/Fragment\s+(\d+)/){
6868
$fragment = "Fragment($1)";
69+
$pipeline = undef;
70+
$operator = undef;
6971
next;
7072
}
7173

74+
7275
if (/Pipeline\s+\(id=(\d+)\)/) {
7376
$pipeline = "Pipeline($1)";
77+
$operator = undef;
7478
$plan->{$fragment}{pipelines}{$pipeline}{id}=join "_", ($fragment, $pipeline);
7579
next;
7680
}
@@ -87,20 +91,35 @@ ($)
8791
next;
8892
}
8993

90-
if (/\b(MemoryLimit|PeakMemoryUsage|__MAX_OF_PeakMemoryUsage|InstancePeakMemoryUsage|__MAX_OF_InstancePeakMemoryUsage|InstanceNum):\s+(.*)/) {
94+
if (/\b(InstancePeakMemoryUsage|__MAX_OF_InstancePeakMemoryUsage|InstanceNum):\s+(.*)/) {
9195
$plan->{$fragment}{$1}=$2;
9296
$plan->{$fragment}{id}=$fragment;
9397
next;
9498
}
9599

100+
if (/\b(MemoryLimit|PeakMemoryUsage|__MAX_OF_PeakMemoryUsage):\s+(.*)/) {
101+
if (defined($operator)){
102+
my $operator_id = join "_", ($fragment, $pipeline, $operator);
103+
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{$1}=$2;
104+
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{id}=$operator_id;
105+
} elsif(defined($pipeline)) {
106+
$plan->{$fragment}{pipelines}{$pipeline}{$1}=$2;
107+
} else {
108+
$plan->{$fragment}{$1}=$2;
109+
$plan->{$fragment}{id}=$fragment;
110+
}
111+
next;
112+
}
113+
114+
96115
if (/\b(InstanceNum):\s+(\S+)/) {
97116
$plan->{$fragment}{$1}=$2+0;
98117
$plan->{$fragment}{id}=$fragment;
99118
next;
100119
}
101120

102-
if (/\b(DegreeOfParallelism|TotalDegreeOfParallelism):\s+(\d+)/) {
103-
$plan->{$fragment}{pipelines}{$pipeline}{$1}=$2+0;
121+
if (/\b(DegreeOfParallelism|TotalDegreeOfParallelism):\s+(\d+(?:(?:\.\d+)\w+)?)/) {
122+
$plan->{$fragment}{pipelines}{$pipeline}{$1}=norm_num($2);
104123
next;
105124
}
106125

@@ -118,20 +137,20 @@ ($)
118137
next;
119138
}
120139

121-
if (/\b(PushTotalTime|SortingTime|__MAX_OF_SortingTime|MergingTime|__MAX_OF_MergingTime|PullTotalTime|CompressTime|SetFinishingTime|BuildHashTableTime|RuntimeFilterBuildTime|CopyRightTableChunkTime|OtherJoinConjunctEvaluateTime|OutputBuildColumnTimer|OutputProbeColumnTimer|OutputTupleColumnTimer|ProbeConjunctEvaluateTime|__MAX_OF_ProbeConjunctEvaluateTime|__MIN_OF_ProbeConjunctEvaluateTime|SearchHashTableTimer|WhereConjunctEvaluateTime|OperatorTotalTime|SetFinishedTime|JoinRuntimeFilterTime|CloseTime)\b:\s+(\S+)/) {
140+
if (/\b(PushTotalTime|SortingTime|__MAX_OF_SortingTime|MergingTime|IOTaskExecTime|__MAX_OF_IOTaskExecTime|IOTaskWaitTime|__MAX_OF_IOTaskWaitTime|ScanTime|__MAX_OF_ScanTime|__MAX_OF_MergingTime|PullTotalTime|CompressTime|SetFinishingTime|BuildHashTableTime|RuntimeFilterBuildTime|CopyRightTableChunkTime|OtherJoinConjunctEvaluateTime|OutputBuildColumnTimer|OutputProbeColumnTimer|OutputTupleColumnTimer|ProbeConjunctEvaluateTime|__MAX_OF_ProbeConjunctEvaluateTime|__MIN_OF_ProbeConjunctEvaluateTime|SearchHashTableTimer|WhereConjunctEvaluateTime|OperatorTotalTime|SetFinishedTime|JoinRuntimeFilterTime|CloseTime)\b:\s+(\S+)/) {
122141
my $operator_id = join "_", ($fragment, $pipeline, $operator);
123142
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{$1}=norm_time($2);
124143
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{id}=$operator_id;
125144
next;
126145
}
127146

128-
if (/\b(RowsRead|RawRowsRead|PullChunkNum|PushChunkNum|PullRowNum|DestID|PushRowNum):\s+(\S+)/) {
147+
if (/\b(RowsRead|SubmitTaskCount|__MAX_OF_SubmitTaskCount|MorselsCount|__MAX_OF_MorselsCount|IOCounter|__MAX_OF_IOCounter|RawRowsRead|PullChunkNum|PushChunkNum|PullRowNum|DestID|PushRowNum|BlockCacheReadCounter|__MAX_OF_BlockCacheReadCounter|BlockCacheWriteCounter|__MAX_OF_BlockCacheWriteCounter):\s+(\S+)/) {
129148
my $operator_id = join "_", ($fragment, $pipeline, $operator);
130149
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{$1}=norm_num($2);
131150
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{id}=$operator_id;
132151
next;
133152
}
134-
if (/\b(BytesPassThrough|BytesSent|InputRequiredMemory|__MAX_OF_InputRequiredMemory|MergeUnsortedPeakMemoryUsage|__MAX_OF_MergeUnsortedPeakMemoryUsage|MergeSortedPeakMemoryUsage|__MAX_OF_MergeSortedPeakMemoryUsage|SortPartialPeakMemoryUsage|__MAX_OF_SortPartialPeakMemoryUsage|UpcompressedBytes|OperatorPeakMemoryUsage|__MAX_OF_OperatorPeakMemoryUsage):\s+(.*)/) {
153+
if (/\b(BytesPassThrough|BytesSent|BlockCacheWriteBytes|__MAX_OF_BlockCacheWriteBytes|BlockCacheReadBytes|__MAX_OF_BlockCacheReadBytes|InputRequiredMemory|__MAX_OF_InputRequiredMemory|MergeUnsortedPeakMemoryUsage|__MAX_OF_MergeUnsortedPeakMemoryUsage|MergeSortedPeakMemoryUsage|__MAX_OF_MergeSortedPeakMemoryUsage|SortPartialPeakMemoryUsage|__MAX_OF_SortPartialPeakMemoryUsage|UpcompressedBytes|OperatorPeakMemoryUsage|__MAX_OF_OperatorPeakMemoryUsage):\s+(.*)/) {
135154
my $operator_id = join "_", ($fragment, $pipeline, $operator);
136155
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{$1}=$2;
137156
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{id}=$operator_id;
@@ -157,5 +176,5 @@ ($)
157176
my @fragments = grep {exists $_->{$index}} @$fragments;
158177
my @pipelines = grep {exists $_->{$index}} @$pipelines;
159178
my @ops= grep {exists $_->{$index}} @$ops;
160-
print join "\n", map {sprintf "%s\t%s\t%s", "".$_->{$index}, $index, $_->{id}} sort{$a->{$index} cmp $b->{$index}} (@fragments, @pipelines, @ops);
179+
print join "\n", map {sprintf "%s\t\t%s\t%s", "".$_->{$index}, $index, $_->{id}} sort{$a->{$index} cmp $b->{$index}} (@fragments, @pipelines, @ops);
161180
print "\n";

unittest/util_test.cc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,34 @@ TEST_F(TestUtil,TestListTransform){
148148
std::cout<<*it<<std::endl;
149149
}
150150
}
151+
152+
struct VectorWrapper{
153+
VectorWrapper(std::vector<std::string>&& s):_s(std::move(s)){
154+
std::cout<<"VectorWrapper ctor: size="<<_s.size()<<std::endl;
155+
}
156+
~VectorWrapper(){
157+
std::cout<<"VectorWrapper dtor: size="<<_s.size()<<std::endl;
158+
}
159+
private:
160+
std::vector<std::string> _s;
161+
};
162+
TEST_F(TestUtil, testVectorWrapper){
163+
{
164+
std::vector<std::string> s{"abc", "def"};
165+
auto a = std::make_tuple(std::make_shared<std::vector<std::string>>(std::move(s)), std::make_shared<VectorWrapper>(std::move(s)));
166+
}
167+
{
168+
std::vector<std::string> s{"abc", "def"};
169+
auto a = std::make_tuple( std::make_shared<VectorWrapper>(std::move(s)),std::make_shared<std::vector<std::string>>(std::move(s)));
170+
}
171+
{
172+
std::vector<std::string> s{"abc", "def"};
173+
auto a = std::make_tuple(std::make_shared<VectorWrapper>(std::move(s)), std::make_shared<VectorWrapper>(std::move(s)));
174+
}
175+
}
176+
177+
178+
151179
} // namespace util
152180
} // namespace grakra
153181
} // namespace com

0 commit comments

Comments
 (0)