You may need to configure a proxy server if you're having trouble cloning
or fetching from a remote repository or getting an error
like unable to access '...' Couldn't resolve host '...'.
Consider something like:
| # -*- coding: utf-8 -*- | |
| # Generated by the protocol buffer compiler. DO NOT EDIT! | |
| # source: MLDataFormats.proto | |
| """Generated protocol buffer code.""" | |
| from google.protobuf import descriptor as _descriptor | |
| from google.protobuf import descriptor_pool as _descriptor_pool | |
| from google.protobuf import symbol_database as _symbol_database | |
| from google.protobuf.internal import builder as _builder | |
| # @@protoc_insertion_point(imports) |
| export PLATFORM=aarch64 | |
| # An example to switch to GCC 10 | |
| #sudo yum install centos-release-scl | |
| #sudo yum install devtoolset-10 | |
| #scl enable devtoolset-10 bash | |
| set -ex | |
| BOOST_VERSION=1.80.0 |
| #!/bin/bash | |
| set -ex | |
| cd `dirname $0` | |
| # define dependency versions | |
| BOOST_VERSION=1.80.0 | |
| CMAKE_VERSION=3.4.2 | |
| PROTOBUF_VERSION=3.20.0 | |
| ZLIB_VERSION=1.2.12 | |
| ZSTD_VERSION=1.5.2 |
| #include <atomic> | |
| #include <functional> | |
| #include <iostream> | |
| #include <memory> | |
| using namespace std; | |
| static std::atomic_int idGenerator{0}; | |
| struct Object { | |
| int id; |
| import java.time.Duration; | |
| import java.util.Collections; | |
| import java.util.Properties; | |
| import java.util.concurrent.ExecutionException; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; | |
| import javax.annotation.Nullable; | |
| import lombok.Cleanup; | |
| import lombok.extern.slf4j.Slf4j; | |
| import org.apache.kafka.clients.admin.AdminClient; |
| // TimerTask.cc: simulate pulsar cpp client's ExecutorService and timer registration. | |
| // Compile: | |
| /* | |
| BOOST_DIR=/your/path/to/boost | |
| g++ -g TimerTask.cc -std=c++11 \ | |
| -I $BOOST_DIR/include -L $BOOST_DIR/lib -lboost_system -lpthread | |
| */ | |
| #include <boost/asio.hpp> | |
| #include <chrono> | |
| #include <iostream> |
| #!/bin/bash | |
| # 适用于 Ubuntu/Debian 系统的 pulsar-client-cpp 编译脚本 | |
| set -e | |
| # 0. 安装基本工具 | |
| apt install -y git wget | |
| # 1. 安装编译工具,在 Debian 4.9.210-1 (2020-01-20) 上面是 g++ 6.3 和 cmake 3.7 | |
| # 最低要求:g++ >= 4.8.5,cmake >= 3.4 | |
| apt install -y gcc g++ cmake |
| #!/bin/bash | |
| ################################################################################################### | |
| # Deploy a simplest Pulsar cluster. It's more flexible than deploying a Pulsar standalone | |
| # | |
| # conf/log4j2.yaml: | |
| # | |
| # ``` | |
| # immediateFlush: true | |
| # ``` | |
| # |
| // g++ ObjectPool.cc -std=c++14 -pthread -O2 | |
| #include "ObjectPool.h" // https://github.com/apache/pulsar/tree/master/pulsar-client-cpp/lib/ObjectPool.h | |
| #include <chrono> | |
| #include <iostream> | |
| #include <thread> | |
| #include <vector> | |
| using namespace std; | |
| inline auto now() { return std::chrono::high_resolution_clock::now(); } |