From 7e304aa848a76641b44e062a60f697d98d6ca721 Mon Sep 17 00:00:00 2001 From: laura-ding <48548375+laura-ding@users.noreply.github.com> Date: Sun, 21 Mar 2021 21:20:13 +0800 Subject: [PATCH 1/3] update ga thrift files --- nebula2/common/constants.py | 6 +++--- nebula2/common/ttypes.py | 18 ++++++++-------- nebula2/graph/GraphService-fuzzer | 6 +++--- nebula2/graph/GraphService-remote | 6 +++--- nebula2/graph/GraphService.py | 22 ++++++++++---------- nebula2/graph/constants.py | 6 +++--- nebula2/graph/ttypes.py | 21 +++++++++++-------- nebula2/meta/MetaService-fuzzer | 6 +++--- nebula2/meta/MetaService-remote | 6 +++--- nebula2/meta/MetaService.py | 22 ++++++++++---------- nebula2/meta/constants.py | 6 +++--- nebula2/meta/ttypes.py | 18 ++++++++-------- nebula2/storage/GeneralStorageService-fuzzer | 6 +++--- nebula2/storage/GeneralStorageService-remote | 6 +++--- nebula2/storage/GeneralStorageService.py | 22 ++++++++++---------- nebula2/storage/GraphStorageService-fuzzer | 6 +++--- nebula2/storage/GraphStorageService-remote | 6 +++--- nebula2/storage/GraphStorageService.py | 22 ++++++++++---------- nebula2/storage/StorageAdminService-fuzzer | 6 +++--- nebula2/storage/StorageAdminService-remote | 6 +++--- nebula2/storage/StorageAdminService.py | 22 ++++++++++---------- nebula2/storage/constants.py | 6 +++--- nebula2/storage/ttypes.py | 18 ++++++++-------- 23 files changed, 136 insertions(+), 133 deletions(-) diff --git a/nebula2/common/constants.py b/nebula2/common/constants.py index bd42fa1f..32c91b20 100644 --- a/nebula2/common/constants.py +++ b/nebula2/common/constants.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException diff --git a/nebula2/common/ttypes.py b/nebula2/common/ttypes.py index 9eae81ba..12079f58 100644 --- a/nebula2/common/ttypes.py +++ b/nebula2/common/ttypes.py @@ -7,23 +7,23 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException import pprint import warnings -from nebula2.fbthrift import Thrift -from nebula2.fbthrift.transport import TTransport -from nebula2.fbthrift.protocol import TBinaryProtocol -from nebula2.fbthrift.protocol import TCompactProtocol -from nebula2.fbthrift.protocol import THeaderProtocol +from thrift import Thrift +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +from thrift.protocol import TCompactProtocol +from thrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from nebula2.fbthrift.protocol import fastproto + from thrift.protocol import fastproto except: pass all_structs = [] diff --git a/nebula2/graph/GraphService-fuzzer b/nebula2/graph/GraphService-fuzzer index 7e0b6880..1cea1e31 100755 --- a/nebula2/graph/GraphService-fuzzer +++ b/nebula2/graph/GraphService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import GraphService from . import ttypes from . import constants -import nebula2.fbthrift.util.fuzzer -nebula2.fbthrift.util.fuzzer.fuzz_service(GraphService, ttypes, constants) +import thrift.util.fuzzer +thrift.util.fuzzer.fuzz_service(GraphService, ttypes, constants) diff --git a/nebula2/graph/GraphService-remote b/nebula2/graph/GraphService-remote index 3b02f3f2..932d85bc 100755 --- a/nebula2/graph/GraphService-remote +++ b/nebula2/graph/GraphService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import GraphService from . import ttypes -from nebula2.fbthrift.util.remote import Function -from nebula2.fbthrift.remote import Remote +from thrift.util.remote import Function +from thrift.remote import Remote FUNCTIONS = { 'authenticate': Function('authenticate', 'GraphService', 'AuthResponse', [('string', 'username', 'string'), ('string', 'password', 'string')]), diff --git a/nebula2/graph/GraphService.py b/nebula2/graph/GraphService.py index 43248deb..77aad5fa 100644 --- a/nebula2/graph/GraphService.py +++ b/nebula2/graph/GraphService.py @@ -7,33 +7,33 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes -from nebula2.fbthrift.Thrift import TProcessor +from thrift.Thrift import TProcessor import pprint import warnings -from nebula2.fbthrift import Thrift -from nebula2.fbthrift.transport import TTransport -from nebula2.fbthrift.protocol import TBinaryProtocol -from nebula2.fbthrift.protocol import TCompactProtocol -from nebula2.fbthrift.protocol import THeaderProtocol +from thrift import Thrift +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +from thrift.protocol import TCompactProtocol +from thrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from nebula2.fbthrift.protocol import fastproto + from thrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from nebula2.fbthrift.util.Decorators import * +from thrift.util.Decorators import * class Iface: def authenticate(self, username=None, password=None): diff --git a/nebula2/graph/constants.py b/nebula2/graph/constants.py index 19858098..e240e123 100644 --- a/nebula2/graph/constants.py +++ b/nebula2/graph/constants.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes diff --git a/nebula2/graph/ttypes.py b/nebula2/graph/ttypes.py index 483680eb..d21e62e9 100644 --- a/nebula2/graph/ttypes.py +++ b/nebula2/graph/ttypes.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes @@ -17,15 +17,15 @@ import pprint import warnings -from nebula2.fbthrift import Thrift -from nebula2.fbthrift.transport import TTransport -from nebula2.fbthrift.protocol import TBinaryProtocol -from nebula2.fbthrift.protocol import TCompactProtocol -from nebula2.fbthrift.protocol import THeaderProtocol +from thrift import Thrift +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +from thrift.protocol import TCompactProtocol +from thrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from nebula2.fbthrift.protocol import fastproto + from thrift.protocol import fastproto except: pass all_structs = [] @@ -48,6 +48,7 @@ class ErrorCode: E_BAD_PERMISSION = -11 E_SEMANTIC_ERROR = -12 E_TOO_MANY_CONNECTIONS = -13 + E_PARTIAL_SUCCEEDED = -14 _VALUES_TO_NAMES = { 0: "SUCCEEDED", @@ -64,6 +65,7 @@ class ErrorCode: -11: "E_BAD_PERMISSION", -12: "E_SEMANTIC_ERROR", -13: "E_TOO_MANY_CONNECTIONS", + -14: "E_PARTIAL_SUCCEEDED", } _NAMES_TO_VALUES = { @@ -81,6 +83,7 @@ class ErrorCode: "E_BAD_PERMISSION": -11, "E_SEMANTIC_ERROR": -12, "E_TOO_MANY_CONNECTIONS": -13, + "E_PARTIAL_SUCCEEDED": -14, } class ProfilingStats: diff --git a/nebula2/meta/MetaService-fuzzer b/nebula2/meta/MetaService-fuzzer index d760c6ca..1a24bc63 100755 --- a/nebula2/meta/MetaService-fuzzer +++ b/nebula2/meta/MetaService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import MetaService from . import ttypes from . import constants -import nebula2.fbthrift.util.fuzzer -nebula2.fbthrift.util.fuzzer.fuzz_service(MetaService, ttypes, constants) +import thrift.util.fuzzer +thrift.util.fuzzer.fuzz_service(MetaService, ttypes, constants) diff --git a/nebula2/meta/MetaService-remote b/nebula2/meta/MetaService-remote index 3b1ab2c1..97b5d203 100755 --- a/nebula2/meta/MetaService-remote +++ b/nebula2/meta/MetaService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import MetaService from . import ttypes -from nebula2.fbthrift.util.remote import Function -from nebula2.fbthrift.remote import Remote +from thrift.util.remote import Function +from thrift.remote import Remote FUNCTIONS = { 'createSpace': Function('createSpace', 'MetaService', 'ExecResp', [('CreateSpaceReq', 'req', 'CreateSpaceReq')]), diff --git a/nebula2/meta/MetaService.py b/nebula2/meta/MetaService.py index dfe9a52e..e810ba43 100644 --- a/nebula2/meta/MetaService.py +++ b/nebula2/meta/MetaService.py @@ -7,33 +7,33 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes -from nebula2.fbthrift.Thrift import TProcessor +from thrift.Thrift import TProcessor import pprint import warnings -from nebula2.fbthrift import Thrift -from nebula2.fbthrift.transport import TTransport -from nebula2.fbthrift.protocol import TBinaryProtocol -from nebula2.fbthrift.protocol import TCompactProtocol -from nebula2.fbthrift.protocol import THeaderProtocol +from thrift import Thrift +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +from thrift.protocol import TCompactProtocol +from thrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from nebula2.fbthrift.protocol import fastproto + from thrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from nebula2.fbthrift.util.Decorators import * +from thrift.util.Decorators import * class Iface: def createSpace(self, req=None): diff --git a/nebula2/meta/constants.py b/nebula2/meta/constants.py index 19858098..e240e123 100644 --- a/nebula2/meta/constants.py +++ b/nebula2/meta/constants.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes diff --git a/nebula2/meta/ttypes.py b/nebula2/meta/ttypes.py index 8c378605..e849b1b1 100644 --- a/nebula2/meta/ttypes.py +++ b/nebula2/meta/ttypes.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes @@ -17,15 +17,15 @@ import pprint import warnings -from nebula2.fbthrift import Thrift -from nebula2.fbthrift.transport import TTransport -from nebula2.fbthrift.protocol import TBinaryProtocol -from nebula2.fbthrift.protocol import TCompactProtocol -from nebula2.fbthrift.protocol import THeaderProtocol +from thrift import Thrift +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +from thrift.protocol import TCompactProtocol +from thrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from nebula2.fbthrift.protocol import fastproto + from thrift.protocol import fastproto except: pass all_structs = [] diff --git a/nebula2/storage/GeneralStorageService-fuzzer b/nebula2/storage/GeneralStorageService-fuzzer index 3ecdc7e5..906f2074 100755 --- a/nebula2/storage/GeneralStorageService-fuzzer +++ b/nebula2/storage/GeneralStorageService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import GeneralStorageService from . import ttypes from . import constants -import nebula2.fbthrift.util.fuzzer -nebula2.fbthrift.util.fuzzer.fuzz_service(GeneralStorageService, ttypes, constants) +import thrift.util.fuzzer +thrift.util.fuzzer.fuzz_service(GeneralStorageService, ttypes, constants) diff --git a/nebula2/storage/GeneralStorageService-remote b/nebula2/storage/GeneralStorageService-remote index 8d6a7eaa..bf0ab367 100755 --- a/nebula2/storage/GeneralStorageService-remote +++ b/nebula2/storage/GeneralStorageService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import GeneralStorageService from . import ttypes -from nebula2.fbthrift.util.remote import Function -from nebula2.fbthrift.remote import Remote +from thrift.util.remote import Function +from thrift.remote import Remote FUNCTIONS = { 'get': Function('get', 'GeneralStorageService', 'KVGetResponse', [('KVGetRequest', 'req', 'KVGetRequest')]), diff --git a/nebula2/storage/GeneralStorageService.py b/nebula2/storage/GeneralStorageService.py index 5171a4b2..a082cc3a 100644 --- a/nebula2/storage/GeneralStorageService.py +++ b/nebula2/storage/GeneralStorageService.py @@ -7,34 +7,34 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes import nebula2.meta.ttypes -from nebula2.fbthrift.Thrift import TProcessor +from thrift.Thrift import TProcessor import pprint import warnings -from nebula2.fbthrift import Thrift -from nebula2.fbthrift.transport import TTransport -from nebula2.fbthrift.protocol import TBinaryProtocol -from nebula2.fbthrift.protocol import TCompactProtocol -from nebula2.fbthrift.protocol import THeaderProtocol +from thrift import Thrift +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +from thrift.protocol import TCompactProtocol +from thrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from nebula2.fbthrift.protocol import fastproto + from thrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from nebula2.fbthrift.util.Decorators import * +from thrift.util.Decorators import * class Iface: def get(self, req=None): diff --git a/nebula2/storage/GraphStorageService-fuzzer b/nebula2/storage/GraphStorageService-fuzzer index d47897b9..85bc3025 100755 --- a/nebula2/storage/GraphStorageService-fuzzer +++ b/nebula2/storage/GraphStorageService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import GraphStorageService from . import ttypes from . import constants -import nebula2.fbthrift.util.fuzzer -nebula2.fbthrift.util.fuzzer.fuzz_service(GraphStorageService, ttypes, constants) +import thrift.util.fuzzer +thrift.util.fuzzer.fuzz_service(GraphStorageService, ttypes, constants) diff --git a/nebula2/storage/GraphStorageService-remote b/nebula2/storage/GraphStorageService-remote index f060ff2b..3f97cd80 100755 --- a/nebula2/storage/GraphStorageService-remote +++ b/nebula2/storage/GraphStorageService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import GraphStorageService from . import ttypes -from nebula2.fbthrift.util.remote import Function -from nebula2.fbthrift.remote import Remote +from thrift.util.remote import Function +from thrift.remote import Remote FUNCTIONS = { 'getNeighbors': Function('getNeighbors', 'GraphStorageService', 'GetNeighborsResponse', [('GetNeighborsRequest', 'req', 'GetNeighborsRequest')]), diff --git a/nebula2/storage/GraphStorageService.py b/nebula2/storage/GraphStorageService.py index 56e6125b..22f3f4d6 100644 --- a/nebula2/storage/GraphStorageService.py +++ b/nebula2/storage/GraphStorageService.py @@ -7,34 +7,34 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes import nebula2.meta.ttypes -from nebula2.fbthrift.Thrift import TProcessor +from thrift.Thrift import TProcessor import pprint import warnings -from nebula2.fbthrift import Thrift -from nebula2.fbthrift.transport import TTransport -from nebula2.fbthrift.protocol import TBinaryProtocol -from nebula2.fbthrift.protocol import TCompactProtocol -from nebula2.fbthrift.protocol import THeaderProtocol +from thrift import Thrift +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +from thrift.protocol import TCompactProtocol +from thrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from nebula2.fbthrift.protocol import fastproto + from thrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from nebula2.fbthrift.util.Decorators import * +from thrift.util.Decorators import * class Iface: def getNeighbors(self, req=None): diff --git a/nebula2/storage/StorageAdminService-fuzzer b/nebula2/storage/StorageAdminService-fuzzer index c0b7396a..27bddbb8 100755 --- a/nebula2/storage/StorageAdminService-fuzzer +++ b/nebula2/storage/StorageAdminService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import StorageAdminService from . import ttypes from . import constants -import nebula2.fbthrift.util.fuzzer -nebula2.fbthrift.util.fuzzer.fuzz_service(StorageAdminService, ttypes, constants) +import thrift.util.fuzzer +thrift.util.fuzzer.fuzz_service(StorageAdminService, ttypes, constants) diff --git a/nebula2/storage/StorageAdminService-remote b/nebula2/storage/StorageAdminService-remote index c17b5672..c8d4817e 100755 --- a/nebula2/storage/StorageAdminService-remote +++ b/nebula2/storage/StorageAdminService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your fbthrift file with + Instead, you should generate your thrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import StorageAdminService from . import ttypes -from nebula2.fbthrift.util.remote import Function -from nebula2.fbthrift.remote import Remote +from thrift.util.remote import Function +from thrift.remote import Remote FUNCTIONS = { 'transLeader': Function('transLeader', 'StorageAdminService', 'AdminExecResp', [('TransLeaderReq', 'req', 'TransLeaderReq')]), diff --git a/nebula2/storage/StorageAdminService.py b/nebula2/storage/StorageAdminService.py index 01c652de..555ef136 100644 --- a/nebula2/storage/StorageAdminService.py +++ b/nebula2/storage/StorageAdminService.py @@ -7,34 +7,34 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes import nebula2.meta.ttypes -from nebula2.fbthrift.Thrift import TProcessor +from thrift.Thrift import TProcessor import pprint import warnings -from nebula2.fbthrift import Thrift -from nebula2.fbthrift.transport import TTransport -from nebula2.fbthrift.protocol import TBinaryProtocol -from nebula2.fbthrift.protocol import TCompactProtocol -from nebula2.fbthrift.protocol import THeaderProtocol +from thrift import Thrift +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +from thrift.protocol import TCompactProtocol +from thrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from nebula2.fbthrift.protocol import fastproto + from thrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from nebula2.fbthrift.util.Decorators import * +from thrift.util.Decorators import * class Iface: def transLeader(self, req=None): diff --git a/nebula2/storage/constants.py b/nebula2/storage/constants.py index f162eb6c..616feb6e 100644 --- a/nebula2/storage/constants.py +++ b/nebula2/storage/constants.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes diff --git a/nebula2/storage/ttypes.py b/nebula2/storage/ttypes.py index f5a1166b..033de54a 100644 --- a/nebula2/storage/ttypes.py +++ b/nebula2/storage/ttypes.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from nebula2.fbthrift.util.Recursive import fix_spec -from nebula2.fbthrift.Thrift import * -from nebula2.fbthrift.protocol.TProtocol import TProtocolException +from thrift.util.Recursive import fix_spec +from thrift.Thrift import * +from thrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes @@ -18,15 +18,15 @@ import pprint import warnings -from nebula2.fbthrift import Thrift -from nebula2.fbthrift.transport import TTransport -from nebula2.fbthrift.protocol import TBinaryProtocol -from nebula2.fbthrift.protocol import TCompactProtocol -from nebula2.fbthrift.protocol import THeaderProtocol +from thrift import Thrift +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +from thrift.protocol import TCompactProtocol +from thrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from nebula2.fbthrift.protocol import fastproto + from thrift.protocol import fastproto except: pass all_structs = [] From 1fb36add0105c526748b443016408aabc33bd209 Mon Sep 17 00:00:00 2001 From: laura-ding <48548375+laura-ding@users.noreply.github.com> Date: Mon, 22 Mar 2021 10:37:10 +0800 Subject: [PATCH 2/3] modify the version --- README.md | 3 ++- example/GraphClientSimpleExample.py | 14 +++++++++++--- setup.py | 10 ++++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7075a8f6..037d8471 100644 --- a/README.md +++ b/README.md @@ -141,5 +141,6 @@ while resp.has_next(): | Nebula2-Python Version | NebulaGraph Version | |---|---| | 2.0.0.post1 | 2.0.0beta | -| 2.0.0rc1 | 2.0.0-RC1 | +| 2.0.0rc1 | 2.0.0-rc1 | +| 2.0.0ga | 2.0.0-ga | diff --git a/example/GraphClientSimpleExample.py b/example/GraphClientSimpleExample.py index 39601b3b..812c56ea 100644 --- a/example/GraphClientSimpleExample.py +++ b/example/GraphClientSimpleExample.py @@ -6,10 +6,8 @@ # This source code is licensed under Apache 2.0 License, # attached with Common Clause Condition 1.0, found in the LICENSES directory. -import sys import time - from nebula2.gclient.net import ConnectionPool from nebula2.Config import Config from FormatResp import print_resp @@ -34,13 +32,23 @@ time.sleep(6) # insert vertex - resp = client.execute('INSERT VERTEX person(name, age) VALUES "Bob":("Bob", 10)') + resp = client.execute('INSERT VERTEX person(name, age) VALUES "Bob":("Bob", 10), "Lily":("Lily", 9)') + assert resp.is_succeeded(), resp.error_msg() + + # Insert edges + client.execute('INSERT EDGE like(likeness) VALUES "Bob"->"Lily":(80.0);') + assert resp.is_succeeded(), resp.error_msg() + assert resp.is_succeeded(), resp.error_msg() resp = client.execute('FETCH PROP ON person "Bob"') assert resp.is_succeeded(), resp.error_msg() print_resp(resp) + resp = client.execute('FETCH PROP ON like "Bob"->"Lily"') + assert resp.is_succeeded(), resp.error_msg() + print_resp(resp) + except Exception as x: import traceback print(traceback.format_exc()) diff --git a/setup.py b/setup.py index c1a47e3c..63b04d5d 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='nebula2-python', - version='2.0.0rc1', + version='2.0.0ga', license="Apache 2.0 + Common Clause 1.0", author='vesoft-inc', author_email='info@vesoft.com', @@ -18,10 +18,8 @@ url='https://github.com/vesoft-inc/nebula-python', install_requires=['httplib2', 'future', - 'six', - 'futures; python_version == "2.7"'], + 'six'], packages=find_packages(), - platforms=["2.7, 3.5, 3.7"], - package_dir={'nebula2': 'nebula2', - 'thirft': 'thirft'}, + platforms=["3.5, 3.7"], + package_dir={'nebula2': 'nebula2'}, ) From de7a17126f724f67d9150b1ebbc6933b7b2cd683 Mon Sep 17 00:00:00 2001 From: laura-ding <48548375+laura-ding@users.noreply.github.com> Date: Mon, 22 Mar 2021 11:00:44 +0800 Subject: [PATCH 3/3] update --- nebula2/common/constants.py | 6 +++--- nebula2/common/ttypes.py | 18 ++++++++-------- nebula2/graph/GraphService-fuzzer | 6 +++--- nebula2/graph/GraphService-remote | 6 +++--- nebula2/graph/GraphService.py | 22 ++++++++++---------- nebula2/graph/constants.py | 6 +++--- nebula2/graph/ttypes.py | 18 ++++++++-------- nebula2/meta/MetaService-fuzzer | 6 +++--- nebula2/meta/MetaService-remote | 6 +++--- nebula2/meta/MetaService.py | 22 ++++++++++---------- nebula2/meta/constants.py | 6 +++--- nebula2/meta/ttypes.py | 18 ++++++++-------- nebula2/storage/GeneralStorageService-fuzzer | 6 +++--- nebula2/storage/GeneralStorageService-remote | 6 +++--- nebula2/storage/GeneralStorageService.py | 22 ++++++++++---------- nebula2/storage/GraphStorageService-fuzzer | 6 +++--- nebula2/storage/GraphStorageService-remote | 6 +++--- nebula2/storage/GraphStorageService.py | 22 ++++++++++---------- nebula2/storage/StorageAdminService-fuzzer | 6 +++--- nebula2/storage/StorageAdminService-remote | 6 +++--- nebula2/storage/StorageAdminService.py | 22 ++++++++++---------- nebula2/storage/constants.py | 6 +++--- nebula2/storage/ttypes.py | 18 ++++++++-------- 23 files changed, 133 insertions(+), 133 deletions(-) diff --git a/nebula2/common/constants.py b/nebula2/common/constants.py index 32c91b20..bd42fa1f 100644 --- a/nebula2/common/constants.py +++ b/nebula2/common/constants.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException diff --git a/nebula2/common/ttypes.py b/nebula2/common/ttypes.py index 12079f58..9eae81ba 100644 --- a/nebula2/common/ttypes.py +++ b/nebula2/common/ttypes.py @@ -7,23 +7,23 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException import pprint import warnings -from thrift import Thrift -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.protocol import TCompactProtocol -from thrift.protocol import THeaderProtocol +from nebula2.fbthrift import Thrift +from nebula2.fbthrift.transport import TTransport +from nebula2.fbthrift.protocol import TBinaryProtocol +from nebula2.fbthrift.protocol import TCompactProtocol +from nebula2.fbthrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from thrift.protocol import fastproto + from nebula2.fbthrift.protocol import fastproto except: pass all_structs = [] diff --git a/nebula2/graph/GraphService-fuzzer b/nebula2/graph/GraphService-fuzzer index 1cea1e31..7e0b6880 100755 --- a/nebula2/graph/GraphService-fuzzer +++ b/nebula2/graph/GraphService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import GraphService from . import ttypes from . import constants -import thrift.util.fuzzer -thrift.util.fuzzer.fuzz_service(GraphService, ttypes, constants) +import nebula2.fbthrift.util.fuzzer +nebula2.fbthrift.util.fuzzer.fuzz_service(GraphService, ttypes, constants) diff --git a/nebula2/graph/GraphService-remote b/nebula2/graph/GraphService-remote index 932d85bc..3b02f3f2 100755 --- a/nebula2/graph/GraphService-remote +++ b/nebula2/graph/GraphService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import GraphService from . import ttypes -from thrift.util.remote import Function -from thrift.remote import Remote +from nebula2.fbthrift.util.remote import Function +from nebula2.fbthrift.remote import Remote FUNCTIONS = { 'authenticate': Function('authenticate', 'GraphService', 'AuthResponse', [('string', 'username', 'string'), ('string', 'password', 'string')]), diff --git a/nebula2/graph/GraphService.py b/nebula2/graph/GraphService.py index 77aad5fa..43248deb 100644 --- a/nebula2/graph/GraphService.py +++ b/nebula2/graph/GraphService.py @@ -7,33 +7,33 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes -from thrift.Thrift import TProcessor +from nebula2.fbthrift.Thrift import TProcessor import pprint import warnings -from thrift import Thrift -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.protocol import TCompactProtocol -from thrift.protocol import THeaderProtocol +from nebula2.fbthrift import Thrift +from nebula2.fbthrift.transport import TTransport +from nebula2.fbthrift.protocol import TBinaryProtocol +from nebula2.fbthrift.protocol import TCompactProtocol +from nebula2.fbthrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from thrift.protocol import fastproto + from nebula2.fbthrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from thrift.util.Decorators import * +from nebula2.fbthrift.util.Decorators import * class Iface: def authenticate(self, username=None, password=None): diff --git a/nebula2/graph/constants.py b/nebula2/graph/constants.py index e240e123..19858098 100644 --- a/nebula2/graph/constants.py +++ b/nebula2/graph/constants.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes diff --git a/nebula2/graph/ttypes.py b/nebula2/graph/ttypes.py index d21e62e9..d652d345 100644 --- a/nebula2/graph/ttypes.py +++ b/nebula2/graph/ttypes.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes @@ -17,15 +17,15 @@ import pprint import warnings -from thrift import Thrift -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.protocol import TCompactProtocol -from thrift.protocol import THeaderProtocol +from nebula2.fbthrift import Thrift +from nebula2.fbthrift.transport import TTransport +from nebula2.fbthrift.protocol import TBinaryProtocol +from nebula2.fbthrift.protocol import TCompactProtocol +from nebula2.fbthrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from thrift.protocol import fastproto + from nebula2.fbthrift.protocol import fastproto except: pass all_structs = [] diff --git a/nebula2/meta/MetaService-fuzzer b/nebula2/meta/MetaService-fuzzer index 1a24bc63..d760c6ca 100755 --- a/nebula2/meta/MetaService-fuzzer +++ b/nebula2/meta/MetaService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import MetaService from . import ttypes from . import constants -import thrift.util.fuzzer -thrift.util.fuzzer.fuzz_service(MetaService, ttypes, constants) +import nebula2.fbthrift.util.fuzzer +nebula2.fbthrift.util.fuzzer.fuzz_service(MetaService, ttypes, constants) diff --git a/nebula2/meta/MetaService-remote b/nebula2/meta/MetaService-remote index 97b5d203..3b1ab2c1 100755 --- a/nebula2/meta/MetaService-remote +++ b/nebula2/meta/MetaService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import MetaService from . import ttypes -from thrift.util.remote import Function -from thrift.remote import Remote +from nebula2.fbthrift.util.remote import Function +from nebula2.fbthrift.remote import Remote FUNCTIONS = { 'createSpace': Function('createSpace', 'MetaService', 'ExecResp', [('CreateSpaceReq', 'req', 'CreateSpaceReq')]), diff --git a/nebula2/meta/MetaService.py b/nebula2/meta/MetaService.py index e810ba43..dfe9a52e 100644 --- a/nebula2/meta/MetaService.py +++ b/nebula2/meta/MetaService.py @@ -7,33 +7,33 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes -from thrift.Thrift import TProcessor +from nebula2.fbthrift.Thrift import TProcessor import pprint import warnings -from thrift import Thrift -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.protocol import TCompactProtocol -from thrift.protocol import THeaderProtocol +from nebula2.fbthrift import Thrift +from nebula2.fbthrift.transport import TTransport +from nebula2.fbthrift.protocol import TBinaryProtocol +from nebula2.fbthrift.protocol import TCompactProtocol +from nebula2.fbthrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from thrift.protocol import fastproto + from nebula2.fbthrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from thrift.util.Decorators import * +from nebula2.fbthrift.util.Decorators import * class Iface: def createSpace(self, req=None): diff --git a/nebula2/meta/constants.py b/nebula2/meta/constants.py index e240e123..19858098 100644 --- a/nebula2/meta/constants.py +++ b/nebula2/meta/constants.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes diff --git a/nebula2/meta/ttypes.py b/nebula2/meta/ttypes.py index e849b1b1..8c378605 100644 --- a/nebula2/meta/ttypes.py +++ b/nebula2/meta/ttypes.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes @@ -17,15 +17,15 @@ import pprint import warnings -from thrift import Thrift -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.protocol import TCompactProtocol -from thrift.protocol import THeaderProtocol +from nebula2.fbthrift import Thrift +from nebula2.fbthrift.transport import TTransport +from nebula2.fbthrift.protocol import TBinaryProtocol +from nebula2.fbthrift.protocol import TCompactProtocol +from nebula2.fbthrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from thrift.protocol import fastproto + from nebula2.fbthrift.protocol import fastproto except: pass all_structs = [] diff --git a/nebula2/storage/GeneralStorageService-fuzzer b/nebula2/storage/GeneralStorageService-fuzzer index 906f2074..3ecdc7e5 100755 --- a/nebula2/storage/GeneralStorageService-fuzzer +++ b/nebula2/storage/GeneralStorageService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import GeneralStorageService from . import ttypes from . import constants -import thrift.util.fuzzer -thrift.util.fuzzer.fuzz_service(GeneralStorageService, ttypes, constants) +import nebula2.fbthrift.util.fuzzer +nebula2.fbthrift.util.fuzzer.fuzz_service(GeneralStorageService, ttypes, constants) diff --git a/nebula2/storage/GeneralStorageService-remote b/nebula2/storage/GeneralStorageService-remote index bf0ab367..8d6a7eaa 100755 --- a/nebula2/storage/GeneralStorageService-remote +++ b/nebula2/storage/GeneralStorageService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import GeneralStorageService from . import ttypes -from thrift.util.remote import Function -from thrift.remote import Remote +from nebula2.fbthrift.util.remote import Function +from nebula2.fbthrift.remote import Remote FUNCTIONS = { 'get': Function('get', 'GeneralStorageService', 'KVGetResponse', [('KVGetRequest', 'req', 'KVGetRequest')]), diff --git a/nebula2/storage/GeneralStorageService.py b/nebula2/storage/GeneralStorageService.py index a082cc3a..5171a4b2 100644 --- a/nebula2/storage/GeneralStorageService.py +++ b/nebula2/storage/GeneralStorageService.py @@ -7,34 +7,34 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes import nebula2.meta.ttypes -from thrift.Thrift import TProcessor +from nebula2.fbthrift.Thrift import TProcessor import pprint import warnings -from thrift import Thrift -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.protocol import TCompactProtocol -from thrift.protocol import THeaderProtocol +from nebula2.fbthrift import Thrift +from nebula2.fbthrift.transport import TTransport +from nebula2.fbthrift.protocol import TBinaryProtocol +from nebula2.fbthrift.protocol import TCompactProtocol +from nebula2.fbthrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from thrift.protocol import fastproto + from nebula2.fbthrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from thrift.util.Decorators import * +from nebula2.fbthrift.util.Decorators import * class Iface: def get(self, req=None): diff --git a/nebula2/storage/GraphStorageService-fuzzer b/nebula2/storage/GraphStorageService-fuzzer index 85bc3025..d47897b9 100755 --- a/nebula2/storage/GraphStorageService-fuzzer +++ b/nebula2/storage/GraphStorageService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import GraphStorageService from . import ttypes from . import constants -import thrift.util.fuzzer -thrift.util.fuzzer.fuzz_service(GraphStorageService, ttypes, constants) +import nebula2.fbthrift.util.fuzzer +nebula2.fbthrift.util.fuzzer.fuzz_service(GraphStorageService, ttypes, constants) diff --git a/nebula2/storage/GraphStorageService-remote b/nebula2/storage/GraphStorageService-remote index 3f97cd80..f060ff2b 100755 --- a/nebula2/storage/GraphStorageService-remote +++ b/nebula2/storage/GraphStorageService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import GraphStorageService from . import ttypes -from thrift.util.remote import Function -from thrift.remote import Remote +from nebula2.fbthrift.util.remote import Function +from nebula2.fbthrift.remote import Remote FUNCTIONS = { 'getNeighbors': Function('getNeighbors', 'GraphStorageService', 'GetNeighborsResponse', [('GetNeighborsRequest', 'req', 'GetNeighborsRequest')]), diff --git a/nebula2/storage/GraphStorageService.py b/nebula2/storage/GraphStorageService.py index 22f3f4d6..56e6125b 100644 --- a/nebula2/storage/GraphStorageService.py +++ b/nebula2/storage/GraphStorageService.py @@ -7,34 +7,34 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes import nebula2.meta.ttypes -from thrift.Thrift import TProcessor +from nebula2.fbthrift.Thrift import TProcessor import pprint import warnings -from thrift import Thrift -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.protocol import TCompactProtocol -from thrift.protocol import THeaderProtocol +from nebula2.fbthrift import Thrift +from nebula2.fbthrift.transport import TTransport +from nebula2.fbthrift.protocol import TBinaryProtocol +from nebula2.fbthrift.protocol import TCompactProtocol +from nebula2.fbthrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from thrift.protocol import fastproto + from nebula2.fbthrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from thrift.util.Decorators import * +from nebula2.fbthrift.util.Decorators import * class Iface: def getNeighbors(self, req=None): diff --git a/nebula2/storage/StorageAdminService-fuzzer b/nebula2/storage/StorageAdminService-fuzzer index 27bddbb8..c0b7396a 100755 --- a/nebula2/storage/StorageAdminService-fuzzer +++ b/nebula2/storage/StorageAdminService-fuzzer @@ -30,7 +30,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-fuzzer.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-fuzzer.par. For more information, please read @@ -41,5 +41,5 @@ from . import StorageAdminService from . import ttypes from . import constants -import thrift.util.fuzzer -thrift.util.fuzzer.fuzz_service(StorageAdminService, ttypes, constants) +import nebula2.fbthrift.util.fuzzer +nebula2.fbthrift.util.fuzzer.fuzz_service(StorageAdminService, ttypes, constants) diff --git a/nebula2/storage/StorageAdminService-remote b/nebula2/storage/StorageAdminService-remote index c8d4817e..c17b5672 100755 --- a/nebula2/storage/StorageAdminService-remote +++ b/nebula2/storage/StorageAdminService-remote @@ -28,7 +28,7 @@ if (not sys.argv[0].endswith("par") and print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. - Instead, you should generate your thrift file with + Instead, you should generate your fbthrift file with thrift_library and then run the resulting *-remote.par. For more information, please read @@ -38,8 +38,8 @@ if (not sys.argv[0].endswith("par") and from . import StorageAdminService from . import ttypes -from thrift.util.remote import Function -from thrift.remote import Remote +from nebula2.fbthrift.util.remote import Function +from nebula2.fbthrift.remote import Remote FUNCTIONS = { 'transLeader': Function('transLeader', 'StorageAdminService', 'AdminExecResp', [('TransLeaderReq', 'req', 'TransLeaderReq')]), diff --git a/nebula2/storage/StorageAdminService.py b/nebula2/storage/StorageAdminService.py index 555ef136..01c652de 100644 --- a/nebula2/storage/StorageAdminService.py +++ b/nebula2/storage/StorageAdminService.py @@ -7,34 +7,34 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException from .ttypes import * import nebula2.common.ttypes import nebula2.meta.ttypes -from thrift.Thrift import TProcessor +from nebula2.fbthrift.Thrift import TProcessor import pprint import warnings -from thrift import Thrift -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.protocol import TCompactProtocol -from thrift.protocol import THeaderProtocol +from nebula2.fbthrift import Thrift +from nebula2.fbthrift.transport import TTransport +from nebula2.fbthrift.protocol import TBinaryProtocol +from nebula2.fbthrift.protocol import TCompactProtocol +from nebula2.fbthrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from thrift.protocol import fastproto + from nebula2.fbthrift.protocol import fastproto except: pass all_structs = [] UTF8STRINGS = bool(0) or sys.version_info.major >= 3 -from thrift.util.Decorators import * +from nebula2.fbthrift.util.Decorators import * class Iface: def transLeader(self, req=None): diff --git a/nebula2/storage/constants.py b/nebula2/storage/constants.py index 616feb6e..f162eb6c 100644 --- a/nebula2/storage/constants.py +++ b/nebula2/storage/constants.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes diff --git a/nebula2/storage/ttypes.py b/nebula2/storage/ttypes.py index 033de54a..f5a1166b 100644 --- a/nebula2/storage/ttypes.py +++ b/nebula2/storage/ttypes.py @@ -7,9 +7,9 @@ from __future__ import absolute_import import six -from thrift.util.Recursive import fix_spec -from thrift.Thrift import * -from thrift.protocol.TProtocol import TProtocolException +from nebula2.fbthrift.util.Recursive import fix_spec +from nebula2.fbthrift.Thrift import * +from nebula2.fbthrift.protocol.TProtocol import TProtocolException import nebula2.common.ttypes @@ -18,15 +18,15 @@ import pprint import warnings -from thrift import Thrift -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.protocol import TCompactProtocol -from thrift.protocol import THeaderProtocol +from nebula2.fbthrift import Thrift +from nebula2.fbthrift.transport import TTransport +from nebula2.fbthrift.protocol import TBinaryProtocol +from nebula2.fbthrift.protocol import TCompactProtocol +from nebula2.fbthrift.protocol import THeaderProtocol fastproto = None if not '__pypy__' in sys.builtin_module_names: try: - from thrift.protocol import fastproto + from nebula2.fbthrift.protocol import fastproto except: pass all_structs = []