Skip to content
EntityQ266257· pop 12· linked from 440 articles

Apache Thrift

Sign in to save

Framework RPC Open Source

In the Vinony graph

Vinony's link graph records 440 inbound references to Apache Thrift, and connects out to WhatsApp, Meta and Apache Software Foundation.

It is catalogued under topics including Apache Software Foundation projects, Application layer protocols and Data serialization formats.

Vinony links it to 10 Wikipedia language editions.

Official website

Apache Thrift - Home

thrift.apache.org →

Link to the official site · 7,690 chars · not written by Vinony

Described at

dance,focusingonthekey typesavailableinallprogramminglan- guages,ommittingany nichetypesavailableonlyinspecificlan- guages. ThebasetypessupportedbyThriftare:  boolA booleanvalue,trueorfalse  byteA signedbyte  i16A 16-bitsignedinteger  i32A 32-bitsignedinteger  i64A 64-bitsignedinteger  doubleA 64-bitfloatingpointnumber  stringAnencoding-agnostictextorbinarystring Ofparticularnoteis theabsenceofunsignedintegertypes.Because thesetypeshave nodirecttranslationtonative primitive types inmany languages,theadvantagesthey affordarelost.Further, thereis nowaytopreventtheapplicationdeveloperina language like Pythonfromassigninga negative valuetoanintegervariable, leadingtounpredictablebehavior. Froma designstandpoint,we observedthatunsignedintegerswereveryrarely, if ever, usedfor arithmeticpurposes,butinpracticeweremuchmoreoftenused askeysoridentifiers.Inthiscase,thesignisirrelevant.Signed integersserve thissamepurposeandcanbesafelycasttotheir unsignedcounterparts(mostcommonlyinC++)whenabsolutely necessary. 2.2Structs AThriftstructdefinesa commonobjecttobeusedacrosslan- guages.Astructisessentiallyequivalenttoa classinobjectori- entedprogramminglanguages.A structhasa setofstronglytyped fields,eachwitha uniquenameidentifier. Thebasicsyntaxfor defininga Thriftstructlooksverysimilartoa C structdefinition. Fieldsmaybeannotatedwithanintegerfieldidentifier(uniqueto thescopeofthatstruct)andoptionaldefaultvalues.Fieldidentifiers willbeautomaticallyassignedif omitted,thoughthey arestrongly encouragedforversioningreasonsdiscussedlater. 2.3Containers Thriftcontainersarestronglytypedcontainersthatmaptothemost commonlyusedcontainersincommonprogramminglanguages. They areannotatedusingtheC++template(orJava Generics)style. Therearethreetypesavailable:  list<type>Anorderedlistofelements.Translatesdirectly intoanSTLvector, JavaArrayList, ornative arrayinscript- inglanguages.Maycontainduplicates.  set<type>Anunorderedsetofuniqueelements.Translates intoanSTLset, JavaHashSet,setinPython,ornative dictionaryinPHP/Ruby.  map<type1,type2>Amapofstrictlyuniquekeystovalues TranslatesintoanSTLmap, JavaHashMap, PHPassociative array, orPython/Rubydictionary. Whiledefaultsareprovided,thetypemappingsarenotexplic- itlyfixed.Customcodegeneratordirectiveshave beenaddedto substitutecustomtypesindestinationlanguages(i.e.hash mapor Google’s sparsehashmapcanbeusedinC++).Theonlyrequire- mentisthatthecustomtypessupportallthenecessaryiteration primitives.Containerelementsmaybeofany validThrifttype,in- cludingothercontainersorstructs. structExample{ 1:i32number=10, 2:i64bigNumber, 3:doubledecimals, 4:stringname="thrifty" } Inthetargetlanguage,eachdefinitiongeneratesa typewithtwo methods,readandwrite, whichperformserializationandtrans- portoftheobjectsusinga ThriftTProtocolobject. 2.4Exceptions Exceptionsaresyntacticallyandfunctionallyequivalenttostructs exceptthatthey aredeclaredusingtheexceptionkeywordinstead ofthestructkeyword. Thegeneratedobjectsinheritfromanexceptionbaseclassasap- propriateineachtargetprogramminglanguage,inordertoseam- lesslyintegratewithnative exceptionhandlinginany givenlan- guage.Again,thedesignemphasisis onmakingthecodefamiliar totheapplicationdeveloper. 2.5Services ServicesaredefinedusingThrifttypes.Definitionofa serviceis semanticallyequivalenttodefininganinterface(ora purevirtual abstractclass)in objectorientedprogramming.TheThriftcompiler generatesfullyfunctionalclientandserver stubsthatimplementthe interface.Servicesaredefinedasfollows: service<name>{ <returntype><name>(<arguments>) [throws(<exceptions>)] ... } Anexample: serviceStringCache{ voidset(1:i32key,2:stringvalue), stringget(1:i32key)throws(1:KeyNotFoundknf), voiddelete(1:i32key) } Notethatvoidisa validtypefora functionreturn,inaddition toallotherdefinedThrifttypes.Additionally, anasyncmodifier keywordmaybeaddedtoavoidfunction,whichwillgenerate codethatdoesnotwaitfora responsefromtheserver. Notethata purevoidfunctionwillretur

Excerpt from a page describing this subject · 38,933 chars · not written by Vinony

Wikidata facts

Official website
thrift.apache.org
Show 11 more facts
operating system
Microsoft Windows
software version identifier
0.22.0
programmed in
Smalltalk
source code repository URL
github.com/apache/thrift.git
publication date
2007-00-00
inception
2012-04-14
Commons category
Apache Thrift
Sources (3)

via Wikidata · CC0

Article · Français

Thrift est un langage de définition d'interface (IDL) conçu pour la création et la définition de services pour de nombreux langages.Il est utilisé en tant que framework RPC et a été développé par Facebook pour le « développement de services évolutifs multilangage ». Une pile logicielle est jointe à un moteur de génération de code, permettant la création de services fonctionnant plus ou moins efficacement et en continu entre C#, C++ (sur systèmes POSIX), Cappuccino, Cocoa, D, Erlang, Go, Haskell, Java, Node.js, OCaml, Perl, PHP, Python, Ruby, et Smalltalk. Bien que développé par Facebook, il est désormais un logiciel libre hébergé par la fondation Apache. L'implémentation a été décrite en avril 2007 dans un livre technique publié par Facebook, actuellement hébergé par Apache.

Abstract from DBpedia / Wikipedia · CC BY-SA

Available in 10 languages

via Wikidata sitelinks · CC0

Connections

Categories