프로젝트
GitHub에서 보기
airlift/drift
소개
An annotation-based Java library for creating Thrift serializable types and services.
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalDrift
Drift is an easy-to-use, annotation-based Java library for creating Thrift clients and serializable types. The client library is similar to JAX-RS (HTTP Rest) and the serialization library is similar to JaxB (XML) and Jackson (JSON), but for Thrift.
Example
The following interface defines a client for a Scribe server:
@ThriftService
public interface Scribe
{
@ThriftMethod
ResultCode log(List<LogEntry> messages);
}
The log method above uses the LogEntry Thrift struct which is defined as follows:
@ThriftStruct
public class LogEntry
{
private final String category;
private final String message;
@ThriftConstructor
public LogEntry(String category, String message)
{
this.category = category;
this.message = message;
}
@ThriftField(1)
public String getCategory()
{
return category;
}
@ThriftField(2)
public String getMessage()
{
return message;
}
}
An instance of the Scribe client can be created using a DriftClientFactory:
// create a client
Scribe scribe = clientFactory.createDriftClient(Scribe.class);
// use client
scribe.log(Arrays.asList(new LogEntry("category", "message")));
Detailed Documentation
- Drift Codec -- Thrift type annotations and serialization
- Drift Client -- Thrift client usage
- Drift Server -- Thrift server usage
관련 프로젝트 살펴보기
불러오는 중…