THRIFT-4571: Updated ZeroMQ examples to ZeroMQ version >= 3.0. (#1556)

* New style for Python is default now.
* Symbols were replaced in newer versions of ZeroMQ (>=3.0).
* Use Thrift's abstraction for `shared_ptr` instead of Boost.
* Symbols were replaced in Python as well.
diff --git a/contrib/zeromq/Makefile b/contrib/zeromq/Makefile
index b09f4ee..ee398e2 100644
--- a/contrib/zeromq/Makefile
+++ b/contrib/zeromq/Makefile
@@ -26,7 +26,7 @@
 
 storage/__init__.py: storage.thrift
 	$(RM) $(dir $@)
-	$(THRIFT) --gen py:newstyle $<
+	$(THRIFT) --gen py $<
 	mv gen-py/$(dir $@) .
 
 $(GENSRCS): storage.thrift
diff --git a/contrib/zeromq/TZmqServer.cpp b/contrib/zeromq/TZmqServer.cpp
index f031458..4df6c92 100644
--- a/contrib/zeromq/TZmqServer.cpp
+++ b/contrib/zeromq/TZmqServer.cpp
@@ -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;
 
diff --git a/contrib/zeromq/TZmqServer.h b/contrib/zeromq/TZmqServer.h
index a840c86..43f86c0 100644
--- a/contrib/zeromq/TZmqServer.h
+++ b/contrib/zeromq/TZmqServer.h
@@ -28,7 +28,7 @@
 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 @@
   }
 
  private:
-  boost::shared_ptr<TProcessor> processor_;
+  apache::thrift::stdcxx::shared_ptr<TProcessor> processor_;
   int zmq_type_;
   zmq::socket_t sock_;
 };
diff --git a/contrib/zeromq/test-client.cpp b/contrib/zeromq/test-client.cpp
index d2fc56c..70a331e 100644
--- a/contrib/zeromq/test-client.cpp
+++ b/contrib/zeromq/test-client.cpp
@@ -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 @@
   if (argc > 1) {
     incr = atoi(argv[1]);
     if (incr) {
-      socktype = ZMQ_DOWNSTREAM;
+      socktype = ZMQ_PUSH;
       endpoint = "tcp://127.0.0.1:9091";
     }
   }
diff --git a/contrib/zeromq/test-client.py b/contrib/zeromq/test-client.py
index 55c23e0..d51216e 100755
--- a/contrib/zeromq/test-client.py
+++ b/contrib/zeromq/test-client.py
@@ -15,7 +15,7 @@
     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()
diff --git a/contrib/zeromq/test-receiver.cpp b/contrib/zeromq/test-receiver.cpp
index 8fe69da..60791ac 100644
--- a/contrib/zeromq/test-receiver.cpp
+++ b/contrib/zeromq/test-receiver.cpp
@@ -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;
diff --git a/contrib/zeromq/test-sender.cpp b/contrib/zeromq/test-sender.cpp
index 6b0eef1..8928db3 100644
--- a/contrib/zeromq/test-sender.cpp
+++ b/contrib/zeromq/test-sender.cpp
@@ -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;
 
diff --git a/contrib/zeromq/test-server.cpp b/contrib/zeromq/test-server.cpp
index c624b0d..baa1451 100644
--- a/contrib/zeromq/test-server.cpp
+++ b/contrib/zeromq/test-server.cpp
@@ -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 @@
 
   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);
diff --git a/contrib/zeromq/test-server.py b/contrib/zeromq/test-server.py
index c7804d3..d89b37b 100755
--- a/contrib/zeromq/test-server.py
+++ b/contrib/zeromq/test-server.py
@@ -22,7 +22,7 @@
 
     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)