gorealis v2 refactor (#5)

* Changing default timeout for start maintenance.

* Upgrading dependencies to gorealis v2 and thrift  0.12.0

* Refactored to update to gorealis v2.
This commit is contained in:
Renan DelValle 2018-12-27 11:31:51 -08:00 committed by GitHub
parent ad4dd9606e
commit 6ab5c9334d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1335 changed files with 137431 additions and 61530 deletions

View file

@ -21,7 +21,7 @@
#include <thrift/transport/TBufferTransports.h>
#include <boost/scoped_ptr.hpp>
using boost::shared_ptr;
using apache::thrift::stdcxx::shared_ptr;
using apache::thrift::transport::TMemoryBuffer;
using apache::thrift::protocol::TProtocol;

View file

@ -28,7 +28,7 @@ namespace apache { namespace thrift { namespace server {
class TZmqServer : public TServer {
public:
TZmqServer(
boost::shared_ptr<TProcessor> processor,
apache::thrift::stdcxx::shared_ptr<TProcessor> processor,
zmq::context_t& ctx, const std::string& endpoint, int type)
: TServer(processor)
, processor_(processor)
@ -56,7 +56,7 @@ class TZmqServer : public TServer {
}
private:
boost::shared_ptr<TProcessor> processor_;
apache::thrift::stdcxx::shared_ptr<TProcessor> processor_;
int zmq_type_;
zmq::socket_t sock_;
};

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>0.10.0</ProductVersion>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}</ProjectGuid>
<OutputType>Exe</OutputType>
@ -25,7 +25,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>0.10.0.%2a</ApplicationVersion>
<ApplicationVersion>0.12.0</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
@ -88,4 +88,4 @@
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
</Project>

View file

@ -6,7 +6,7 @@
#include "TZmqClient.h"
#include "Storage.h"
using boost::shared_ptr;
using apache::thrift::stdcxx::shared_ptr;
using apache::thrift::transport::TZmqClient;
using apache::thrift::protocol::TBinaryProtocol;
@ -17,7 +17,7 @@ int main(int argc, char** argv) {
if (argc > 1) {
incr = atoi(argv[1]);
if (incr) {
socktype = ZMQ_DOWNSTREAM;
socktype = ZMQ_PUSH;
endpoint = "tcp://127.0.0.1:9091";
}
}

View file

@ -15,7 +15,7 @@ def main(args):
if len(args) > 1:
incr = int(args[1])
if incr:
socktype = zmq.DOWNSTREAM
socktype = zmq.PUSH
endpoint = "tcp://127.0.0.1:9091"
ctx = zmq.Context()
@ -29,7 +29,7 @@ def main(args):
time.sleep(0.05)
else:
value = client.get()
print value
print(value)
if __name__ == "__main__":

View file

@ -2,7 +2,7 @@
#include "TZmqServer.h"
#include "Storage.h"
using boost::shared_ptr;
using apache::thrift::stdcxx::shared_ptr;
using apache::thrift::TProcessor;
using apache::thrift::server::TZmqServer;
using apache::thrift::server::TZmqMultiServer;

View file

@ -6,7 +6,7 @@
#include "TZmqClient.h"
#include "Storage.h"
using boost::shared_ptr;
using apache::thrift::stdcxx::shared_ptr;
using apache::thrift::transport::TZmqClient;
using apache::thrift::protocol::TBinaryProtocol;

View file

@ -2,7 +2,7 @@
#include "TZmqServer.h"
#include "Storage.h"
using boost::shared_ptr;
using apache::thrift::stdcxx::shared_ptr;
using apache::thrift::TProcessor;
using apache::thrift::server::TZmqServer;
using apache::thrift::server::TZmqMultiServer;
@ -33,7 +33,7 @@ int main(int argc, char *argv[]) {
zmq::context_t ctx(1);
TZmqServer reqrep_server(processor, ctx, "tcp://0.0.0.0:9090", ZMQ_REP);
TZmqServer oneway_server(processor, ctx, "tcp://0.0.0.0:9091", ZMQ_UPSTREAM);
TZmqServer oneway_server(processor, ctx, "tcp://0.0.0.0:9091", ZMQ_PULL);
TZmqMultiServer multiserver;
multiserver.servers().push_back(&reqrep_server);
multiserver.servers().push_back(&oneway_server);

View file

@ -22,7 +22,7 @@ def main():
ctx = zmq.Context()
reqrep_server = TZmqServer.TZmqServer(processor, ctx, "tcp://0.0.0.0:9090", zmq.REP)
oneway_server = TZmqServer.TZmqServer(processor, ctx, "tcp://0.0.0.0:9091", zmq.UPSTREAM)
oneway_server = TZmqServer.TZmqServer(processor, ctx, "tcp://0.0.0.0:9091", zmq.PULL)
multiserver = TZmqServer.TZmqMultiServer()
multiserver.servers.append(reqrep_server)
multiserver.servers.append(oneway_server)