From e30332957dfa1b9ab1fed4d7dddff02880a37187 Mon Sep 17 00:00:00 2001 From: Tamer Eldeeb Date: Tue, 21 Feb 2017 16:01:10 -0800 Subject: [PATCH] Rename to cadence --- .gen/go/{minions => cadence}/constants.go | 2 +- .../tchan-cadence.go} | 4 +- .gen/go/{minions => cadence}/ttypes.go | 2 +- .../{minions => cadence}/workflowservice.go | 2 +- .gen/js/WorkflowService.js | 2 +- .../js/{minions_types.js => cadence_types.js} | 0 .../WorkflowService-remote | 4 +- .../{minions => cadence}/WorkflowService.py | 0 .gen/py/{minions => cadence}/__init__.py | 0 .gen/py/{minions => cadence}/constants.py | 0 .gen/py/{minions => cadence}/ttypes.py | 0 .gen/py/minions/HistoryService-remote | 136 -- .gen/py/minions/HistoryService.py | 1738 ----------------- .gen/py/minions/MatchingService-remote | 101 - .gen/py/minions/MatchingService.py | 519 ----- .gitignore | 8 +- Makefile | 10 +- client/frontend/client.go | 2 +- config/base.yaml | 13 - config/config.go | 33 - config/development.yaml | 24 - config/production.yaml | 13 - config/test.yaml | 1 - glide.yaml | 2 +- .../{minions.thrift => cadence.thrift} | 2 +- idl/github.com/uber/cadence/history.thrift | 2 +- idl/github.com/uber/cadence/matching.thrift | 2 +- idl/github.com/uber/cadence/shared.thrift | 2 +- service/frontend/handler.go | 8 +- udeploy/pinocchio.yaml | 3 - udeploy/symlink_secrets | 1 - 31 files changed, 26 insertions(+), 2610 deletions(-) rename .gen/go/{minions => cadence}/constants.go (96%) rename .gen/go/{minions/tchan-minions.go => cadence/tchan-cadence.go} (99%) rename .gen/go/{minions => cadence}/ttypes.go (96%) rename .gen/go/{minions => cadence}/workflowservice.go (99%) rename .gen/js/{minions_types.js => cadence_types.js} (100%) rename .gen/py/{minions => cadence}/WorkflowService-remote (98%) rename .gen/py/{minions => cadence}/WorkflowService.py (100%) rename .gen/py/{minions => cadence}/__init__.py (100%) rename .gen/py/{minions => cadence}/constants.py (100%) rename .gen/py/{minions => cadence}/ttypes.py (100%) delete mode 100755 .gen/py/minions/HistoryService-remote delete mode 100644 .gen/py/minions/HistoryService.py delete mode 100755 .gen/py/minions/MatchingService-remote delete mode 100644 .gen/py/minions/MatchingService.py delete mode 100644 config/base.yaml delete mode 100644 config/config.go delete mode 100644 config/development.yaml delete mode 100644 config/production.yaml delete mode 100644 config/test.yaml rename idl/github.com/uber/cadence/{minions.thrift => cadence.thrift} (99%) delete mode 100644 udeploy/pinocchio.yaml delete mode 100644 udeploy/symlink_secrets diff --git a/.gen/go/minions/constants.go b/.gen/go/cadence/constants.go similarity index 96% rename from .gen/go/minions/constants.go rename to .gen/go/cadence/constants.go index f1f350d6bbb..d54e91a2e3c 100644 --- a/.gen/go/minions/constants.go +++ b/.gen/go/cadence/constants.go @@ -1,7 +1,7 @@ // Autogenerated by Thrift Compiler (1.0.0-dev) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -package minions +package cadence import ( "bytes" diff --git a/.gen/go/minions/tchan-minions.go b/.gen/go/cadence/tchan-cadence.go similarity index 99% rename from .gen/go/minions/tchan-minions.go rename to .gen/go/cadence/tchan-cadence.go index 1007d59ca4a..33b33710a0e 100644 --- a/.gen/go/minions/tchan-minions.go +++ b/.gen/go/cadence/tchan-cadence.go @@ -1,7 +1,7 @@ // @generated Code generated by thrift-gen. Do not modify. -// Package minions is generated code used to make or handle TChannel calls using Thrift. -package minions +// Package cadence is generated code used to make or handle TChannel calls using Thrift. +package cadence import ( "fmt" diff --git a/.gen/go/minions/ttypes.go b/.gen/go/cadence/ttypes.go similarity index 96% rename from .gen/go/minions/ttypes.go rename to .gen/go/cadence/ttypes.go index d0c01516be7..31d437366f8 100644 --- a/.gen/go/minions/ttypes.go +++ b/.gen/go/cadence/ttypes.go @@ -1,7 +1,7 @@ // Autogenerated by Thrift Compiler (1.0.0-dev) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -package minions +package cadence import ( "bytes" diff --git a/.gen/go/minions/workflowservice.go b/.gen/go/cadence/workflowservice.go similarity index 99% rename from .gen/go/minions/workflowservice.go rename to .gen/go/cadence/workflowservice.go index 6c983b174df..36ba5617306 100644 --- a/.gen/go/minions/workflowservice.go +++ b/.gen/go/cadence/workflowservice.go @@ -1,7 +1,7 @@ // Autogenerated by Thrift Compiler (1.0.0-dev) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -package minions +package cadence import ( "bytes" diff --git a/.gen/js/WorkflowService.js b/.gen/js/WorkflowService.js index ccd88a0bc73..563f0545d4c 100644 --- a/.gen/js/WorkflowService.js +++ b/.gen/js/WorkflowService.js @@ -10,7 +10,7 @@ var Q = thrift.Q; var shared_ttypes = require('./shared_types'); -var ttypes = require('./minions_types'); +var ttypes = require('./cadence_types'); //HELPER FUNCTIONS AND STRUCTURES var WorkflowService_StartWorkflowExecution_args = function(args) { diff --git a/.gen/js/minions_types.js b/.gen/js/cadence_types.js similarity index 100% rename from .gen/js/minions_types.js rename to .gen/js/cadence_types.js diff --git a/.gen/py/minions/WorkflowService-remote b/.gen/py/cadence/WorkflowService-remote similarity index 98% rename from .gen/py/minions/WorkflowService-remote rename to .gen/py/cadence/WorkflowService-remote index 961ee3d72fb..95cefaca813 100755 --- a/.gen/py/minions/WorkflowService-remote +++ b/.gen/py/cadence/WorkflowService-remote @@ -16,8 +16,8 @@ from thrift.transport import TSSLSocket from thrift.transport import THttpClient from thrift.protocol import TBinaryProtocol -from minions import WorkflowService -from minions.ttypes import * +from cadence import WorkflowService +from cadence.ttypes import * if len(sys.argv) <= 1 or sys.argv[1] == '--help': print('') diff --git a/.gen/py/minions/WorkflowService.py b/.gen/py/cadence/WorkflowService.py similarity index 100% rename from .gen/py/minions/WorkflowService.py rename to .gen/py/cadence/WorkflowService.py diff --git a/.gen/py/minions/__init__.py b/.gen/py/cadence/__init__.py similarity index 100% rename from .gen/py/minions/__init__.py rename to .gen/py/cadence/__init__.py diff --git a/.gen/py/minions/constants.py b/.gen/py/cadence/constants.py similarity index 100% rename from .gen/py/minions/constants.py rename to .gen/py/cadence/constants.py diff --git a/.gen/py/minions/ttypes.py b/.gen/py/cadence/ttypes.py similarity index 100% rename from .gen/py/minions/ttypes.py rename to .gen/py/cadence/ttypes.py diff --git a/.gen/py/minions/HistoryService-remote b/.gen/py/minions/HistoryService-remote deleted file mode 100755 index dd2b5f4ffa3..00000000000 --- a/.gen/py/minions/HistoryService-remote +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python -# -# Autogenerated by Thrift Compiler (0.9.2) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py:utf8strings -# - -import sys -import pprint -from urlparse import urlparse -from thrift.transport import TTransport -from thrift.transport import TSocket -from thrift.transport import TSSLSocket -from thrift.transport import THttpClient -from thrift.protocol import TBinaryProtocol - -from minions import HistoryService -from minions.ttypes import * - -if len(sys.argv) <= 1 or sys.argv[1] == '--help': - print('') - print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] function [arg1 [arg2...]]') - print('') - print('Functions:') - print(' StartWorkflowExecutionResponse StartWorkflowExecution(StartWorkflowExecutionRequest startRequest)') - print(' AddDecisionTaskStartedEventResponse AddDecisionTaskStartedEvent(AddDecisionTaskStartedEventRequest addRequest)') - print(' AddActivityTaskStartedEventResponse AddActivityTaskStartedEvent(AddActivityTaskStartedEventRequest addRequest)') - print(' void RespondDecisionTaskCompleted(RespondDecisionTaskCompletedRequest completeRequest)') - print(' RecordActivityTaskHeartbeatResponse RecordActivityTaskHeartbeat(RecordActivityTaskHeartbeatRequest heartbeatRequest)') - print(' void RespondActivityTaskCompleted(RespondActivityTaskCompletedRequest completeRequest)') - print(' void RespondActivityTaskFailed(RespondActivityTaskFailedRequest failRequest)') - print('') - sys.exit(0) - -pp = pprint.PrettyPrinter(indent = 2) -host = 'localhost' -port = 9090 -uri = '' -framed = False -ssl = False -http = False -argi = 1 - -if sys.argv[argi] == '-h': - parts = sys.argv[argi+1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - argi += 2 - -if sys.argv[argi] == '-u': - url = urlparse(sys.argv[argi+1]) - parts = url[1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - else: - port = 80 - uri = url[2] - if url[4]: - uri += '?%s' % url[4] - http = True - argi += 2 - -if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': - framed = True - argi += 1 - -if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl': - ssl = True - argi += 1 - -cmd = sys.argv[argi] -args = sys.argv[argi+1:] - -if http: - transport = THttpClient.THttpClient(host, port, uri) -else: - socket = TSSLSocket.TSSLSocket(host, port, validate=False) if ssl else TSocket.TSocket(host, port) - if framed: - transport = TTransport.TFramedTransport(socket) - else: - transport = TTransport.TBufferedTransport(socket) -protocol = TBinaryProtocol.TBinaryProtocol(transport) -client = HistoryService.Client(protocol) -transport.open() - -if cmd == 'StartWorkflowExecution': - if len(args) != 1: - print('StartWorkflowExecution requires 1 args') - sys.exit(1) - pp.pprint(client.StartWorkflowExecution(eval(args[0]),)) - -elif cmd == 'AddDecisionTaskStartedEvent': - if len(args) != 1: - print('AddDecisionTaskStartedEvent requires 1 args') - sys.exit(1) - pp.pprint(client.AddDecisionTaskStartedEvent(eval(args[0]),)) - -elif cmd == 'AddActivityTaskStartedEvent': - if len(args) != 1: - print('AddActivityTaskStartedEvent requires 1 args') - sys.exit(1) - pp.pprint(client.AddActivityTaskStartedEvent(eval(args[0]),)) - -elif cmd == 'RespondDecisionTaskCompleted': - if len(args) != 1: - print('RespondDecisionTaskCompleted requires 1 args') - sys.exit(1) - pp.pprint(client.RespondDecisionTaskCompleted(eval(args[0]),)) - -elif cmd == 'RecordActivityTaskHeartbeat': - if len(args) != 1: - print('RecordActivityTaskHeartbeat requires 1 args') - sys.exit(1) - pp.pprint(client.RecordActivityTaskHeartbeat(eval(args[0]),)) - -elif cmd == 'RespondActivityTaskCompleted': - if len(args) != 1: - print('RespondActivityTaskCompleted requires 1 args') - sys.exit(1) - pp.pprint(client.RespondActivityTaskCompleted(eval(args[0]),)) - -elif cmd == 'RespondActivityTaskFailed': - if len(args) != 1: - print('RespondActivityTaskFailed requires 1 args') - sys.exit(1) - pp.pprint(client.RespondActivityTaskFailed(eval(args[0]),)) - -else: - print('Unrecognized method %s' % cmd) - sys.exit(1) - -transport.close() diff --git a/.gen/py/minions/HistoryService.py b/.gen/py/minions/HistoryService.py deleted file mode 100644 index 4db26c1a4af..00000000000 --- a/.gen/py/minions/HistoryService.py +++ /dev/null @@ -1,1738 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.9.2) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py:utf8strings -# - -from thrift.Thrift import TType, TMessageType, TException, TApplicationException -from ttypes import * -from thrift.Thrift import TProcessor -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol, TProtocol -try: - from thrift.protocol import fastbinary -except: - fastbinary = None - - -class Iface: - """ - HistoryService provides API to start a new long running workflow instance, as well as query and update the history - of workflow instances already created. - - """ - def StartWorkflowExecution(self, startRequest): - """ - StartWorkflowExecution starts a new long running workflow instance. It will create the instance with - 'WorkflowExecutionStarted' event in history and also schedule the first DecisionTask for the worker to make the - first decision for this instance. It will return 'WorkflowExecutionAlreadyStartedError', if an instance already - exists with same workflowId. - - - Parameters: - - startRequest - """ - pass - - def AddDecisionTaskStartedEvent(self, addRequest): - """ - AddDecisionTaskStartedEvent is called by the Matchingservice before it hands a decision task to the application worker in response to - a PollForDecisionTask call. It records in the history the event that the decision task has started. It will return 'EventAlreadyStartedError', - if the workflow's execution history already includes a record of the event starting. - - - Parameters: - - addRequest - """ - pass - - def AddActivityTaskStartedEvent(self, addRequest): - """ - AddActivityTaskStartedEvent is called by the Matchingservice before it hands a decision task to the application worker in response to - a PollForActivityTask call. It records in the history the event that the decision task has started. It will return 'EventAlreadyStartedError', - if the workflow's execution history already includes a record of the event starting. - - - Parameters: - - addRequest - """ - pass - - def RespondDecisionTaskCompleted(self, completeRequest): - """ - RespondDecisionTaskCompleted is called by application worker to complete a DecisionTask handed as a result of - 'PollForDecisionTask' API call. Completing a DecisionTask will result in new events for the workflow execution and - potentially new ActivityTask being created for corresponding decisions. It will also create a DecisionTaskCompleted - event in the history for that session. Use the 'taskToken' provided as response of PollForDecisionTask API call - for completing the DecisionTask. - - - Parameters: - - completeRequest - """ - pass - - def RecordActivityTaskHeartbeat(self, heartbeatRequest): - """ - RecordActivityTaskHeartbeat is called by application worker while it is processing an ActivityTask. If worker fails - to heartbeat within 'heartbeatTimeoutSeconds' interval for the ActivityTask, then it will be marked as timedout and - 'ActivityTaskTimedOut' event will be written to the workflow history. Calling 'RecordActivityTaskHeartbeat' will - fail with 'EntityNotExistsError' in such situations. Use the 'taskToken' provided as response of - PollForActivityTask API call for heartbeating. - - - Parameters: - - heartbeatRequest - """ - pass - - def RespondActivityTaskCompleted(self, completeRequest): - """ - RespondActivityTaskCompleted is called by application worker when it is done processing an ActivityTask. It will - result in a new 'ActivityTaskCompleted' event being written to the workflow history and a new DecisionTask - created for the workflow so new decisions could be made. Use the 'taskToken' provided as response of - PollForActivityTask API call for completion. It fails with 'EntityNotExistsError' if the taskToken is not valid - anymore due to activity timeout. - - - Parameters: - - completeRequest - """ - pass - - def RespondActivityTaskFailed(self, failRequest): - """ - RespondActivityTaskFailed is called by application worker when it is done processing an ActivityTask. It will - result in a new 'ActivityTaskFailed' event being written to the workflow history and a new DecisionTask - created for the workflow instance so new decisions could be made. Use the 'taskToken' provided as response of - PollForActivityTask API call for completion. It fails with 'EntityNotExistsError' if the taskToken is not valid - anymore due to activity timeout. - - - Parameters: - - failRequest - """ - pass - - -class Client(Iface): - """ - HistoryService provides API to start a new long running workflow instance, as well as query and update the history - of workflow instances already created. - - """ - def __init__(self, iprot, oprot=None): - self._iprot = self._oprot = iprot - if oprot is not None: - self._oprot = oprot - self._seqid = 0 - - def StartWorkflowExecution(self, startRequest): - """ - StartWorkflowExecution starts a new long running workflow instance. It will create the instance with - 'WorkflowExecutionStarted' event in history and also schedule the first DecisionTask for the worker to make the - first decision for this instance. It will return 'WorkflowExecutionAlreadyStartedError', if an instance already - exists with same workflowId. - - - Parameters: - - startRequest - """ - self.send_StartWorkflowExecution(startRequest) - return self.recv_StartWorkflowExecution() - - def send_StartWorkflowExecution(self, startRequest): - self._oprot.writeMessageBegin('StartWorkflowExecution', TMessageType.CALL, self._seqid) - args = StartWorkflowExecution_args() - args.startRequest = startRequest - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_StartWorkflowExecution(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = StartWorkflowExecution_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.badRequestError is not None: - raise result.badRequestError - if result.internalServiceError is not None: - raise result.internalServiceError - if result.sessionAlreadyExistError is not None: - raise result.sessionAlreadyExistError - raise TApplicationException(TApplicationException.MISSING_RESULT, "StartWorkflowExecution failed: unknown result"); - - def AddDecisionTaskStartedEvent(self, addRequest): - """ - AddDecisionTaskStartedEvent is called by the Matchingservice before it hands a decision task to the application worker in response to - a PollForDecisionTask call. It records in the history the event that the decision task has started. It will return 'EventAlreadyStartedError', - if the workflow's execution history already includes a record of the event starting. - - - Parameters: - - addRequest - """ - self.send_AddDecisionTaskStartedEvent(addRequest) - return self.recv_AddDecisionTaskStartedEvent() - - def send_AddDecisionTaskStartedEvent(self, addRequest): - self._oprot.writeMessageBegin('AddDecisionTaskStartedEvent', TMessageType.CALL, self._seqid) - args = AddDecisionTaskStartedEvent_args() - args.addRequest = addRequest - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_AddDecisionTaskStartedEvent(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = AddDecisionTaskStartedEvent_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.badRequestError is not None: - raise result.badRequestError - if result.internalServiceError is not None: - raise result.internalServiceError - if result.eventAlreadyStartedError is not None: - raise result.eventAlreadyStartedError - raise TApplicationException(TApplicationException.MISSING_RESULT, "AddDecisionTaskStartedEvent failed: unknown result"); - - def AddActivityTaskStartedEvent(self, addRequest): - """ - AddActivityTaskStartedEvent is called by the Matchingservice before it hands a decision task to the application worker in response to - a PollForActivityTask call. It records in the history the event that the decision task has started. It will return 'EventAlreadyStartedError', - if the workflow's execution history already includes a record of the event starting. - - - Parameters: - - addRequest - """ - self.send_AddActivityTaskStartedEvent(addRequest) - return self.recv_AddActivityTaskStartedEvent() - - def send_AddActivityTaskStartedEvent(self, addRequest): - self._oprot.writeMessageBegin('AddActivityTaskStartedEvent', TMessageType.CALL, self._seqid) - args = AddActivityTaskStartedEvent_args() - args.addRequest = addRequest - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_AddActivityTaskStartedEvent(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = AddActivityTaskStartedEvent_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.badRequestError is not None: - raise result.badRequestError - if result.internalServiceError is not None: - raise result.internalServiceError - if result.eventAlreadyStartedError is not None: - raise result.eventAlreadyStartedError - raise TApplicationException(TApplicationException.MISSING_RESULT, "AddActivityTaskStartedEvent failed: unknown result"); - - def RespondDecisionTaskCompleted(self, completeRequest): - """ - RespondDecisionTaskCompleted is called by application worker to complete a DecisionTask handed as a result of - 'PollForDecisionTask' API call. Completing a DecisionTask will result in new events for the workflow execution and - potentially new ActivityTask being created for corresponding decisions. It will also create a DecisionTaskCompleted - event in the history for that session. Use the 'taskToken' provided as response of PollForDecisionTask API call - for completing the DecisionTask. - - - Parameters: - - completeRequest - """ - self.send_RespondDecisionTaskCompleted(completeRequest) - self.recv_RespondDecisionTaskCompleted() - - def send_RespondDecisionTaskCompleted(self, completeRequest): - self._oprot.writeMessageBegin('RespondDecisionTaskCompleted', TMessageType.CALL, self._seqid) - args = RespondDecisionTaskCompleted_args() - args.completeRequest = completeRequest - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_RespondDecisionTaskCompleted(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = RespondDecisionTaskCompleted_result() - result.read(iprot) - iprot.readMessageEnd() - if result.badRequestError is not None: - raise result.badRequestError - if result.internalServiceError is not None: - raise result.internalServiceError - return - - def RecordActivityTaskHeartbeat(self, heartbeatRequest): - """ - RecordActivityTaskHeartbeat is called by application worker while it is processing an ActivityTask. If worker fails - to heartbeat within 'heartbeatTimeoutSeconds' interval for the ActivityTask, then it will be marked as timedout and - 'ActivityTaskTimedOut' event will be written to the workflow history. Calling 'RecordActivityTaskHeartbeat' will - fail with 'EntityNotExistsError' in such situations. Use the 'taskToken' provided as response of - PollForActivityTask API call for heartbeating. - - - Parameters: - - heartbeatRequest - """ - self.send_RecordActivityTaskHeartbeat(heartbeatRequest) - return self.recv_RecordActivityTaskHeartbeat() - - def send_RecordActivityTaskHeartbeat(self, heartbeatRequest): - self._oprot.writeMessageBegin('RecordActivityTaskHeartbeat', TMessageType.CALL, self._seqid) - args = RecordActivityTaskHeartbeat_args() - args.heartbeatRequest = heartbeatRequest - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_RecordActivityTaskHeartbeat(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = RecordActivityTaskHeartbeat_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.badRequestError is not None: - raise result.badRequestError - if result.internalServiceError is not None: - raise result.internalServiceError - if result.entityNotExistError is not None: - raise result.entityNotExistError - raise TApplicationException(TApplicationException.MISSING_RESULT, "RecordActivityTaskHeartbeat failed: unknown result"); - - def RespondActivityTaskCompleted(self, completeRequest): - """ - RespondActivityTaskCompleted is called by application worker when it is done processing an ActivityTask. It will - result in a new 'ActivityTaskCompleted' event being written to the workflow history and a new DecisionTask - created for the workflow so new decisions could be made. Use the 'taskToken' provided as response of - PollForActivityTask API call for completion. It fails with 'EntityNotExistsError' if the taskToken is not valid - anymore due to activity timeout. - - - Parameters: - - completeRequest - """ - self.send_RespondActivityTaskCompleted(completeRequest) - self.recv_RespondActivityTaskCompleted() - - def send_RespondActivityTaskCompleted(self, completeRequest): - self._oprot.writeMessageBegin('RespondActivityTaskCompleted', TMessageType.CALL, self._seqid) - args = RespondActivityTaskCompleted_args() - args.completeRequest = completeRequest - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_RespondActivityTaskCompleted(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = RespondActivityTaskCompleted_result() - result.read(iprot) - iprot.readMessageEnd() - if result.badRequestError is not None: - raise result.badRequestError - if result.internalServiceError is not None: - raise result.internalServiceError - if result.entityNotExistError is not None: - raise result.entityNotExistError - return - - def RespondActivityTaskFailed(self, failRequest): - """ - RespondActivityTaskFailed is called by application worker when it is done processing an ActivityTask. It will - result in a new 'ActivityTaskFailed' event being written to the workflow history and a new DecisionTask - created for the workflow instance so new decisions could be made. Use the 'taskToken' provided as response of - PollForActivityTask API call for completion. It fails with 'EntityNotExistsError' if the taskToken is not valid - anymore due to activity timeout. - - - Parameters: - - failRequest - """ - self.send_RespondActivityTaskFailed(failRequest) - self.recv_RespondActivityTaskFailed() - - def send_RespondActivityTaskFailed(self, failRequest): - self._oprot.writeMessageBegin('RespondActivityTaskFailed', TMessageType.CALL, self._seqid) - args = RespondActivityTaskFailed_args() - args.failRequest = failRequest - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_RespondActivityTaskFailed(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = RespondActivityTaskFailed_result() - result.read(iprot) - iprot.readMessageEnd() - if result.badRequestError is not None: - raise result.badRequestError - if result.internalServiceError is not None: - raise result.internalServiceError - if result.entityNotExistError is not None: - raise result.entityNotExistError - return - - -class Processor(Iface, TProcessor): - def __init__(self, handler): - self._handler = handler - self._processMap = {} - self._processMap["StartWorkflowExecution"] = Processor.process_StartWorkflowExecution - self._processMap["AddDecisionTaskStartedEvent"] = Processor.process_AddDecisionTaskStartedEvent - self._processMap["AddActivityTaskStartedEvent"] = Processor.process_AddActivityTaskStartedEvent - self._processMap["RespondDecisionTaskCompleted"] = Processor.process_RespondDecisionTaskCompleted - self._processMap["RecordActivityTaskHeartbeat"] = Processor.process_RecordActivityTaskHeartbeat - self._processMap["RespondActivityTaskCompleted"] = Processor.process_RespondActivityTaskCompleted - self._processMap["RespondActivityTaskFailed"] = Processor.process_RespondActivityTaskFailed - - def process(self, iprot, oprot): - (name, type, seqid) = iprot.readMessageBegin() - if name not in self._processMap: - iprot.skip(TType.STRUCT) - iprot.readMessageEnd() - x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) - oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) - x.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - return - else: - self._processMap[name](self, seqid, iprot, oprot) - return True - - def process_StartWorkflowExecution(self, seqid, iprot, oprot): - args = StartWorkflowExecution_args() - args.read(iprot) - iprot.readMessageEnd() - result = StartWorkflowExecution_result() - try: - result.success = self._handler.StartWorkflowExecution(args.startRequest) - except BadRequestError, badRequestError: - result.badRequestError = badRequestError - except InternalServiceError, internalServiceError: - result.internalServiceError = internalServiceError - except WorkflowExecutionAlreadyStartedError, sessionAlreadyExistError: - result.sessionAlreadyExistError = sessionAlreadyExistError - oprot.writeMessageBegin("StartWorkflowExecution", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_AddDecisionTaskStartedEvent(self, seqid, iprot, oprot): - args = AddDecisionTaskStartedEvent_args() - args.read(iprot) - iprot.readMessageEnd() - result = AddDecisionTaskStartedEvent_result() - try: - result.success = self._handler.AddDecisionTaskStartedEvent(args.addRequest) - except BadRequestError, badRequestError: - result.badRequestError = badRequestError - except InternalServiceError, internalServiceError: - result.internalServiceError = internalServiceError - except EventAlreadyStartedError, eventAlreadyStartedError: - result.eventAlreadyStartedError = eventAlreadyStartedError - oprot.writeMessageBegin("AddDecisionTaskStartedEvent", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_AddActivityTaskStartedEvent(self, seqid, iprot, oprot): - args = AddActivityTaskStartedEvent_args() - args.read(iprot) - iprot.readMessageEnd() - result = AddActivityTaskStartedEvent_result() - try: - result.success = self._handler.AddActivityTaskStartedEvent(args.addRequest) - except BadRequestError, badRequestError: - result.badRequestError = badRequestError - except InternalServiceError, internalServiceError: - result.internalServiceError = internalServiceError - except EventAlreadyStartedError, eventAlreadyStartedError: - result.eventAlreadyStartedError = eventAlreadyStartedError - oprot.writeMessageBegin("AddActivityTaskStartedEvent", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_RespondDecisionTaskCompleted(self, seqid, iprot, oprot): - args = RespondDecisionTaskCompleted_args() - args.read(iprot) - iprot.readMessageEnd() - result = RespondDecisionTaskCompleted_result() - try: - self._handler.RespondDecisionTaskCompleted(args.completeRequest) - except BadRequestError, badRequestError: - result.badRequestError = badRequestError - except InternalServiceError, internalServiceError: - result.internalServiceError = internalServiceError - oprot.writeMessageBegin("RespondDecisionTaskCompleted", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_RecordActivityTaskHeartbeat(self, seqid, iprot, oprot): - args = RecordActivityTaskHeartbeat_args() - args.read(iprot) - iprot.readMessageEnd() - result = RecordActivityTaskHeartbeat_result() - try: - result.success = self._handler.RecordActivityTaskHeartbeat(args.heartbeatRequest) - except BadRequestError, badRequestError: - result.badRequestError = badRequestError - except InternalServiceError, internalServiceError: - result.internalServiceError = internalServiceError - except EntityNotExistsError, entityNotExistError: - result.entityNotExistError = entityNotExistError - oprot.writeMessageBegin("RecordActivityTaskHeartbeat", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_RespondActivityTaskCompleted(self, seqid, iprot, oprot): - args = RespondActivityTaskCompleted_args() - args.read(iprot) - iprot.readMessageEnd() - result = RespondActivityTaskCompleted_result() - try: - self._handler.RespondActivityTaskCompleted(args.completeRequest) - except BadRequestError, badRequestError: - result.badRequestError = badRequestError - except InternalServiceError, internalServiceError: - result.internalServiceError = internalServiceError - except EntityNotExistsError, entityNotExistError: - result.entityNotExistError = entityNotExistError - oprot.writeMessageBegin("RespondActivityTaskCompleted", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_RespondActivityTaskFailed(self, seqid, iprot, oprot): - args = RespondActivityTaskFailed_args() - args.read(iprot) - iprot.readMessageEnd() - result = RespondActivityTaskFailed_result() - try: - self._handler.RespondActivityTaskFailed(args.failRequest) - except BadRequestError, badRequestError: - result.badRequestError = badRequestError - except InternalServiceError, internalServiceError: - result.internalServiceError = internalServiceError - except EntityNotExistsError, entityNotExistError: - result.entityNotExistError = entityNotExistError - oprot.writeMessageBegin("RespondActivityTaskFailed", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - -# HELPER FUNCTIONS AND STRUCTURES - -class StartWorkflowExecution_args: - """ - Attributes: - - startRequest - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'startRequest', (StartWorkflowExecutionRequest, StartWorkflowExecutionRequest.thrift_spec), None, ), # 1 - ) - - def __init__(self, startRequest=None,): - self.startRequest = startRequest - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.startRequest = StartWorkflowExecutionRequest() - self.startRequest.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('StartWorkflowExecution_args') - if self.startRequest is not None: - oprot.writeFieldBegin('startRequest', TType.STRUCT, 1) - self.startRequest.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.startRequest) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class StartWorkflowExecution_result: - """ - Attributes: - - success - - badRequestError - - internalServiceError - - sessionAlreadyExistError - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (StartWorkflowExecutionResponse, StartWorkflowExecutionResponse.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'badRequestError', (BadRequestError, BadRequestError.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'internalServiceError', (InternalServiceError, InternalServiceError.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'sessionAlreadyExistError', (WorkflowExecutionAlreadyStartedError, WorkflowExecutionAlreadyStartedError.thrift_spec), None, ), # 3 - ) - - def __init__(self, success=None, badRequestError=None, internalServiceError=None, sessionAlreadyExistError=None,): - self.success = success - self.badRequestError = badRequestError - self.internalServiceError = internalServiceError - self.sessionAlreadyExistError = sessionAlreadyExistError - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = StartWorkflowExecutionResponse() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.badRequestError = BadRequestError() - self.badRequestError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.internalServiceError = InternalServiceError() - self.internalServiceError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.sessionAlreadyExistError = WorkflowExecutionAlreadyStartedError() - self.sessionAlreadyExistError.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('StartWorkflowExecution_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.badRequestError is not None: - oprot.writeFieldBegin('badRequestError', TType.STRUCT, 1) - self.badRequestError.write(oprot) - oprot.writeFieldEnd() - if self.internalServiceError is not None: - oprot.writeFieldBegin('internalServiceError', TType.STRUCT, 2) - self.internalServiceError.write(oprot) - oprot.writeFieldEnd() - if self.sessionAlreadyExistError is not None: - oprot.writeFieldBegin('sessionAlreadyExistError', TType.STRUCT, 3) - self.sessionAlreadyExistError.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.success) - value = (value * 31) ^ hash(self.badRequestError) - value = (value * 31) ^ hash(self.internalServiceError) - value = (value * 31) ^ hash(self.sessionAlreadyExistError) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class AddDecisionTaskStartedEvent_args: - """ - Attributes: - - addRequest - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'addRequest', (AddDecisionTaskStartedEventRequest, AddDecisionTaskStartedEventRequest.thrift_spec), None, ), # 1 - ) - - def __init__(self, addRequest=None,): - self.addRequest = addRequest - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.addRequest = AddDecisionTaskStartedEventRequest() - self.addRequest.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('AddDecisionTaskStartedEvent_args') - if self.addRequest is not None: - oprot.writeFieldBegin('addRequest', TType.STRUCT, 1) - self.addRequest.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.addRequest) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class AddDecisionTaskStartedEvent_result: - """ - Attributes: - - success - - badRequestError - - internalServiceError - - eventAlreadyStartedError - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (AddDecisionTaskStartedEventResponse, AddDecisionTaskStartedEventResponse.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'badRequestError', (BadRequestError, BadRequestError.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'internalServiceError', (InternalServiceError, InternalServiceError.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'eventAlreadyStartedError', (EventAlreadyStartedError, EventAlreadyStartedError.thrift_spec), None, ), # 3 - ) - - def __init__(self, success=None, badRequestError=None, internalServiceError=None, eventAlreadyStartedError=None,): - self.success = success - self.badRequestError = badRequestError - self.internalServiceError = internalServiceError - self.eventAlreadyStartedError = eventAlreadyStartedError - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = AddDecisionTaskStartedEventResponse() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.badRequestError = BadRequestError() - self.badRequestError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.internalServiceError = InternalServiceError() - self.internalServiceError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.eventAlreadyStartedError = EventAlreadyStartedError() - self.eventAlreadyStartedError.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('AddDecisionTaskStartedEvent_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.badRequestError is not None: - oprot.writeFieldBegin('badRequestError', TType.STRUCT, 1) - self.badRequestError.write(oprot) - oprot.writeFieldEnd() - if self.internalServiceError is not None: - oprot.writeFieldBegin('internalServiceError', TType.STRUCT, 2) - self.internalServiceError.write(oprot) - oprot.writeFieldEnd() - if self.eventAlreadyStartedError is not None: - oprot.writeFieldBegin('eventAlreadyStartedError', TType.STRUCT, 3) - self.eventAlreadyStartedError.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.success) - value = (value * 31) ^ hash(self.badRequestError) - value = (value * 31) ^ hash(self.internalServiceError) - value = (value * 31) ^ hash(self.eventAlreadyStartedError) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class AddActivityTaskStartedEvent_args: - """ - Attributes: - - addRequest - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'addRequest', (AddActivityTaskStartedEventRequest, AddActivityTaskStartedEventRequest.thrift_spec), None, ), # 1 - ) - - def __init__(self, addRequest=None,): - self.addRequest = addRequest - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.addRequest = AddActivityTaskStartedEventRequest() - self.addRequest.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('AddActivityTaskStartedEvent_args') - if self.addRequest is not None: - oprot.writeFieldBegin('addRequest', TType.STRUCT, 1) - self.addRequest.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.addRequest) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class AddActivityTaskStartedEvent_result: - """ - Attributes: - - success - - badRequestError - - internalServiceError - - eventAlreadyStartedError - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (AddActivityTaskStartedEventResponse, AddActivityTaskStartedEventResponse.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'badRequestError', (BadRequestError, BadRequestError.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'internalServiceError', (InternalServiceError, InternalServiceError.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'eventAlreadyStartedError', (EventAlreadyStartedError, EventAlreadyStartedError.thrift_spec), None, ), # 3 - ) - - def __init__(self, success=None, badRequestError=None, internalServiceError=None, eventAlreadyStartedError=None,): - self.success = success - self.badRequestError = badRequestError - self.internalServiceError = internalServiceError - self.eventAlreadyStartedError = eventAlreadyStartedError - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = AddActivityTaskStartedEventResponse() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.badRequestError = BadRequestError() - self.badRequestError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.internalServiceError = InternalServiceError() - self.internalServiceError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.eventAlreadyStartedError = EventAlreadyStartedError() - self.eventAlreadyStartedError.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('AddActivityTaskStartedEvent_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.badRequestError is not None: - oprot.writeFieldBegin('badRequestError', TType.STRUCT, 1) - self.badRequestError.write(oprot) - oprot.writeFieldEnd() - if self.internalServiceError is not None: - oprot.writeFieldBegin('internalServiceError', TType.STRUCT, 2) - self.internalServiceError.write(oprot) - oprot.writeFieldEnd() - if self.eventAlreadyStartedError is not None: - oprot.writeFieldBegin('eventAlreadyStartedError', TType.STRUCT, 3) - self.eventAlreadyStartedError.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.success) - value = (value * 31) ^ hash(self.badRequestError) - value = (value * 31) ^ hash(self.internalServiceError) - value = (value * 31) ^ hash(self.eventAlreadyStartedError) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class RespondDecisionTaskCompleted_args: - """ - Attributes: - - completeRequest - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'completeRequest', (RespondDecisionTaskCompletedRequest, RespondDecisionTaskCompletedRequest.thrift_spec), None, ), # 1 - ) - - def __init__(self, completeRequest=None,): - self.completeRequest = completeRequest - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.completeRequest = RespondDecisionTaskCompletedRequest() - self.completeRequest.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('RespondDecisionTaskCompleted_args') - if self.completeRequest is not None: - oprot.writeFieldBegin('completeRequest', TType.STRUCT, 1) - self.completeRequest.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.completeRequest) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class RespondDecisionTaskCompleted_result: - """ - Attributes: - - badRequestError - - internalServiceError - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'badRequestError', (BadRequestError, BadRequestError.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'internalServiceError', (InternalServiceError, InternalServiceError.thrift_spec), None, ), # 2 - ) - - def __init__(self, badRequestError=None, internalServiceError=None,): - self.badRequestError = badRequestError - self.internalServiceError = internalServiceError - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.badRequestError = BadRequestError() - self.badRequestError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.internalServiceError = InternalServiceError() - self.internalServiceError.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('RespondDecisionTaskCompleted_result') - if self.badRequestError is not None: - oprot.writeFieldBegin('badRequestError', TType.STRUCT, 1) - self.badRequestError.write(oprot) - oprot.writeFieldEnd() - if self.internalServiceError is not None: - oprot.writeFieldBegin('internalServiceError', TType.STRUCT, 2) - self.internalServiceError.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.badRequestError) - value = (value * 31) ^ hash(self.internalServiceError) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class RecordActivityTaskHeartbeat_args: - """ - Attributes: - - heartbeatRequest - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'heartbeatRequest', (RecordActivityTaskHeartbeatRequest, RecordActivityTaskHeartbeatRequest.thrift_spec), None, ), # 1 - ) - - def __init__(self, heartbeatRequest=None,): - self.heartbeatRequest = heartbeatRequest - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.heartbeatRequest = RecordActivityTaskHeartbeatRequest() - self.heartbeatRequest.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('RecordActivityTaskHeartbeat_args') - if self.heartbeatRequest is not None: - oprot.writeFieldBegin('heartbeatRequest', TType.STRUCT, 1) - self.heartbeatRequest.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.heartbeatRequest) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class RecordActivityTaskHeartbeat_result: - """ - Attributes: - - success - - badRequestError - - internalServiceError - - entityNotExistError - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (RecordActivityTaskHeartbeatResponse, RecordActivityTaskHeartbeatResponse.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'badRequestError', (BadRequestError, BadRequestError.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'internalServiceError', (InternalServiceError, InternalServiceError.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'entityNotExistError', (EntityNotExistsError, EntityNotExistsError.thrift_spec), None, ), # 3 - ) - - def __init__(self, success=None, badRequestError=None, internalServiceError=None, entityNotExistError=None,): - self.success = success - self.badRequestError = badRequestError - self.internalServiceError = internalServiceError - self.entityNotExistError = entityNotExistError - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = RecordActivityTaskHeartbeatResponse() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.badRequestError = BadRequestError() - self.badRequestError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.internalServiceError = InternalServiceError() - self.internalServiceError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.entityNotExistError = EntityNotExistsError() - self.entityNotExistError.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('RecordActivityTaskHeartbeat_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.badRequestError is not None: - oprot.writeFieldBegin('badRequestError', TType.STRUCT, 1) - self.badRequestError.write(oprot) - oprot.writeFieldEnd() - if self.internalServiceError is not None: - oprot.writeFieldBegin('internalServiceError', TType.STRUCT, 2) - self.internalServiceError.write(oprot) - oprot.writeFieldEnd() - if self.entityNotExistError is not None: - oprot.writeFieldBegin('entityNotExistError', TType.STRUCT, 3) - self.entityNotExistError.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.success) - value = (value * 31) ^ hash(self.badRequestError) - value = (value * 31) ^ hash(self.internalServiceError) - value = (value * 31) ^ hash(self.entityNotExistError) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class RespondActivityTaskCompleted_args: - """ - Attributes: - - completeRequest - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'completeRequest', (RespondActivityTaskCompletedRequest, RespondActivityTaskCompletedRequest.thrift_spec), None, ), # 1 - ) - - def __init__(self, completeRequest=None,): - self.completeRequest = completeRequest - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.completeRequest = RespondActivityTaskCompletedRequest() - self.completeRequest.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('RespondActivityTaskCompleted_args') - if self.completeRequest is not None: - oprot.writeFieldBegin('completeRequest', TType.STRUCT, 1) - self.completeRequest.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.completeRequest) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class RespondActivityTaskCompleted_result: - """ - Attributes: - - badRequestError - - internalServiceError - - entityNotExistError - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'badRequestError', (BadRequestError, BadRequestError.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'internalServiceError', (InternalServiceError, InternalServiceError.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'entityNotExistError', (EntityNotExistsError, EntityNotExistsError.thrift_spec), None, ), # 3 - ) - - def __init__(self, badRequestError=None, internalServiceError=None, entityNotExistError=None,): - self.badRequestError = badRequestError - self.internalServiceError = internalServiceError - self.entityNotExistError = entityNotExistError - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.badRequestError = BadRequestError() - self.badRequestError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.internalServiceError = InternalServiceError() - self.internalServiceError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.entityNotExistError = EntityNotExistsError() - self.entityNotExistError.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('RespondActivityTaskCompleted_result') - if self.badRequestError is not None: - oprot.writeFieldBegin('badRequestError', TType.STRUCT, 1) - self.badRequestError.write(oprot) - oprot.writeFieldEnd() - if self.internalServiceError is not None: - oprot.writeFieldBegin('internalServiceError', TType.STRUCT, 2) - self.internalServiceError.write(oprot) - oprot.writeFieldEnd() - if self.entityNotExistError is not None: - oprot.writeFieldBegin('entityNotExistError', TType.STRUCT, 3) - self.entityNotExistError.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.badRequestError) - value = (value * 31) ^ hash(self.internalServiceError) - value = (value * 31) ^ hash(self.entityNotExistError) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class RespondActivityTaskFailed_args: - """ - Attributes: - - failRequest - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'failRequest', (RespondActivityTaskFailedRequest, RespondActivityTaskFailedRequest.thrift_spec), None, ), # 1 - ) - - def __init__(self, failRequest=None,): - self.failRequest = failRequest - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.failRequest = RespondActivityTaskFailedRequest() - self.failRequest.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('RespondActivityTaskFailed_args') - if self.failRequest is not None: - oprot.writeFieldBegin('failRequest', TType.STRUCT, 1) - self.failRequest.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.failRequest) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class RespondActivityTaskFailed_result: - """ - Attributes: - - badRequestError - - internalServiceError - - entityNotExistError - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'badRequestError', (BadRequestError, BadRequestError.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'internalServiceError', (InternalServiceError, InternalServiceError.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'entityNotExistError', (EntityNotExistsError, EntityNotExistsError.thrift_spec), None, ), # 3 - ) - - def __init__(self, badRequestError=None, internalServiceError=None, entityNotExistError=None,): - self.badRequestError = badRequestError - self.internalServiceError = internalServiceError - self.entityNotExistError = entityNotExistError - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.badRequestError = BadRequestError() - self.badRequestError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.internalServiceError = InternalServiceError() - self.internalServiceError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.entityNotExistError = EntityNotExistsError() - self.entityNotExistError.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('RespondActivityTaskFailed_result') - if self.badRequestError is not None: - oprot.writeFieldBegin('badRequestError', TType.STRUCT, 1) - self.badRequestError.write(oprot) - oprot.writeFieldEnd() - if self.internalServiceError is not None: - oprot.writeFieldBegin('internalServiceError', TType.STRUCT, 2) - self.internalServiceError.write(oprot) - oprot.writeFieldEnd() - if self.entityNotExistError is not None: - oprot.writeFieldBegin('entityNotExistError', TType.STRUCT, 3) - self.entityNotExistError.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.badRequestError) - value = (value * 31) ^ hash(self.internalServiceError) - value = (value * 31) ^ hash(self.entityNotExistError) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) diff --git a/.gen/py/minions/MatchingService-remote b/.gen/py/minions/MatchingService-remote deleted file mode 100755 index 15e2b4f5118..00000000000 --- a/.gen/py/minions/MatchingService-remote +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python -# -# Autogenerated by Thrift Compiler (0.9.2) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py:utf8strings -# - -import sys -import pprint -from urlparse import urlparse -from thrift.transport import TTransport -from thrift.transport import TSocket -from thrift.transport import TSSLSocket -from thrift.transport import THttpClient -from thrift.protocol import TBinaryProtocol - -from minions import MatchingService -from minions.ttypes import * - -if len(sys.argv) <= 1 or sys.argv[1] == '--help': - print('') - print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] function [arg1 [arg2...]]') - print('') - print('Functions:') - print(' PollForDecisionTaskResponse PollForDecisionTask(PollForDecisionTaskRequest pollRequest)') - print(' PollForActivityTaskResponse PollForActivityTask(PollForActivityTaskRequest pollRequest)') - print('') - sys.exit(0) - -pp = pprint.PrettyPrinter(indent = 2) -host = 'localhost' -port = 9090 -uri = '' -framed = False -ssl = False -http = False -argi = 1 - -if sys.argv[argi] == '-h': - parts = sys.argv[argi+1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - argi += 2 - -if sys.argv[argi] == '-u': - url = urlparse(sys.argv[argi+1]) - parts = url[1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - else: - port = 80 - uri = url[2] - if url[4]: - uri += '?%s' % url[4] - http = True - argi += 2 - -if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': - framed = True - argi += 1 - -if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl': - ssl = True - argi += 1 - -cmd = sys.argv[argi] -args = sys.argv[argi+1:] - -if http: - transport = THttpClient.THttpClient(host, port, uri) -else: - socket = TSSLSocket.TSSLSocket(host, port, validate=False) if ssl else TSocket.TSocket(host, port) - if framed: - transport = TTransport.TFramedTransport(socket) - else: - transport = TTransport.TBufferedTransport(socket) -protocol = TBinaryProtocol.TBinaryProtocol(transport) -client = MatchingService.Client(protocol) -transport.open() - -if cmd == 'PollForDecisionTask': - if len(args) != 1: - print('PollForDecisionTask requires 1 args') - sys.exit(1) - pp.pprint(client.PollForDecisionTask(eval(args[0]),)) - -elif cmd == 'PollForActivityTask': - if len(args) != 1: - print('PollForActivityTask requires 1 args') - sys.exit(1) - pp.pprint(client.PollForActivityTask(eval(args[0]),)) - -else: - print('Unrecognized method %s' % cmd) - sys.exit(1) - -transport.close() diff --git a/.gen/py/minions/MatchingService.py b/.gen/py/minions/MatchingService.py deleted file mode 100644 index 357fb577658..00000000000 --- a/.gen/py/minions/MatchingService.py +++ /dev/null @@ -1,519 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.9.2) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py:utf8strings -# - -from thrift.Thrift import TType, TMessageType, TException, TApplicationException -from ttypes import * -from thrift.Thrift import TProcessor -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol, TProtocol -try: - from thrift.protocol import fastbinary -except: - fastbinary = None - - -class Iface: - """ - MatchingService API is exposed to provide support for polling from long running applications. - Such applications are expected to have a worker which regularly polls for DecisionTask and ActivityTask. For each - DecisionTask, application is expected to process the history of events for that session and respond back with next - decisions. For each ActivityTask, application is expected to execute the actual logic for that task and respond back - with completion or failure. - - """ - def PollForDecisionTask(self, pollRequest): - """ - PollForDecisionTask is called by application worker to process DecisionTask from a specific taskList. A - DecisionTask is dispatched to callers for active workflow executions, with pending decisions. - - - Parameters: - - pollRequest - """ - pass - - def PollForActivityTask(self, pollRequest): - """ - PollForActivityTask is called by application worker to process ActivityTask from a specific taskList. ActivityTask - is dispatched to callers whenever a ScheduleTask decision is made for a workflow execution. - - - Parameters: - - pollRequest - """ - pass - - -class Client(Iface): - """ - MatchingService API is exposed to provide support for polling from long running applications. - Such applications are expected to have a worker which regularly polls for DecisionTask and ActivityTask. For each - DecisionTask, application is expected to process the history of events for that session and respond back with next - decisions. For each ActivityTask, application is expected to execute the actual logic for that task and respond back - with completion or failure. - - """ - def __init__(self, iprot, oprot=None): - self._iprot = self._oprot = iprot - if oprot is not None: - self._oprot = oprot - self._seqid = 0 - - def PollForDecisionTask(self, pollRequest): - """ - PollForDecisionTask is called by application worker to process DecisionTask from a specific taskList. A - DecisionTask is dispatched to callers for active workflow executions, with pending decisions. - - - Parameters: - - pollRequest - """ - self.send_PollForDecisionTask(pollRequest) - return self.recv_PollForDecisionTask() - - def send_PollForDecisionTask(self, pollRequest): - self._oprot.writeMessageBegin('PollForDecisionTask', TMessageType.CALL, self._seqid) - args = PollForDecisionTask_args() - args.pollRequest = pollRequest - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_PollForDecisionTask(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = PollForDecisionTask_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.badRequestError is not None: - raise result.badRequestError - if result.internalServiceError is not None: - raise result.internalServiceError - raise TApplicationException(TApplicationException.MISSING_RESULT, "PollForDecisionTask failed: unknown result"); - - def PollForActivityTask(self, pollRequest): - """ - PollForActivityTask is called by application worker to process ActivityTask from a specific taskList. ActivityTask - is dispatched to callers whenever a ScheduleTask decision is made for a workflow execution. - - - Parameters: - - pollRequest - """ - self.send_PollForActivityTask(pollRequest) - return self.recv_PollForActivityTask() - - def send_PollForActivityTask(self, pollRequest): - self._oprot.writeMessageBegin('PollForActivityTask', TMessageType.CALL, self._seqid) - args = PollForActivityTask_args() - args.pollRequest = pollRequest - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_PollForActivityTask(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = PollForActivityTask_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.badRequestError is not None: - raise result.badRequestError - if result.internalServiceError is not None: - raise result.internalServiceError - raise TApplicationException(TApplicationException.MISSING_RESULT, "PollForActivityTask failed: unknown result"); - - -class Processor(Iface, TProcessor): - def __init__(self, handler): - self._handler = handler - self._processMap = {} - self._processMap["PollForDecisionTask"] = Processor.process_PollForDecisionTask - self._processMap["PollForActivityTask"] = Processor.process_PollForActivityTask - - def process(self, iprot, oprot): - (name, type, seqid) = iprot.readMessageBegin() - if name not in self._processMap: - iprot.skip(TType.STRUCT) - iprot.readMessageEnd() - x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) - oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) - x.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - return - else: - self._processMap[name](self, seqid, iprot, oprot) - return True - - def process_PollForDecisionTask(self, seqid, iprot, oprot): - args = PollForDecisionTask_args() - args.read(iprot) - iprot.readMessageEnd() - result = PollForDecisionTask_result() - try: - result.success = self._handler.PollForDecisionTask(args.pollRequest) - except BadRequestError, badRequestError: - result.badRequestError = badRequestError - except InternalServiceError, internalServiceError: - result.internalServiceError = internalServiceError - oprot.writeMessageBegin("PollForDecisionTask", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_PollForActivityTask(self, seqid, iprot, oprot): - args = PollForActivityTask_args() - args.read(iprot) - iprot.readMessageEnd() - result = PollForActivityTask_result() - try: - result.success = self._handler.PollForActivityTask(args.pollRequest) - except BadRequestError, badRequestError: - result.badRequestError = badRequestError - except InternalServiceError, internalServiceError: - result.internalServiceError = internalServiceError - oprot.writeMessageBegin("PollForActivityTask", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - -# HELPER FUNCTIONS AND STRUCTURES - -class PollForDecisionTask_args: - """ - Attributes: - - pollRequest - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'pollRequest', (PollForDecisionTaskRequest, PollForDecisionTaskRequest.thrift_spec), None, ), # 1 - ) - - def __init__(self, pollRequest=None,): - self.pollRequest = pollRequest - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.pollRequest = PollForDecisionTaskRequest() - self.pollRequest.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('PollForDecisionTask_args') - if self.pollRequest is not None: - oprot.writeFieldBegin('pollRequest', TType.STRUCT, 1) - self.pollRequest.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.pollRequest) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class PollForDecisionTask_result: - """ - Attributes: - - success - - badRequestError - - internalServiceError - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (PollForDecisionTaskResponse, PollForDecisionTaskResponse.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'badRequestError', (BadRequestError, BadRequestError.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'internalServiceError', (InternalServiceError, InternalServiceError.thrift_spec), None, ), # 2 - ) - - def __init__(self, success=None, badRequestError=None, internalServiceError=None,): - self.success = success - self.badRequestError = badRequestError - self.internalServiceError = internalServiceError - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = PollForDecisionTaskResponse() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.badRequestError = BadRequestError() - self.badRequestError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.internalServiceError = InternalServiceError() - self.internalServiceError.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('PollForDecisionTask_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.badRequestError is not None: - oprot.writeFieldBegin('badRequestError', TType.STRUCT, 1) - self.badRequestError.write(oprot) - oprot.writeFieldEnd() - if self.internalServiceError is not None: - oprot.writeFieldBegin('internalServiceError', TType.STRUCT, 2) - self.internalServiceError.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.success) - value = (value * 31) ^ hash(self.badRequestError) - value = (value * 31) ^ hash(self.internalServiceError) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class PollForActivityTask_args: - """ - Attributes: - - pollRequest - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'pollRequest', (PollForActivityTaskRequest, PollForActivityTaskRequest.thrift_spec), None, ), # 1 - ) - - def __init__(self, pollRequest=None,): - self.pollRequest = pollRequest - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.pollRequest = PollForActivityTaskRequest() - self.pollRequest.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('PollForActivityTask_args') - if self.pollRequest is not None: - oprot.writeFieldBegin('pollRequest', TType.STRUCT, 1) - self.pollRequest.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.pollRequest) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class PollForActivityTask_result: - """ - Attributes: - - success - - badRequestError - - internalServiceError - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (PollForActivityTaskResponse, PollForActivityTaskResponse.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'badRequestError', (BadRequestError, BadRequestError.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'internalServiceError', (InternalServiceError, InternalServiceError.thrift_spec), None, ), # 2 - ) - - def __init__(self, success=None, badRequestError=None, internalServiceError=None,): - self.success = success - self.badRequestError = badRequestError - self.internalServiceError = internalServiceError - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = PollForActivityTaskResponse() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.badRequestError = BadRequestError() - self.badRequestError.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.internalServiceError = InternalServiceError() - self.internalServiceError.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('PollForActivityTask_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.badRequestError is not None: - oprot.writeFieldBegin('badRequestError', TType.STRUCT, 1) - self.badRequestError.write(oprot) - oprot.writeFieldEnd() - if self.internalServiceError is not None: - oprot.writeFieldBegin('internalServiceError', TType.STRUCT, 2) - self.internalServiceError.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.success) - value = (value * 31) ^ hash(self.badRequestError) - value = (value * 31) ^ hash(self.internalServiceError) - return value - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) diff --git a/.gitignore b/.gitignore index 7e0ce82329c..f4261bd01ef 100644 --- a/.gitignore +++ b/.gitignore @@ -8,10 +8,8 @@ *.html .tmp/ /vendor -/minions +/cadence .DS_Store -# Executables produced by minions repo -cmd/stress/stress -cmd/demo/demo -workflow/workflow +# Executables produced by cadence repo + diff --git a/Makefile b/Makefile index e3d68fdf797..9310eadf998 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,15 @@ jenkins:: # define the list of thrift files the service depends on # (if you have some) -THRIFT_SRCS = idl/github.com/uber/cadence/minions.thrift \ +THRIFT_SRCS = idl/github.com/uber/cadence/cadence.thrift \ idl/github.com/uber/cadence/shared.thrift \ - idl/github.com/uber/cadence/history.thrift \ - idl/github.com/uber/cadence/matching.thrift \ + idl/github.com/uber/cadence/history.thrift \ + idl/github.com/uber/cadence/matching.thrift \ # list all executables -PROGS = minions +PROGS = cadence -minions: main.go \ +cadence: main.go \ $(wildcard config/*.go) \ $(wildcard service/*.go) \ diff --git a/client/frontend/client.go b/client/frontend/client.go index 16a1120b6ef..b602bbeea25 100644 --- a/client/frontend/client.go +++ b/client/frontend/client.go @@ -5,7 +5,7 @@ import ( "golang.org/x/net/context" - m "github.com/uber/cadence/.gen/go/minions" + m "github.com/uber/cadence/.gen/go/cadence" workflow "github.com/uber/cadence/.gen/go/shared" "github.com/uber/cadence/common" tchannel "github.com/uber/tchannel-go" diff --git a/config/base.yaml b/config/base.yaml deleted file mode 100644 index f4bc4ac7e5f..00000000000 --- a/config/base.yaml +++ /dev/null @@ -1,13 +0,0 @@ -serviceName: minions - -jaeger: - disabled: false - -logging: - level: info - stdout: true - -metrics: - m3: - hostPort: 127.0.0.1:9052 - service: cherami-stress diff --git a/config/config.go b/config/config.go deleted file mode 100644 index 0d751d9e4bd..00000000000 --- a/config/config.go +++ /dev/null @@ -1,33 +0,0 @@ -package config - -import ( - "code.uber.internal/go-common.git/x/config" - "code.uber.internal/go-common.git/x/log" - "code.uber.internal/go-common.git/x/metrics" - "code.uber.internal/go-common.git/x/tchannel" - - jaeger "github.com/uber/jaeger-client-go/config" -) - -// AppConfig - application configuration -type AppConfig struct { - Logging log.Configuration - Metrics metrics.Configuration - Jaeger jaeger.Configuration - TChannel xtchannel.Configuration - Sentry log.SentryConfiguration - Verbose bool - ServiceName string `yaml:"serviceName"` -} - -// LoadConfig loads the workflow configuration -func LoadConfig() (*AppConfig, error) { - var cfg AppConfig - if err := config.Load(&cfg); err != nil { - log.Fatalf("Error initializing configuration: %s", err) - } - log.Configure(&cfg.Logging, cfg.Verbose) - log.ConfigureSentry(&cfg.Sentry) - - return &cfg, nil -} diff --git a/config/development.yaml b/config/development.yaml deleted file mode 100644 index 7d08b0418f0..00000000000 --- a/config/development.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Add your development configuration here -tchannel: - # Use a fixed port during development. - port: 0 - # Use the local Hyperbahn nodes during development. - routers: ["127.0.0.1:21300", "127.0.0.1:21300"] - #disableHyperbahn: true - #disableLogging: true - #logLevel: warn - -jaeger: - # This tells Jaeger to sample and capture every trace in the service. - # This section should not be in the production configuration, - # because it will degrade the application performance by reporting - # multiple spans per each request, and spam Jaeger with lots of data. - sampler: - type: "const" - param: 1 - # The reporter settings ensure that each span is reported immediately - # as soon as it is finished (without being buffered), and its trace ID - # is written to the log. - reporter: - queueSize: 1 - logSpans: true diff --git a/config/production.yaml b/config/production.yaml deleted file mode 100644 index 82883e88481..00000000000 --- a/config/production.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Add your production configuration here -logging: - stdout: true - kafka: - topic: minions - -metrics: - m3: - hostPort: 127.0.0.1:9052 - service: cherami-stress - -sentry: - dsn: http://fill:mein@sentry.local.uber.internal/fillmein diff --git a/config/test.yaml b/config/test.yaml deleted file mode 100644 index 4e6e32b4124..00000000000 --- a/config/test.yaml +++ /dev/null @@ -1 +0,0 @@ -# Add your test configuration here diff --git a/glide.yaml b/glide.yaml index ced5fc308f3..8a9ebb3a7eb 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,4 +1,4 @@ -package: code.uber.internal/devexp/minions +package: github.com/uber/cadence import: - package: github.com/uber/tchannel-go subpackages: diff --git a/idl/github.com/uber/cadence/minions.thrift b/idl/github.com/uber/cadence/cadence.thrift similarity index 99% rename from idl/github.com/uber/cadence/minions.thrift rename to idl/github.com/uber/cadence/cadence.thrift index 75780a06750..a759d2a1e41 100644 --- a/idl/github.com/uber/cadence/minions.thrift +++ b/idl/github.com/uber/cadence/cadence.thrift @@ -1,6 +1,6 @@ include "shared.thrift" -namespace java com.uber.devexp.minions +namespace java com.uber.cadence /** * WorkflowService API is exposed to provide support for long running applications. Application is expected to call diff --git a/idl/github.com/uber/cadence/history.thrift b/idl/github.com/uber/cadence/history.thrift index c82ecfded2e..362dcc69da1 100644 --- a/idl/github.com/uber/cadence/history.thrift +++ b/idl/github.com/uber/cadence/history.thrift @@ -1,6 +1,6 @@ include "shared.thrift" -namespace java com.uber.devexp.minions +namespace java com.uber.cadence exception EventAlreadyStartedError { 1: required string message diff --git a/idl/github.com/uber/cadence/matching.thrift b/idl/github.com/uber/cadence/matching.thrift index a878e4693c5..e85e4192a87 100644 --- a/idl/github.com/uber/cadence/matching.thrift +++ b/idl/github.com/uber/cadence/matching.thrift @@ -1,6 +1,6 @@ include "shared.thrift" -namespace java com.uber.devexp.minions +namespace java com.uber.cadence struct AddDecisionTaskRequest { 10: optional shared.WorkflowExecution execution diff --git a/idl/github.com/uber/cadence/shared.thrift b/idl/github.com/uber/cadence/shared.thrift index 0d22a35688f..cd8db330740 100644 --- a/idl/github.com/uber/cadence/shared.thrift +++ b/idl/github.com/uber/cadence/shared.thrift @@ -1,4 +1,4 @@ -namespace java com.uber.devexp.minions +namespace java com.uber.cadence exception BadRequestError { 1: required string message diff --git a/service/frontend/handler.go b/service/frontend/handler.go index 1e81b550e53..443ded90704 100644 --- a/service/frontend/handler.go +++ b/service/frontend/handler.go @@ -4,7 +4,7 @@ import ( "log" "github.com/uber-common/bark" - "github.com/uber/cadence/.gen/go/minions" + "github.com/uber/cadence/.gen/go/cadence" gen "github.com/uber/cadence/.gen/go/shared" "github.com/uber/cadence/client/history" "github.com/uber/cadence/client/matching" @@ -13,7 +13,7 @@ import ( "github.com/uber/tchannel-go/thrift" ) -var _ minions.TChanWorkflowService = (*WorkflowHandler)(nil) +var _ cadence.TChanWorkflowService = (*WorkflowHandler)(nil) // WorkflowHandler - Thrift handler inteface for workflow service type WorkflowHandler struct { @@ -23,13 +23,13 @@ type WorkflowHandler struct { service.Service } -// NewWorkflowHandler creates a thrift handler for the minions service +// NewWorkflowHandler creates a thrift handler for the cadence service func NewWorkflowHandler(sVice service.Service) (*WorkflowHandler, []thrift.TChanServer) { handler := &WorkflowHandler{ Service: sVice, tokenSerializer: common.NewJSONTaskTokenSerializer(), } - return handler, []thrift.TChanServer{minions.NewTChanWorkflowServiceServer(handler)} + return handler, []thrift.TChanServer{cadence.NewTChanWorkflowServiceServer(handler)} } // Start starts the handler diff --git a/udeploy/pinocchio.yaml b/udeploy/pinocchio.yaml deleted file mode 100644 index 462541a61eb..00000000000 --- a/udeploy/pinocchio.yaml +++ /dev/null @@ -1,3 +0,0 @@ -service_name: minions -network_protocol: tchannel -service_type: go diff --git a/udeploy/symlink_secrets b/udeploy/symlink_secrets deleted file mode 100644 index 9f682348d5f..00000000000 --- a/udeploy/symlink_secrets +++ /dev/null @@ -1 +0,0 @@ -COUNT ME IN, BRO