SlideShare uma empresa Scribd logo
1 de 52
맛보기




      Apache Thrift

            김용환
      knight76.tistory.com
서론
Thrift
•  a software framework for scalable cross language
  service development. It combines software stack
  with a code generation engine to build services that
  work efficiently and seamlessly
• Provides cross-language RPC and serialization library
• 지원 언어 :
  C++ ,C# ,Cocoa ,Erlang ,Haskell ,Java ,Ocaml ,Perl ,P
  HP ,Python ,Ruby ,Smalltalk
• Champion
    – Doug Cutting (하둡)
• Apache license
Powered by Thrift
Support Protocol
• 많은 곳에서 통신 규약으로 사용하는 중
장점
• 버전닝 지원
• 여러 언어에서 사용 가능하며 언어에 맞도록 소스가 생성되고, 언어
  간의 Serialization 가능
• Sync, Async API 제공
• XML 설정이 필요 없음
• Layer에 맞는 Interface를 사용 및 Customizing 구축 가능
• RPC 기능 제공 (Google Protocol Buffer에는 없는 기능)
   – 서버 기능 좋음
      •   서블릿 제공(org.apache.thrift.server.TServlet)
      •   멀티쓰레드 지원 (org.apache.thrift.server.ThreadPoolServer : worker thread 지정)
      •   Async 지원 (org.apache.thrift.server. TNonblockingServer : single threaded)
      •   Multi-thread Half-Sync/Half-Async지원 : org.apache.thrift.server. THsHaServer
• Exception을 제공 (Google Protocol Buffer에는 없는 기능)
• Set, Map 지원 (Google Protocol Buffer에는 없는 기능)
단점 ?
• 자바로 코드가 생성될 때, Slf4j를 기본적으로 가지고
  가며, 내부 코드는 모두 thrift lib가 필요함
• C++의 Server threading part는 Boost에 의존을 가짐
• 자바 쪽 이클립스 플러그인 없음
• Thrift lib의 api가 자주 바뀌어서, 버전 업마다 소스를
  좀 보고 코딩해야 함. (인터넷 예제가 거의 없음)
• XML Serialization/Deserialization 기능 없음
• 문서가 확실히 적음
• 생성된 코드가 Google Protocol Buffer에 비해서 보기
  는 편하지는 않음 (특히 C++)
download
• http://thrift.apache.org/download/
설치 및 사용
• 원래는 configure/make를 필요 (리눅스/윈도우)
• 윈도우는 그냥 실행하면 됨 (여기서는 윈도우 버전으로
  만 테스트)
(소스 컴파일시)
         Basic requirements
• A relatively POSIX-compliant *NIX system
  – Cygwin or MinGW can be used on Windows
• g++ 3.3.5+
• boost 1.33.1+ (1.34.0 for building all
  tests)
• Runtime libraries for lex and yacc might
  be needed for the compiler.
(소스 컴파일시)
             Language requirements
•   C++
     – Boost 1.33.1+
     – libevent (optional, to build the nonblocking server)
     – zlib (optional)
•   Java
     –   Java 1.5+
     –   Apache Ant
     –   Apache Ivy (recommended)
     –   Apache Commons Lang (recommended)
     –   SLF4J
•   C#: Mono 1.2.4+ (and pkg-config to detect it) or Visual Studio 2005+
•   Python 2.4+ (including header files for extension modules)
•   PHP 5.0+ (optionally including header files for extension modules)
•   Ruby 1.8+ (including header files for extension modules)
•   Erlang R12 (R11 works but not recommended)
•   Perl 5
     – Bit::Vector
     – Class::Accessor
History
• Originally developed by Facebook
• Donated to apache
  apache incubator
• Now 상위 프로젝트
  http://thrift.apache.org/
Interface definition


                             Code
  Interface                                            컴파일
                           generator
    생성                                                  코드
                             실행



.thrift 파일 작성
                 실행
                 thrift -gen java -gen py foo.thrift
예제
Thrift파일
                                                     샘플 #1
service HelloWorld {
              oneway void hello(1:string name)
}


C:thrift>thrift-0.7.0.exe --gen java HelloWorld.thrift
  Generated Code
public class HelloWorld {
  public interface Iface {
     public void hello(String name) throws org.apache.thrift.TException;
   }

 public interface AsyncIface {
    public void hello(String name, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.hello_call> resultHandler) throws
org.apache.thrift.TException;
  }

 public static class Client extends org.apache.thrift.TServiceClient implements Iface {
  …
  }

  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
  …
  }

 public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor          {
  }

 public static class hello_args implements org.apache.thrift.TBase<hello_args, hello_args._Fields>, java.io.Serializable, Cloneable   {
  …
  }
Server Code : 사용자는 generated code를 상속하고.Thrift API를 이용해서 포트매핑
public class HelloWorldServer {

          public static void main(String[] argss) {
                      try {
                                  Factory portFactory = new TBinaryProtocol.Factory(true, true);
                                  TServerSocket serverTransport = new TServerSocket(8000);
                                  HelloWorld.Processor<HelloWorld.Iface> processor =
                                             new HelloWorld.Processor<HelloWorld.Iface>(new
HelloWorldImpl());
                                  Args args = new Args(serverTransport);
                                  args.processor(processor);
                                  args.protocolFactory(portFactory);
                                  TServer server = new TThreadPoolServer(args);
                                  System.out.println("Starting server on port 8000 ...");
                                  server.serve();
                      } catch (TTransportException e) {
                                  e.printStackTrace();
                      }
          }
}

