You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/11/22 11:35:27 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #2260: Add a tool to show segment status

imay commented on a change in pull request #2260: Add a tool to show segment status
URL: https://github.com/apache/incubator-doris/pull/2260#discussion_r349553581
 
 

 ##########
 File path: tools/show_segment_status/be_tablet_reslover.py
 ##########
 @@ -0,0 +1,110 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import json
+import time 
+from urllib import urlopen
+
+class BeTabletResolver:
+    def __init__(self, be_list, tablet_map):
+        self.tablet_map = tablet_map
+        self.tablet_infos = {}
+
+        self.be_map = {}
+        for be in be_list:
+            self.be_map[be['be_id']] = be
+
+    def debug_output(self):
+        print "tablet_infos:(%s), print up to ten here:" % len(self.tablet_infos)
+        self._print_list(self.tablet_infos.values()[0:10])
+        print
+
+    def _print_list(self, one_list):
+        for item in one_list:
+            print item
+
+    def init(self):
+        self.fetch_tablet_meta()
+
+    def fetch_tablet_meta(self):
+        print "fetching tablet metas from BEs..."
+        count = 0
+        for tablet in self.tablet_map.values():
+            be_id = tablet['be_id']
+            be = self.be_map[be_id]
+            url = self._make_url(be, tablet)
+            print url
 
 Review comment:
   This will print log for every replica, do we really needs this?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org