Upload
tim-
View
420
Download
2
Embed Size (px)
Citation preview
Introduction to Protocol Buffer
Outline
• Introduction
• Scenario
• Protocol Buffer Language
• Code Example
• conclusion
Introduction
•
• IDL ( Schema )
•
• XML 20 ~ 100
• 3 ~ 10
•
•
•
•
•
•
•
•
• Parse, Serialization
• Schema or No Schema
• Schema
•
Protocol Buffer
•
•
• Schema
•
?
• …
2006 • http://bit.ly/1OG01PZ Google Java
• Google RPC Remote Procedure Call
Java Python C++
• Interface Definition LanguageJava Python C++
Hadoop
• Restful api Query HBase protocol buffer
• Twitter hadoopProtocol Buffer
• Map Reduce YARN. mapper Reducer Protocol Buffer
Tensor Flow
• Taipei.py Talk
• Tensor flow Graph
• Graph Protocol Buffer
RTB( Real Time Bidding)
•
•
• Protocol Buffer
•
• Web client side
•
• ubuntu, mac
• IDL ( Schema )
• IDL , Schema
• Happy Coding
Mac • brew install protobuf
• mkdir -p /Users/tim/.local/lib/python2.7/site-packages
• echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/tim/.local/lib/python2.7/site-packages/homebrew.pth
• pip
IDL
message Person { required string name = 1; required int32 id = 2; optional string email = 3; }
Compile
• protoc --python_out . sample.proto
• sample_pb2.py
Usage
deserialize
Conclusion
• Protocol Buffer
•
•
•
•
• CI. Schema
Future
• Protocol Buffer 3
• RPC
•
•