class HelloWorldImpl implements HelloWorld.Iface {
           @Override
           public void hello(String name) throws TException {
                      long time = System.currentTimeMillis();
                      System.out.println("Current time : " + time);
                      System.out.println("Hello " + name);
           }
}
Client Code



public class HelloWorldClient {
            public static void main(String[] args) {
                        TTransport transport;
                        try {
                                    transport = new TSocket("localhost", 8000);
                                    TProtocol protocol = new TBinaryProtocol(transport);
                                    HelloWorld.Client client = new HelloWorld.Client(protocol);
                                    transport.open();
                                    client.hello("World!!!");
                                    transport.close();
                        } catch (Exception e) {
                                    e.printStackTrace();
                        }
            }
}




                                                실행결과

Starting server on port 8000 ...
Current time : 1317014309989
Hello World!!!
Client/Server 의 pom.xml
  • Slf4j와 thrift library가 있어야 컴파일 됨

<dependencies>
<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>1.6.2</version>
</dependency>

<dependency>
  <groupId>org.apache.thrift</groupId>
  <artifactId>libthrift</artifactId>
  <version>0.7.0</version>
</dependency>

</dependencies>
생성된 소스
• C++




• Java
샘플 #2


exception MathException {
  1 : string message
}

service CalculatorServicef {
  i32 add (1 : i32 a , 2 : i32 b )
  i32 subtract (1 : i32 a , 2 : i32 b )
  double divide (1 : double a , 2 : double b ) throws (1 : MathException me)
}
생성된 소스
자바
클래스
샘플 #3
namespace cpp thrift.example
namespace java thrift.example

enum TweetType {
TWEET,
RETWEET = 2,
DM = 0xa,
REPLY
}
struct Location {
1: required double latitude;
2: required double longitude;
}
struct Tweet {
1: required i32 userId;
2: required string userName;
3: required string text;
4: optional Location loc;
5: optional TweetType tweetType = TweetType.TWEET;
16: optional string language = "english";
}
typedef list<Tweet> TweetList
struct TweetSearchResult {
1: TweetList tweets;
}
const i32 MAX_RESULTS = 100;
service Twitter {
void ping(),
bool postTweet(1:Tweet tweet);
TweetSearchResult searchTweets(1:string query);
oneway void zip()
}
생성 파일




• 상수는 Constants클래스로.
• Enum은 org.apache.thrift.TEnum 을 상속
  받은 java enum으로 변경
Type
Types
• C/C++ style typedefs.
  typedef i32 MyInteger
  Typedef StrutType SStruct

• Enum
  enum TweetType {
    TWEET,
    RETWEET = 2,
    DM = 0xa,
    REPLY
  }

  struct Tweet {
     1: required i32 userId;
     2: optional TweetType tweetType = TweetType.TWEET
  }
기타
• comments
  – /* */
  – //
• namespace
  namespace java com.example.project


• Include
  include "tweet.thrift”
  ...
  struct TweetSearchResult {
  1: list<tweet.Tweet> tweets;
  }
기타
• Constants
  const i32 INT_CONST = 1234;
  const map<string,string> MAP_CONST = {"hello": "world",
  "goodnight": "moon"}

• 안되는 것
  –   cyclic structs
  –   Polymorphism
  –   Overloading
  –   null return
  –   heterogeneous containers : items in a container
      must be of the same type (자바 generic을 생각)
IDL>Java
•   bool: boolean
•   byte: byte
•   i16: short
•   i32: int
•   i64: long
•   double: double
•   string: String
•   list<type>: List<type>
•   set<type>: Set<type>
•   Map<key, value>: Map<key, value>
•   Typedef a b : just B
IDL->C++
•   bool: bool
•   byte: int8_t
•   i16: int16_t
•   i32: int32_t
•   i64: int64_t
•   double: double
•   string: std::string
•   list<t1>: std::vector<t1>
•   set<t1>: std::set<t1>
•   map<t1,t2>: std::map<T1, T2>
Types
• Basic type
   – bool, byte, int(i16, i32, i64), double, string
• Containers
   – list<type>
   – Set<type>
   – Map<keyType, valueType>
• Struct (c와 비슷)
   – Struct안에 struct과 enum 사용가능
   – But, 선언은 {} 밖에서 해야 함. 안에서 선언금지
   – 상속 안됨
• Exception
   – Structs
• Service
   – Services are defined using Thrift types
Stacks
Flow
Thrift Network Stack
LanguageSupport
•   http://wiki.apache.org/thrift/LibraryFeatures?action=show&redirect=Langu
    ageSupport
                                                                     (2011.9.25)
Thrift Network Stack
Transport Layer
• TFileTransport – This transport writes to a file.
• TFramedTransport – This transport is required
  when using a non-blocking server. It sends data
  in frames, where each frame is preceded by a
  length information.
• TMemoryTransport – Uses memory for I/O. The
  Java implementation uses a simple
  ByteArrayOutputStream internally.
• TSocket – Uses blocking socket I/O for transport.
• TZlibTransport – Performs compression using zlib.
  Used in conjunction with another transport. Not
  available in the Java implementation.
