Thrift10 is an interface definition language that is used to define and create services for
numerous languages.
Like protocol buffers, it too is used as a remote procedure call (RPC) framework. Like
protocol buffers, Thrift was developed to address the growing needs of a burgeoning
application content service provider—Facebook. At the time of its creation, Facebook
operated data centers on a massive scale and encountered issues similar to those Google
ran into a number of years earlier. Thrift is written in C++, but its compiler can create
code for a number of languages. Like protocol buffers, Thrift combines a code generation
engine to build services with multiprogramming language support, although in the
spirit of Facebook’s much more flexible development environment, Thrift supports a
very wide variety of generated languages including C++, Erlang, Go, Haskell, Perl, Cappuccino,
Python, C#, Perl, Ruby, Smalltalk, Node.js, and PHP.
In April 2007, Facebook donated the project to the Apache Software Foundation, where
it continues to be worked on and developed.
As mentioned earlier, Thrift includes a complete software library that can be used to
create clients and servers, as well as an RPC mechanism between the two that facilitates
communication.
Figure 5-7 shows the functional architecture of a Thrift client and server. The service
client and read()/write() code is generated from the Thrift service definition file. This
file is fed to the Thrift compiler that then generates client and processor code that is
later incorporated into the client and server code. The protocol and transport layer
shown in the figure are part of the runtime library that comes as a precompiled library
included into the client and server base.
Thrift10 เป็นภาษานิยามอินเตอร์เฟซที่ใช้ในการกำหนดและสร้างบริการสำหรับ
หลายภาษา.
เช่นเดียวกับบัฟเฟอร์โปรโตคอลมันก็จะใช้เป็นขั้นตอนระยะไกล (RPC) กรอบ เช่นเดียวกับ
บัฟเฟอร์โปรโตคอลทริฟท์ได้รับการพัฒนาเพื่อตอบสนองความต้องการที่เพิ่มมากขึ้นของ burgeoning
บริการเนื้อหาการประยุกต์ใช้ผู้ให้บริการ Facebook ในช่วงเวลาของการสร้างของ, Facebook
ดำเนินการศูนย์ข้อมูลในระดับมากและปัญหาที่พบคล้ายกับที่ของ Google
วิ่งเข้าไปในหลายปีก่อนหน้านี้ ทริฟท์ถูกเขียนใน C ++ แต่คอมไพเลอร์ที่สามารถสร้าง
รหัสสำหรับจำนวนของภาษา เช่นเดียวกับบัฟเฟอร์โปรโตคอลทริฟท์รวมรุ่นรหัส
เครื่องมือในการสร้างบริการที่มีการสนับสนุนภาษา multiprogramming แม้ว่าใน
จิตวิญญาณของการพัฒนาสภาพแวดล้อมที่มีความยืดหยุ่นมากขึ้นของ Facebook, ทริฟท์สนับสนุนความ
หลากหลายมากของภาษาที่สร้างขึ้นรวมทั้ง C ++ Erlang, Go, Haskell, Perl, คาปูชิโน,
งูหลาม, C #, Perl, ทับทิม, สมอลล์ทอล์ค Node.js, PHP และ.
ในเดือนเมษายนปี 2007 Facebook บริจาคของโครงการไปยัง Apache Software Foundation ที่
มันยังคงที่จะทำงานและพัฒนา.
ดังกล่าวก่อนหน้าทริฟท์รวมถึง ห้องสมุดซอฟแวร์ที่สมบูรณ์แบบที่สามารถใช้ในการ
สร้างลูกค้าและเซิร์ฟเวอร์เช่นเดียวกับกลไก RPC ระหว่างสองที่อำนวยความสะดวก
ในการสื่อสาร.
รูปที่ 5-7 แสดงให้เห็นถึงสถาปัตยกรรมการทำงานของลูกค้าทริฟท์และเซิร์ฟเวอร์ บริการ
ลูกค้าและการอ่าน () / เขียน () รหัสถูกสร้างขึ้นจากแฟ้มข้อกำหนดการให้บริการทริฟท์ นี้
ไฟล์จะถูกป้อนเข้าเรียบเรียงทริฟท์ที่แล้วสร้างลูกค้าและหน่วยประมวลผลโค้ดที่เป็น
นิติบุคคลที่จัดตั้งขึ้นมาเป็นไคลเอ็นต์และเซิร์ฟเวอร์รหัส ชั้นโปรโตคอลและการขนส่ง
แสดงในรูปที่เป็นส่วนหนึ่งของห้องสมุดรันไทม์ที่มาเป็นห้องสมุด precompiled
รวมอยู่ในไคลเอ็นต์และเซิร์ฟเวอร์ฐาน
การแปล กรุณารอสักครู่..
