From commits-return-15922-archive-asf-public=cust-asf.ponee.io@pulsar.apache.org Thu Oct 11 11:09:32 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8D70C18064A for ; Thu, 11 Oct 2018 11:09:31 +0200 (CEST) Received: (qmail 36435 invoked by uid 500); 11 Oct 2018 09:09:30 -0000 Mailing-List: contact commits-help@pulsar.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.apache.org Delivered-To: mailing list commits@pulsar.apache.org Received: (qmail 36426 invoked by uid 99); 11 Oct 2018 09:09:30 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2018 09:09:30 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 03FEF85838; Thu, 11 Oct 2018 09:09:30 +0000 (UTC) Date: Thu, 11 Oct 2018 09:09:29 +0000 To: "commits@pulsar.apache.org" Subject: [pulsar] branch asf-site updated: Updated site at revision 6b15a6b MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <153924896984.23283.16229878422718081953@gitbox.apache.org> From: mmerli@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: pulsar X-Git-Refname: refs/heads/asf-site X-Git-Reftype: branch X-Git-Oldrev: 251cdf16fec6e4d50859e01bb031a6b3d9f5c7dd X-Git-Newrev: 64678cad6e7680132a8fa923699feba20117ff4f X-Git-Rev: 64678cad6e7680132a8fa923699feba20117ff4f X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. mmerli pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/pulsar.git The following commit(s) were added to refs/heads/asf-site by this push: new 64678ca Updated site at revision 6b15a6b 64678ca is described below commit 64678cad6e7680132a8fa923699feba20117ff4f Author: jenkins AuthorDate: Thu Oct 11 09:09:18 2018 +0000 Updated site at revision 6b15a6b --- content/api/python/functions/serde.m.html | 66 ++++++++++++++++++++++++++----- content/swagger/swagger.json | 46 ++++++++++----------- 2 files changed, 80 insertions(+), 32 deletions(-) diff --git a/content/api/python/functions/serde.m.html b/content/api/python/functions/serde.m.html index c5619b4..01e4355 100644 --- a/content/api/python/functions/serde.m.html +++ b/content/api/python/functions/serde.m.html @@ -979,6 +979,7 @@ table { @@ -1097,12 +1098,22 @@ class PickleSerDe(SerDe): return pickle.loads(input_bytes) class IdentitySerDe(SerDe): - """Pickle based serializer""" + """Simple Serde that just conversion to string and back""" + def __init__(self): + self._types = [int, float, complex, str] + def serialize(self, input): - return input + if type(input) in self._types: + return str(input).encode('utf-8') + raise TypeError def deserialize(self, input_bytes): - return input_bytes + for typ in self._types: + try: + return typ(input_bytes.decode('utf-8')) + except: + pass + raise TypeError @@ -1117,17 +1128,27 @@ class IdentitySerDe(SerDe):

class IdentitySerDe

-

Pickle based serializer

+

Simple Serde that just conversion to string and back

class IdentitySerDe(SerDe):
-  """Pickle based serializer"""
+  """Simple Serde that just conversion to string and back"""
+  def __init__(self):
+    self._types = [int, float, complex, str]
+
   def serialize(self, input):
-    return input
+    if type(input) in self._types:
+      return str(input).encode('utf-8')
+    raise TypeError
 
   def deserialize(self, input_bytes):
-    return input_bytes
+    for typ in self._types:
+      try:
+        return typ(input_bytes.decode('utf-8'))
+      except:
+        pass
+    raise TypeError
 
@@ -1143,6 +1164,26 @@ class IdentitySerDe(SerDe):

Methods

+
+

def __init__(

self)

+
+ + + + +
+ +
+
def __init__(self):
+  self._types = [int, float, complex, str]
+
+
+
+ +
+ + +

def deserialize(

self, input_bytes)

@@ -1159,7 +1200,12 @@ class IdentitySerDe(SerDe):
def deserialize(self, input_bytes):
-  return input_bytes
+  for typ in self._types:
+    try:
+      return typ(input_bytes.decode('utf-8'))
+    except:
+      pass
+  raise TypeError
 
@@ -1184,7 +1230,9 @@ class IdentitySerDe(SerDe):
def serialize(self, input):
-  return input
+  if type(input) in self._types:
+    return str(input).encode('utf-8')
+  raise TypeError
 
diff --git a/content/swagger/swagger.json b/content/swagger/swagger.json index 559059c..3ab3b71 100644 --- a/content/swagger/swagger.json +++ b/content/swagger/swagger.json @@ -6721,41 +6721,41 @@ "type" : "number", "format" : "double" }, + "underLoaded" : { + "type" : "boolean" + }, "bandwidthIn" : { "$ref" : "#/definitions/ResourceUsage" }, - "msgThroughputOut" : { - "type" : "number", - "format" : "double" + "bandwidthOut" : { + "$ref" : "#/definitions/ResourceUsage" }, "memory" : { "$ref" : "#/definitions/ResourceUsage" }, - "msgThroughputIn" : { - "type" : "number", - "format" : "double" + "directMemory" : { + "$ref" : "#/definitions/ResourceUsage" }, - "underLoaded" : { - "type" : "boolean" + "cpu" : { + "$ref" : "#/definitions/ResourceUsage" }, "overLoaded" : { "type" : "boolean" }, - "cpu" : { - "$ref" : "#/definitions/ResourceUsage" - }, "loadReportType" : { "type" : "string" }, - "bandwidthOut" : { - "$ref" : "#/definitions/ResourceUsage" + "msgThroughputIn" : { + "type" : "number", + "format" : "double" + }, + "msgThroughputOut" : { + "type" : "number", + "format" : "double" }, "lastUpdate" : { "type" : "integer", "format" : "int64" - }, - "directMemory" : { - "$ref" : "#/definitions/ResourceUsage" } } }, @@ -7684,15 +7684,15 @@ "ResourceDescription" : { "type" : "object", "properties" : { + "usagePct" : { + "type" : "integer", + "format" : "int32" + }, "resourceUsage" : { "type" : "object", "additionalProperties" : { "$ref" : "#/definitions/ResourceUsage" } - }, - "usagePct" : { - "type" : "integer", - "format" : "int32" } } }, @@ -7727,11 +7727,11 @@ "ResourceUnit" : { "type" : "object", "properties" : { - "availableResource" : { - "$ref" : "#/definitions/ResourceDescription" - }, "resourceId" : { "type" : "string" + }, + "availableResource" : { + "$ref" : "#/definitions/ResourceDescription" } } },