Transport interface
•   Open
•   Close
•   Read
•   Write
•   Flush
Server Transport interface
•   Open
•   Listen
•   Accept
•   Close


    • file: read/write to/from a file on disk
    • http: as the name suggests
Thrift Network Stack
Protocol layer
• TBinaryProtocol – A straight-forward binary format
  encoding numeric values as binary. It is faster than
  the text protocol but more difficult to debug.
• TCompactProtocol – Very efficient, dense encoding
  of data.
• TDebugProtocol – Uses a human-readable text
  format to aid in debugging.
• TDenseProtocol – Similar to TCompactProtocol,
  striping off the meta information from what is
  transmitted.
• TJSONProtocol – Uses JSON for encoding of data.
• TSimpleJSONProtocol – A write-only protocol using
  JSON. Suitable for parsing by scripting languages.
Protocol interface
writeMessageBegin(name, type, seq)
writeMessageEnd()
writeStructBegin(name)
writeStructEnd()
writeFieldBegin(name, type, id)
writeFieldEnd()
writeFieldStop()
writeMapBegin(ktype, vtype, size)
writeMapEnd()
writeListBegin(etype, size)
writeListEnd()
writeSetBegin(etype, size)
writeSetEnd()
writeBool(bool)
writeByte(byte)
writeI16(i16)
writeI32(i32)
…
…
..
Json Serialization
    Thrift
struct Job {
  1: i32 num1 = 0,
  2: i32 num2,
}

Generated Java Code by Compiler
public class Job implements org.apache.thrift.TBase<Job, Job._Fields>, java.io.Serializable,
Cloneable {
.....
}

 Java code

Job job;
….

TSerializer serializer = new TSerializer(new TSimpleJSONProtocol.Factory());
String json = serializer.toString( job);
Binary Serialization

 Java code
// serialization code
TSerializer serializer = new TSerializer(new TBinaryProtocol.Factory());
byte[] bytes = serializer.serialize(new Job());

// deserialization code
TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());
Job job= new Job();
deserializer.deserialize( job, bytes);
Thrift Network Stack
processor
• Thrift 컴파일러에 의해서 interface에 맞는
  processor가 생성됨
• Processor는 input/ouput stream을 관장하
  는 클래스(encapsulates the ability to read
  data from input streams and write to
  output streams.)
  interface TProcessor {
  bool process(TProtocol in, TProtocol out) throws TException
  }
Thrift Network Stack
Server Layer
• TNonblockingServer – A multi-threaded
  server using non-blocking io (Java
  implementation uses NIO channels).
  TFramedTransport must be used with
  this server.
• TSimpleServer – A single-threaded server
  using std blocking io. Useful for testing.
• TThreadPoolServer – A multi-threaded
  server using std blocking io.
기타
기존 IDL를 변경할 때..
• 기존 IDL를 바꿀때마다 고생하지 않아도 되는
  방법
 – Don’t change the numeric tags for any existing
   fields.
 – Any new fields that you add should be optional.
 – Non-required fields can be removed, as long as
   the tag number is not used again in your
   updated message type
    "OBSOLETE_“으로 이름 변경하기
 – Changing a default value is generally OK, as
   long as you remember that default values are
   never sent over the wire.
Thrift API
• http://people.apache.org/~jfarrell/thrift/0.
  7.0/javadoc/
끝

Mais conteúdo relacionado

Mais procurados

Apache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language CommunicationApache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language CommunicationPiyush Goel
 
The Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compilerThe Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compilerVladimir Sedach
 
Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)N Masahiro
 
PHPCR e API Platform: cosa significa davvero sviluppare un CMF con Symfony
PHPCR e API Platform: cosa significa davvero sviluppare un CMF con SymfonyPHPCR e API Platform: cosa significa davvero sviluppare un CMF con Symfony
PHPCR e API Platform: cosa significa davvero sviluppare un CMF con SymfonyInnoteam Srl
 
Apache AVRO (Boston HUG, Jan 19, 2010)
Apache AVRO (Boston HUG, Jan 19, 2010)Apache AVRO (Boston HUG, Jan 19, 2010)
Apache AVRO (Boston HUG, Jan 19, 2010)Cloudera, Inc.
 
JRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing WorldJRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing WorldSATOSHI TAGOMORI
 
NativeBoost
NativeBoostNativeBoost
NativeBoostESUG
 
Fluentd unified logging layer
Fluentd   unified logging layerFluentd   unified logging layer
Fluentd unified logging layerKiyoto Tamura
 
Hack Programming Language
Hack Programming LanguageHack Programming Language
Hack Programming LanguageRadu Murzea
 
Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12N Masahiro
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architectureElizabeth Smith
 
Fluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsFluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsSATOSHI TAGOMORI
 
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1Felipe Prado
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in LispVladimir Sedach
 
Fluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellFluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellN Masahiro
 

Mais procurados (20)

Apache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language CommunicationApache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language Communication
 
The Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compilerThe Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compiler
 
Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)
 
PHPCR e API Platform: cosa significa davvero sviluppare un CMF con Symfony
PHPCR e API Platform: cosa significa davvero sviluppare un CMF con SymfonyPHPCR e API Platform: cosa significa davvero sviluppare un CMF con Symfony
PHPCR e API Platform: cosa significa davvero sviluppare un CMF con Symfony
 
Apache AVRO (Boston HUG, Jan 19, 2010)
Apache AVRO (Boston HUG, Jan 19, 2010)Apache AVRO (Boston HUG, Jan 19, 2010)
Apache AVRO (Boston HUG, Jan 19, 2010)
 
Fluentd meetup in japan
Fluentd meetup in japanFluentd meetup in japan
Fluentd meetup in japan
 
JRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing WorldJRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing World
 
NativeBoost
NativeBoostNativeBoost
NativeBoost
 
Fluentd unified logging layer
Fluentd   unified logging layerFluentd   unified logging layer
Fluentd unified logging layer
 
Hack and HHVM
Hack and HHVMHack and HHVM
Hack and HHVM
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Hack Programming Language
Hack Programming LanguageHack Programming Language
Hack Programming Language
 
Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
 
Fluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsFluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API Details
 
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
 
Fluentd and WebHDFS
Fluentd and WebHDFSFluentd and WebHDFS
Fluentd and WebHDFS
 
Fluentd introduction at ipros
Fluentd introduction at iprosFluentd introduction at ipros
Fluentd introduction at ipros
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
 
Fluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellFluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshell
 

Destaque

Mongo DB로 진행하는 CRUD
Mongo DB로 진행하는 CRUDMongo DB로 진행하는 CRUD
Mongo DB로 진행하는 CRUDJin wook
 
아파치 쓰리프트 (Apache Thrift)
아파치 쓰리프트 (Apache Thrift) 아파치 쓰리프트 (Apache Thrift)
아파치 쓰리프트 (Apache Thrift) Jin wook
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftTalentica Software
 
Illustration of TextSecure's Protocol Buffer usage
Illustration of TextSecure's Protocol Buffer usageIllustration of TextSecure's Protocol Buffer usage
Illustration of TextSecure's Protocol Buffer usageChristine Corbett Moran
 
Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Accenture
 
Hive User Meeting March 2010 - Hive Team
Hive User Meeting March 2010 - Hive TeamHive User Meeting March 2010 - Hive Team
Hive User Meeting March 2010 - Hive TeamZheng Shao
 
Hive Object Model
Hive Object ModelHive Object Model
Hive Object ModelZheng Shao
 
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...Amazon Web Services
 
Data Science & Best Practices for Apache Spark on Amazon EMR
Data Science & Best Practices for Apache Spark on Amazon EMRData Science & Best Practices for Apache Spark on Amazon EMR
Data Science & Best Practices for Apache Spark on Amazon EMRAmazon Web Services
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonIgor Anishchenko
 
Best Practices for Using Apache Spark on AWS
Best Practices for Using Apache Spark on AWSBest Practices for Using Apache Spark on AWS
Best Practices for Using Apache Spark on AWSAmazon Web Services
 
AWS re:Invent 2016: Big Data Architectural Patterns and Best Practices on AWS...
AWS re:Invent 2016: Big Data Architectural Patterns and Best Practices on AWS...AWS re:Invent 2016: Big Data Architectural Patterns and Best Practices on AWS...
AWS re:Invent 2016: Big Data Architectural Patterns and Best Practices on AWS...Amazon Web Services
 
Spark 2.x Troubleshooting Guide
Spark 2.x Troubleshooting GuideSpark 2.x Troubleshooting Guide
Spark 2.x Troubleshooting GuideIBM
 
Apache big data 2016 - Speaking the language of Big Data
Apache big data 2016 - Speaking the language of Big DataApache big data 2016 - Speaking the language of Big Data
Apache big data 2016 - Speaking the language of Big Datatechmaddy
 
Secured (Kerberos-based) Spark Notebook for Data Science: Spark Summit East t...
Secured (Kerberos-based) Spark Notebook for Data Science: Spark Summit East t...Secured (Kerberos-based) Spark Notebook for Data Science: Spark Summit East t...
Secured (Kerberos-based) Spark Notebook for Data Science: Spark Summit East t...Spark Summit
 
Bulletproof Jobs: Patterns for Large-Scale Spark Processing: Spark Summit Eas...
Bulletproof Jobs: Patterns for Large-Scale Spark Processing: Spark Summit Eas...Bulletproof Jobs: Patterns for Large-Scale Spark Processing: Spark Summit Eas...
Bulletproof Jobs: Patterns for Large-Scale Spark Processing: Spark Summit Eas...Spark Summit
 
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...What No One Tells You About Writing a Streaming App: Spark Summit East talk b...
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...Spark Summit
 
Amazon EMR Deep Dive & Best Practices
Amazon EMR Deep Dive & Best PracticesAmazon EMR Deep Dive & Best Practices
Amazon EMR Deep Dive & Best PracticesAmazon Web Services
 

Destaque (19)

Mongo DB로 진행하는 CRUD
Mongo DB로 진행하는 CRUDMongo DB로 진행하는 CRUD
Mongo DB로 진행하는 CRUD
 
아파치 쓰리프트 (Apache Thrift)
아파치 쓰리프트 (Apache Thrift) 아파치 쓰리프트 (Apache Thrift)
아파치 쓰리프트 (Apache Thrift)
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
Illustration of TextSecure's Protocol Buffer usage
Illustration of TextSecure's Protocol Buffer usageIllustration of TextSecure's Protocol Buffer usage
Illustration of TextSecure's Protocol Buffer usage
 
Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库
 
Hive User Meeting March 2010 - Hive Team
Hive User Meeting March 2010 - Hive TeamHive User Meeting March 2010 - Hive Team
Hive User Meeting March 2010 - Hive Team
 
