MCPcopy Index your code
hub / github.com/airlift/drift

github.com/airlift/drift @1.24

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.24 ↗ · + Follow
3,506 symbols 10,011 edges 413 files 260 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Drift

Maven Central Build Status

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

Extension points exported contracts — how you extend this code

ThriftExtraction (Interface)
ThriftExtraction contains information an extraction point for a single thrift field. Implementations of th [6 implementers]
drift-codec/src/main/java/io/airlift/drift/codec/metadata/ThriftExtraction.java
MethodInvocationFilter (Interface)
(no doc) [22 implementers]
drift-server/src/main/java/io/airlift/drift/server/MethodInvocationFilter.java
MethodInvocationFilter (Interface)
(no doc) [21 implementers]
drift-client/src/main/java/io/airlift/drift/client/MethodInvocationFilter.java
MethodInvoker (Interface)
(no doc) [8 implementers]
drift-transport-spi/src/main/java/io/airlift/drift/transport/client/MethodInvoker.java
Iface (Interface)
(no doc) [13 implementers]
drift-transport-netty/src/test/java/io/airlift/drift/transport/netty/scribe/apache/scribe.java
Iface (Interface)
(no doc) [13 implementers]
drift-transport-apache/src/test/java/io/airlift/drift/transport/apache/scribe/apache/scribe.java
TTransport (Interface)
(no doc) [65 implementers]
drift-protocol/src/main/java/io/airlift/drift/protocol/TTransport.java
Iface (Interface)
(no doc) [13 implementers]
drift-integration-tests/src/test/java/io/airlift/drift/integration/scribe/apache/scribe.java

Core symbols most depended-on inside this repo

add
called by 276
drift-codec/src/main/java/io/airlift/drift/codec/internal/compiler/ThriftCodecByteCodeGenerator.java
get
called by 228
drift-client/src/main/java/io/airlift/drift/client/DriftClient.java
getName
called by 188
drift-codec/src/main/java/io/airlift/drift/codec/metadata/ThriftInjection.java
get
called by 151
drift-codec/src/main/java/io/airlift/drift/codec/metadata/ThriftTypeReference.java
add
called by 96
drift-client/src/main/java/io/airlift/drift/client/ExceptionClassification.java
getType
called by 94
drift-codec/src/main/java/io/airlift/drift/codec/ThriftCodec.java
getId
called by 64
drift-codec/src/main/java/io/airlift/drift/codec/metadata/ThriftInjection.java
build
called by 64
drift-codec/src/main/java/io/airlift/drift/codec/metadata/ThriftUnionMetadataBuilder.java

Shape

Method 2,934
Class 480
Interface 52
Enum 40

Languages

Java100%

Modules by API surface

drift-transport-netty/src/test/java/io/airlift/drift/transport/netty/scribe/apache/scribe.java115 symbols
drift-transport-apache/src/test/java/io/airlift/drift/transport/apache/scribe/apache/scribe.java115 symbols
drift-integration-tests/src/test/java/io/airlift/drift/integration/scribe/apache/scribe.java115 symbols
drift-protocol/src/main/java/io/airlift/drift/protocol/TFacebookCompactProtocol.java65 symbols
drift-protocol/src/main/java/io/airlift/drift/protocol/TCompactProtocol.java65 symbols
drift-codec/src/test/java/io/airlift/drift/codec/metadata/TestThriftMethodMetadata.java50 symbols
drift-protocol/src/main/java/io/airlift/drift/protocol/TBinaryProtocol.java48 symbols
drift-codec/src/test/java/io/airlift/drift/codec/AbstractThriftCodecManagerTest.java48 symbols
drift-transport-netty/src/test/java/io/airlift/drift/transport/netty/scribe/apache/LogEntry.java45 symbols
drift-transport-apache/src/test/java/io/airlift/drift/transport/apache/scribe/apache/LogEntry.java45 symbols
drift-integration-tests/src/test/java/io/airlift/drift/integration/scribe/apache/LogEntry.java45 symbols
drift-codec/src/main/java/io/airlift/drift/codec/internal/ProtocolReader.java45 symbols

For agents

$ claude mcp add drift \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact