protobuf

Android protobuf nano usage

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to generate java files from below proto file using protobuf nano. I got some basic instruction on how to proceed in this SO thread . I have this proto file, personal.proto : package tutorial; option java_package = "com.example.tutorial"; option java_outer_classname = "AddressBookProtos"; message Person { required string name = 1; required int32 id = 2; optional string email = 3; enum PhoneType { MOBILE = 0; HOME = 1; WORK = 2; } message PhoneNumber { required string number = 1; optional PhoneType type = 2 [default = HOME]; }

Java: JSON -> Protobuf & back conversion

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an existing system, which is using protobuf-based communication protocol between GUI and server. Now I would like to add some persistence, but at the moment protobuf messages are straight converted to a third-party custom objects. Is there a way to convert proto messages to json , which could be then persisted to database. N.B.: I don't much like an idea of writing binary protobuf to database, because it can one day become not backward-compatible with newer versions and break the system that way. 回答1: We are currently using protobuf

Installing Google Protocol Buffers on mac

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to install the older version of Google Protocol Buffers (protobuf-2.4.1) on mac using Terminal command line. I tried with brew install protobuf , but the latest version 2.5.0 has been installed. Is it possible to install the older version from terminal. Thanks 回答1: There are some issues with building protobuf 2.4.1 from source on a Mac. There is a patch that also has to be applied. All this is contained within the homebrew protobuf241 formula, so I would advise using it. To install protocol buffer version 2.4.1 type the

Google protobuf and Android NDK

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to build Google protobuf (c++ version, https://github.com/google/protobuf/releases/latest ) with Android target? 回答1: I compiled protobuf without ndk-build. Here's the script (not very clean but it works): rm -rf /tmp/protobuf-3.3.0/ tar xzvf ~/Downloads/protobuf-cpp-3.3.0.tar.gz -C /tmp/ cd /tmp/protobuf-3.3.0/ export NDK_ROOT=/home/user/SDKS/ANDROID/NDK/android-ndk-r13b export SYSROOT=$NDK_ROOT/platforms/android-9/arch-arm export PREBUILT=$NDK_ROOT/toolchains/arm-linux-androideabi-4.9 export LDFLAGS="--sysroot=$SYSROOT" export LD="$NDK

Dataflow fails with java.lang.NoSuchMethodError: io.grpc.protobuf.ProtoUtils.marshaller(Lcom/google/protobuf/Message;)

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to get a Dataflow job to run on Google Cloud. It always fails with: java.lang.NoSuchMethodError: io.grpc.protobuf.ProtoUtils.marshaller(Lcom/google/protobuf/Message;)Lio/grpc/MethodDescriptor$Marshaller It's a maven project, here are my dependencies: <dependencies> <dependency> <groupId>com.google.cloud.dataflow</groupId> <artifactId>google-cloud-dataflow-java-sdk-all</artifactId> <version>1.8.0</version> </dependency> <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-pubsub</artifactId> <version>0.4.0<

How to solve: “exception was thrown by the target of invocation” C#

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: C# Every time I run my porgram I get this exception: But when I run in debug mode, there is no exception and the program works fine, what can I do? NOTE: I do not use invoke() anywhere in the project EDIT: Okay, here is the code found in the details: If someone know how to use protoBuff, and know this problem.... ************** Exception Text ************** System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> ProtoBuf.ProtoException: Incorrect wire-type deserializing TimeSpan at ProtoBuf

How can I use proto3 with Hadoop/Spark?

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've got several .proto files which rely on syntax = "proto3"; . I also have a Maven project that is used to build Hadoop/Spark jobs (Hadoop 2.7.1 and Spark 1.5.2). I'd like to generate data in Hadoop/Spark and then serialize it according to my proto3 files. Using libprotoc 3.0.0, I generate Java sources which work fine within my Maven project as long as I have the following in my pom.xml: com.google.protobuf protobuf-java 3.0.0-beta-1 Now, when I use my libprotoc-generated classes in a job that gets deployed to a cluster I get hit with:

Compiling C++ gRPC for Android

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to compile C++ gRPC code for Android? I have seen several tutorials on how Protobuf itself can be compiled using the Android Native Development Kit, such as in the answer from Swapnil: How to integrate/install latest c++ protobuf (3.2) with Android NDK? Or Google protobuf and Android NDK But how to How to compile C++ gRPC code that is using Protobuf as well for Android? Taking into account that there's 20K lines of gRPC Makefile . 文章来源: Compiling C++ gRPC for Android

Unable to find Protobuf include directory during install mysql-connector over pip

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I pulled mysql-connector-python code and when I run python ./setup.py build I get the following error: Unable to find Protobuf include directory. pip install Protobuf was useless How can I solve this problem? 回答1: I found that this error occurs since version 2.2.3. You can avoid this issue using version 2.1.6. pip install mysql-connector==2.1.6 try above. 回答2: As of 2.2.3, Connector/Python uses a C++ extension that interfaces with a MySQL server with the X plugin enabled, using Protobuf as data interchange format. So, you need to set up

Unable to find artifact “copy-protoc:generate-sources”

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using Google's Protocol Buffers in a project. We use Maven to compile the protobufs automatically ( based on http://vlkan.com/blog/post/2015/11/27/maven-protobuf/ ) Maven gave us tree errors which we were able to solve by installing Maven Plugins on our Eclipse installation. But there is one error we can't solve : org . apache . maven . plugins : maven - dependency - plugin : 2.9 : copy : copy - protoc : generate - sources This error comes and goes apparently "randomly" and it doesn't break the compilation: everything works