Hive Object Model
Hive Object ModelHive Object Model
Hive Object Model
 
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
 
Facebook thrift
Facebook thriftFacebook thrift
Facebook thrift
 
Data Science & Best Practices for Apache Spark on Amazon EMR
Data Science & Best Practices for Apache Spark on Amazon EMRData Science & Best Practices for Apache Spark on Amazon EMR
Data Science & Best Practices for Apache Spark on Amazon EMR
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased Comparison
 
Best Practices for Using Apache Spark on AWS
Best Practices for Using Apache Spark on AWSBest Practices for Using Apache Spark on AWS
Best Practices for Using Apache Spark on AWS
 
AWS re:Invent 2016: Big Data Architectural Patterns and Best Practices on AWS...
AWS re:Invent 2016: Big Data Architectural Patterns and Best Practices on AWS...AWS re:Invent 2016: Big Data Architectural Patterns and Best Practices on AWS...
AWS re:Invent 2016: Big Data Architectural Patterns and Best Practices on AWS...
 
Spark 2.x Troubleshooting Guide
Spark 2.x Troubleshooting GuideSpark 2.x Troubleshooting Guide
Spark 2.x Troubleshooting Guide
 
Apache big data 2016 - Speaking the language of Big Data
Apache big data 2016 - Speaking the language of Big DataApache big data 2016 - Speaking the language of Big Data
Apache big data 2016 - Speaking the language of Big Data
 
Secured (Kerberos-based) Spark Notebook for Data Science: Spark Summit East t...
Secured (Kerberos-based) Spark Notebook for Data Science: Spark Summit East t...Secured (Kerberos-based) Spark Notebook for Data Science: Spark Summit East t...
Secured (Kerberos-based) Spark Notebook for Data Science: Spark Summit East t...
 
Bulletproof Jobs: Patterns for Large-Scale Spark Processing: Spark Summit Eas...
Bulletproof Jobs: Patterns for Large-Scale Spark Processing: Spark Summit Eas...Bulletproof Jobs: Patterns for Large-Scale Spark Processing: Spark Summit Eas...
Bulletproof Jobs: Patterns for Large-Scale Spark Processing: Spark Summit Eas...
 
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...What No One Tells You About Writing a Streaming App: Spark Summit East talk b...
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...
 
Amazon EMR Deep Dive & Best Practices
Amazon EMR Deep Dive & Best PracticesAmazon EMR Deep Dive & Best Practices
Amazon EMR Deep Dive & Best Practices
 

Semelhante a Apache Thrift

Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojureAbbas Raza
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsAzul Systems, Inc.
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
Sharding and Load Balancing in Scala - Twitter's Finagle
Sharding and Load Balancing in Scala - Twitter's FinagleSharding and Load Balancing in Scala - Twitter's Finagle
Sharding and Load Balancing in Scala - Twitter's FinagleGeoff Ballinger
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkAarti Parikh
 
Tornado Web Server Internals
Tornado Web Server InternalsTornado Web Server Internals
Tornado Web Server InternalsPraveen Gollakota
 
The Swift Compiler and Standard Library
The Swift Compiler and Standard LibraryThe Swift Compiler and Standard Library
The Swift Compiler and Standard LibrarySantosh Rajan
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCTim Burks
 
The State of containerd
The State of containerdThe State of containerd
The State of containerdMoby Project
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side SwiftChad Moone
 
Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011Jimmy Schementi
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Codemotion
 
Lambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeLambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeIan Robertson
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java DevelopersYakov Fain
 

Semelhante a Apache Thrift (20)

Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 
Dr archana dhawan bajaj - c# dot net
Dr archana dhawan bajaj - c# dot netDr archana dhawan bajaj - c# dot net
Dr archana dhawan bajaj - c# dot net
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Python, do you even async?
Python, do you even async?Python, do you even async?
Python, do you even async?
 
Sharding and Load Balancing in Scala - Twitter's Finagle
Sharding and Load Balancing in Scala - Twitter's FinagleSharding and Load Balancing in Scala - Twitter's Finagle
Sharding and Load Balancing in Scala - Twitter's Finagle
 
Solr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene EuroconSolr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene Eurocon
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
 
Tornado Web Server Internals
Tornado Web Server InternalsTornado Web Server Internals
Tornado Web Server Internals
 
The Swift Compiler and Standard Library
The Swift Compiler and Standard LibraryThe Swift Compiler and Standard Library
The Swift Compiler and Standard Library
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPC
 
The State of containerd
The State of containerdThe State of containerd
The State of containerd
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
 
Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
 
OpenCL Heterogeneous Parallel Computing
OpenCL Heterogeneous Parallel ComputingOpenCL Heterogeneous Parallel Computing
OpenCL Heterogeneous Parallel Computing
 
Java
JavaJava
Java
 
Lambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeLambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive Code
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 

Mais de knight1128

Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)
Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)
Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)knight1128
 
Spring MVC 3 Restful
Spring MVC 3 RestfulSpring MVC 3 Restful
Spring MVC 3 Restfulknight1128
 
Jersey framework
Jersey frameworkJersey framework
Jersey frameworkknight1128
 
Google Protocol buffer
Google Protocol bufferGoogle Protocol buffer
Google Protocol bufferknight1128
 
Jdk(java) 7 - 5. invoke-dynamic
Jdk(java) 7 - 5. invoke-dynamicJdk(java) 7 - 5. invoke-dynamic
Jdk(java) 7 - 5. invoke-dynamicknight1128
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능knight1128
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoinknight1128
 
공유 Jdk 7-2-project coin
공유 Jdk 7-2-project coin공유 Jdk 7-2-project coin
공유 Jdk 7-2-project coinknight1128
 
공유 Jdk 7-1-short introduction
공유 Jdk 7-1-short introduction공유 Jdk 7-1-short introduction
공유 Jdk 7-1-short introductionknight1128
 
아마존 Aws 서비스_연구
아마존 Aws 서비스_연구아마존 Aws 서비스_연구
아마존 Aws 서비스_연구knight1128
 
구글크롬Os
구글크롬Os구글크롬Os
구글크롬Osknight1128
 
하이브리드앱
하이브리드앱하이브리드앱
하이브리드앱knight1128
 
오픈소스를 활용한 Batch_처리_플랫폼_공유
오픈소스를 활용한 Batch_처리_플랫폼_공유오픈소스를 활용한 Batch_처리_플랫폼_공유
오픈소스를 활용한 Batch_처리_플랫폼_공유knight1128
 
Ssl 하드웨어 가속기를 이용한 성능 향상
Ssl 하드웨어 가속기를 이용한 성능 향상Ssl 하드웨어 가속기를 이용한 성능 향상
Ssl 하드웨어 가속기를 이용한 성능 향상knight1128
 

Mais de knight1128 (19)

Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)
Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)
Hancom MDS Conference - KAKAO DEVOPS Practice (카카오 스토리의 Devops 사례)
 
Comet
CometComet
Comet
 
Apache avro
Apache avroApache avro
Apache avro
 
Redis
RedisRedis
Redis
 
Spring MVC 3 Restful
Spring MVC 3 RestfulSpring MVC 3 Restful
Spring MVC 3 Restful
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
Google Protocol buffer
Google Protocol bufferGoogle Protocol buffer
Google Protocol buffer
 
Jdk(java) 7 - 5. invoke-dynamic
Jdk(java) 7 - 5. invoke-dynamicJdk(java) 7 - 5. invoke-dynamic
Jdk(java) 7 - 5. invoke-dynamic
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoin
 
Jdk 7 3-nio2
Jdk 7 3-nio2Jdk 7 3-nio2
Jdk 7 3-nio2
 
공유 Jdk 7-2-project coin
공유 Jdk 7-2-project coin공유 Jdk 7-2-project coin
공유 Jdk 7-2-project coin
 
공유 Jdk 7-1-short introduction
공유 Jdk 7-1-short introduction공유 Jdk 7-1-short introduction
공유 Jdk 7-1-short introduction
 
아마존 Aws 서비스_연구
아마존 Aws 서비스_연구아마존 Aws 서비스_연구
아마존 Aws 서비스_연구
 
속도체크
속도체크속도체크
속도체크
 
구글크롬Os
구글크롬Os구글크롬Os
구글크롬Os
 
하이브리드앱
하이브리드앱하이브리드앱
하이브리드앱
 
오픈소스를 활용한 Batch_처리_플랫폼_공유
오픈소스를 활용한 Batch_처리_플랫폼_공유오픈소스를 활용한 Batch_처리_플랫폼_공유
오픈소스를 활용한 Batch_처리_플랫폼_공유
 
Ssl 하드웨어 가속기를 이용한 성능 향상
Ssl 하드웨어 가속기를 이용한 성능 향상Ssl 하드웨어 가속기를 이용한 성능 향상
Ssl 하드웨어 가속기를 이용한 성능 향상
 

