concept parameter in category apache thrift

appears as: parameter, parameters, parameters, parameter, The parameter
Programmer's Guide to Apache Thrift

This is an excerpt from Manning's book Programmer's Guide to Apache Thrift.

The trivial Date type 1 illustrated in pseudo code above has the exact fields described in the IDL and is organized into a class with the same name as the IDL struct. The Apache Thrift compiler creates read() 2 and write() 3 methods to automate the process of serializing the type through the Apache Thrift TProtocol interface. This makes transmitting a complex data structure as easy as calling read or write on the structure with the target Apache Thrift Protocol as a parameter.

  • required—The parameter must always be present and can never be changed or removed without violating the interface contract:
    void myFunc( 1: required i32 fieldName )
  • void myFunc( 1: required i32 fieldName )
  • <default>—The parameter is always supplied by the caller if it’s known to the caller; however, the service providing the function cannot count on the parameter being supplied, thus providing support for clients which predate the addition of the parameter:
    void myFunc( 1: i32 fieldName )
  • 8.1.1. Parameter identifiers

    Parameter identifiers (IDs) are used by the Apache Thrift framework to uniquely identify parameters during RPC processing. Identifiers are declared by placing an integer value followed by a colon at the beginning of a parameter declaration. Here’s an example function with two parameters identified by the IDs 1 and 2: