Browse Source

更新物理世界数据

李莎 2 years ago
parent
commit
ab1ffec8b3
1 changed files with 14 additions and 6 deletions
  1. 14 6
      physical_world_exporter/MyUtils/ZillionUtil.py

+ 14 - 6
physical_world_exporter/MyUtils/ZillionUtil.py

@@ -1,6 +1,3 @@
-from physical_world_exporter.MyUtils.MetadataWebUtil import MetadataWebUtil
-
-
 class ZillionUtil():
     def __init__(self, url):
         self.metadata = MetadataWebUtil(url)
@@ -18,8 +15,8 @@ class ZillionUtil():
     ##列出所有数据库下的表(不包含分表)
     def table_list_strict(self,table):
         param = {
-            	"QueryType":"table_list_strict",
-	            "Database":table
+                "QueryType":"table_list_strict",
+                    "Database":table
         }
         databases = self.metadata.get_hbase(param)
         return databases["Content"]
@@ -93,6 +90,17 @@ class ZillionUtil():
         databases = self.metadata.get_hbase(param)
         return databases["Count"]
 
+    def delete(self,database,table,Criteria):
+        param = {
+            "QueryType": "delete",
+            "Database": database,
+            "Datatable": table,
+            "Criteria": Criteria
+        }
+        databases = self.metadata.get_hbase(param)
+        return databases["Count"]
+
+
     def put(self,database,table,InsertObject):
         param = {
             "QueryType": "batch_put",
@@ -101,4 +109,4 @@ class ZillionUtil():
             "InsertObjects": InsertObject
         }
         databases = self.metadata.get_hbase(param)
-        return databases["Result"]
+        return databases["Result"]