Último

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Último (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Apache Thrift

  • 1. 맛보기 Apache Thrift 김용환 knight76.tistory.com
  • 3. Thrift • a software framework for scalable cross language service development. It combines software stack with a code generation engine to build services that work efficiently and seamlessly • Provides cross-language RPC and serialization library • 지원 언어 : C++ ,C# ,Cocoa ,Erlang ,Haskell ,Java ,Ocaml ,Perl ,P HP ,Python ,Ruby ,Smalltalk • Champion – Doug Cutting (하둡) • Apache license
  • 5. Support Protocol • 많은 곳에서 통신 규약으로 사용하는 중
  • 6. 장점 • 버전닝 지원 • 여러 언어에서 사용 가능하며 언어에 맞도록 소스가 생성되고, 언어 간의 Serialization 가능 • Sync, Async API 제공 • XML 설정이 필요 없음 • Layer에 맞는 Interface를 사용 및 Customizing 구축 가능 • RPC 기능 제공 (Google Protocol Buffer에는 없는 기능) – 서버 기능 좋음 • 서블릿 제공(org.apache.thrift.server.TServlet) • 멀티쓰레드 지원 (org.apache.thrift.server.ThreadPoolServer : worker thread 지정) • Async 지원 (org.apache.thrift.server. TNonblockingServer : single threaded) • Multi-thread Half-Sync/Half-Async지원 : org.apache.thrift.server. THsHaServer • Exception을 제공 (Google Protocol Buffer에는 없는 기능) • Set, Map 지원 (Google Protocol Buffer에는 없는 기능)
  • 7. 단점 ? • 자바로 코드가 생성될 때, Slf4j를 기본적으로 가지고 가며, 내부 코드는 모두 thrift lib가 필요함 • C++의 Server threading part는 Boost에 의존을 가짐 • 자바 쪽 이클립스 플러그인 없음 • Thrift lib의 api가 자주 바뀌어서, 버전 업마다 소스를 좀 보고 코딩해야 함. (인터넷 예제가 거의 없음) • XML Serialization/Deserialization 기능 없음 • 문서가 확실히 적음 • 생성된 코드가 Google Protocol Buffer에 비해서 보기 는 편하지는 않음 (특히 C++)
  • 9. 설치 및 사용 • 원래는 configure/make를 필요 (리눅스/윈도우) • 윈도우는 그냥 실행하면 됨 (여기서는 윈도우 버전으로 만 테스트)
  • 10. (소스 컴파일시) Basic requirements • A relatively POSIX-compliant *NIX system – Cygwin or MinGW can be used on Windows • g++ 3.3.5+ • boost 1.33.1+ (1.34.0 for building all tests) • Runtime libraries for lex and yacc might be needed for the compiler.
  • 11. (소스 컴파일시) Language requirements • C++ – Boost 1.33.1+ – libevent (optional, to build the nonblocking server) – zlib (optional) • Java – Java 1.5+ – Apache Ant – Apache Ivy (recommended) – Apache Commons Lang (recommended) – SLF4J • C#: Mono 1.2.4+ (and pkg-config to detect it) or Visual Studio 2005+ • Python 2.4+ (including header files for extension modules) • PHP 5.0+ (optionally including header files for extension modules) • Ruby 1.8+ (including header files for extension modules) • Erlang R12 (R11 works but not recommended) • Perl 5 – Bit::Vector – Class::Accessor
  • 12. History • Originally developed by Facebook • Donated to apache apache incubator • Now 상위 프로젝트 http://thrift.apache.org/
  • 13. Interface definition Code Interface 컴파일 generator 생성 코드 실행 .thrift 파일 작성 실행 thrift -gen java -gen py foo.thrift
  • 15. Thrift파일 샘플 #1 service HelloWorld { oneway void hello(1:string name) } C:thrift>thrift-0.7.0.exe --gen java HelloWorld.thrift Generated Code public class HelloWorld { public interface Iface { public void hello(String name) throws org.apache.thrift.TException; } public interface AsyncIface { public void hello(String name, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.hello_call> resultHandler) throws org.apache.thrift.TException; } public static class Client extends org.apache.thrift.TServiceClient implements Iface { … } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { … } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { } public static class hello_args implements org.apache.thrift.TBase<hello_args, hello_args._Fields>, java.io.Serializable, Cloneable { … }
  • 16. Server Code : 사용자는 generated code를 상속하고.Thrift API를 이용해서 포트매핑 public class HelloWorldServer { public static void main(String[] argss) { try { Factory portFactory = new TBinaryProtocol.Factory(true, true); TServerSocket serverTransport = new TServerSocket(8000); HelloWorld.Processor<HelloWorld.Iface> processor = new HelloWorld.Processor<HelloWorld.Iface>(new HelloWorldImpl()); Args args = new Args(serverTransport); args.processor(processor); args.protocolFactory(portFactory); TServer server = new TThreadPoolServer(args); System.out.println("Starting server on port 8000 ..."); server.serve(); } catch (TTransportException e) { e.printStackTrace(); } } } class HelloWorldImpl implements HelloWorld.Iface { @Override public void hello(String name) throws TException { long time = System.currentTimeMillis(); System.out.println("Current time : " + time); System.out.println("Hello " + name); } }
  • 17. Client Code public class HelloWorldClient { public static void main(String[] args) { TTransport transport; try { transport = new TSocket("localhost", 8000); TProtocol protocol = new TBinaryProtocol(transport); HelloWorld.Client client = new HelloWorld.Client(protocol); transport.open(); client.hello("World!!!"); transport.close(); } catch (Exception e) { e.printStackTrace(); } } } 실행결과 Starting server on port 8000 ... Current time : 1317014309989 Hello World!!!
  • 18. Client/Server 의 pom.xml • Slf4j와 thrift library가 있어야 컴파일 됨 <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId> <version>0.7.0</version> </dependency> </dependencies>
  • 20. 샘플 #2 exception MathException { 1 : string message } service CalculatorServicef { i32 add (1 : i32 a , 2 : i32 b ) i32 subtract (1 : i32 a , 2 : i32 b ) double divide (1 : double a , 2 : double b ) throws (1 : MathException me) }
  • 23. 샘플 #3 namespace cpp thrift.example namespace java thrift.example enum TweetType { TWEET, RETWEET = 2, DM = 0xa, REPLY } struct Location { 1: required double latitude; 2: required double longitude; } struct Tweet { 1: required i32 userId; 2: required string userName; 3: required string text; 4: optional Location loc; 5: optional TweetType tweetType = TweetType.TWEET; 16: optional string language = "english"; } typedef list<Tweet> TweetList struct TweetSearchResult { 1: TweetList tweets; } const i32 MAX_RESULTS = 100; service Twitter { void ping(), bool postTweet(1:Tweet tweet); TweetSearchResult searchTweets(1:string query); oneway void zip() }
  • 24. 생성 파일 • 상수는 Constants클래스로. • Enum은 org.apache.thrift.TEnum 을 상속 받은 java enum으로 변경
  • 25. Type
  • 26. Types • C/C++ style typedefs. typedef i32 MyInteger Typedef StrutType SStruct • Enum enum TweetType { TWEET, RETWEET = 2, DM = 0xa, REPLY } struct Tweet { 1: required i32 userId; 2: optional TweetType tweetType = TweetType.TWEET }
  • 27. 기타 • comments – /* */ – // • namespace namespace java com.example.project • Include include "tweet.thrift” ... struct TweetSearchResult { 1: list<tweet.Tweet> tweets; }
  • 28. 기타 • Constants const i32 INT_CONST = 1234; const map<string,string> MAP_CONST = {"hello": "world", "goodnight": "moon"} • 안되는 것 – cyclic structs – Polymorphism – Overloading – null return – heterogeneous containers : items in a container must be of the same type (자바 generic을 생각)
  • 29. IDL>Java • bool: boolean • byte: byte • i16: short • i32: int • i64: long • double: double • string: String • list<type>: List<type> • set<type>: Set<type> • Map<key, value>: Map<key, value> • Typedef a b : just B
  • 30. IDL->C++ • bool: bool • byte: int8_t • i16: int16_t • i32: int32_t • i64: int64_t • double: double • string: std::string • list<t1>: std::vector<t1> • set<t1>: std::set<t1> • map<t1,t2>: std::map<T1, T2>
  • 31. Types • Basic type – bool, byte, int(i16, i32, i64), double, string • Containers – list<type> – Set<type> – Map<keyType, valueType> • Struct (c와 비슷) – Struct안에 struct과 enum 사용가능 – But, 선언은 {} 밖에서 해야 함. 안에서 선언금지 – 상속 안됨 • Exception – Structs • Service – Services are defined using Thrift types
  • 33. Flow
  • 35. LanguageSupport • http://wiki.apache.org/thrift/LibraryFeatures?action=show&redirect=Langu ageSupport (2011.9.25)
  • 37. Transport Layer • TFileTransport – This transport writes to a file. • TFramedTransport – This transport is required when using a non-blocking server. It sends data in frames, where each frame is preceded by a length information. • TMemoryTransport – Uses memory for I/O. The Java implementation uses a simple ByteArrayOutputStream internally. • TSocket – Uses blocking socket I/O for transport. • TZlibTransport – Performs compression using zlib. Used in conjunction with another transport. Not available in the Java implementation.
  • 38. Transport interface • Open • Close • Read • Write • Flush
  • 39. Server Transport interface • Open • Listen • Accept • Close • file: read/write to/from a file on disk • http: as the name suggests
  • 41. Protocol layer • TBinaryProtocol – A straight-forward binary format encoding numeric values as binary. It is faster than the text protocol but more difficult to debug. • TCompactProtocol – Very efficient, dense encoding of data. • TDebugProtocol – Uses a human-readable text format to aid in debugging. • TDenseProtocol – Similar to TCompactProtocol, striping off the meta information from what is transmitted. • TJSONProtocol – Uses JSON for encoding of data. • TSimpleJSONProtocol – A write-only protocol using JSON. Suitable for parsing by scripting languages.
  • 42. Protocol interface writeMessageBegin(name, type, seq) writeMessageEnd() writeStructBegin(name) writeStructEnd() writeFieldBegin(name, type, id) writeFieldEnd() writeFieldStop() writeMapBegin(ktype, vtype, size) writeMapEnd() writeListBegin(etype, size) writeListEnd() writeSetBegin(etype, size) writeSetEnd() writeBool(bool) writeByte(byte) writeI16(i16) writeI32(i32) … … ..
  • 43. Json Serialization Thrift struct Job { 1: i32 num1 = 0, 2: i32 num2, } Generated Java Code by Compiler public class Job implements org.apache.thrift.TBase<Job, Job._Fields>, java.io.Serializable, Cloneable { ..... } Java code Job job; …. TSerializer serializer = new TSerializer(new TSimpleJSONProtocol.Factory()); String json = serializer.toString( job);
  • 44. Binary Serialization Java code // serialization code TSerializer serializer = new TSerializer(new TBinaryProtocol.Factory()); byte[] bytes = serializer.serialize(new Job()); // deserialization code TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory()); Job job= new Job(); deserializer.deserialize( job, bytes);
  • 46. processor • Thrift 컴파일러에 의해서 interface에 맞는 processor가 생성됨 • Processor는 input/ouput stream을 관장하 는 클래스(encapsulates the ability to read data from input streams and write to output streams.) interface TProcessor { bool process(TProtocol in, TProtocol out) throws TException }
  • 48. Server Layer • TNonblockingServer – A multi-threaded server using non-blocking io (Java implementation uses NIO channels). TFramedTransport must be used with this server. • TSimpleServer – A single-threaded server using std blocking io. Useful for testing. • TThreadPoolServer – A multi-threaded server using std blocking io.
  • 50. 기존 IDL를 변경할 때.. • 기존 IDL를 바꿀때마다 고생하지 않아도 되는 방법 – Don’t change the numeric tags for any existing fields. – Any new fields that you add should be optional. – Non-required fields can be removed, as long as the tag number is not used again in your updated message type "OBSOLETE_“으로 이름 변경하기 – Changing a default value is generally OK, as long as you remember that default values are never sent over the wire.
  • 52.