ZooKeeper source code analysis-Jute-Part 2, zookeeper-jute-

Source: Internet
Author: User
Tags ustring

ZooKeeper source code analysis-Jute-Part 2, zookeeper-jute-

Data Type and stream

This section describes the basic data types and composite types that support Hadoop. Our goal is to support a series of types that can be used to simplify and effectively express a range of record types in different programming languages.

Basic Type

In most cases, most of Hadoop's basic types are directly mapped to the basic types of advanced programming languages. A special example is the ustring (Unicode string) and buffer type. We believe it can be widely used and usually implemented in library code, rather than as a language-embedded program. When the target language has no built-in implementation and no widely used standard implementation, Hadoop can support them through library code. The complete list of basic data types is as follows:

Byte, boolean, int, long, float, double, ustring, buffer

Combination Type

Haddop supports a small number of combined types to describe simple aggregation types and containers. A composite type is serialized by its components. The combination type includes the following types:

1) Record: similar to the aggregation type of C struct. It is considered as a single data type by combining a series of type fields. A Record is serialized by serializing its composition fields. In addition to serialization, Record also has a comparison function, which is defined as a function for comparing members one by one.

2) vector: A series of collections of the same data type, which can be basic or composite.

3) map: an associated container that maps key-type instances to value-type instances.

Stream

Hadoop automatically generates code serialization and deserialization Record types to convert them into abstract streams. Each target language Haddop defines a very simple input/output stream interface. application developers can develop specific instances of these interfaces by encapsulating specific stream implementation methods.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.