Search in sources :

Example 1 with GetStoreIdRequestEncoder

use of org.neo4j.causalclustering.catchup.storecopy.GetStoreIdRequestEncoder in project neo4j by neo4j.

the class CatchUpClientChannelPipeline method initChannel.

static void initChannel(SocketChannel ch, CatchUpResponseHandler handler, LogProvider logProvider, Monitors monitors) throws Exception {
    CatchupClientProtocol protocol = new CatchupClientProtocol();
    ChannelPipeline pipeline = ch.pipeline();
    pipeline.addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4));
    pipeline.addLast(new LengthFieldPrepender(4));
    pipeline.addLast(new VersionDecoder(logProvider));
    pipeline.addLast(new VersionPrepender());
    pipeline.addLast(new TxPullRequestEncoder());
    pipeline.addLast(new GetStoreRequestEncoder());
    pipeline.addLast(new CoreSnapshotRequestEncoder());
    pipeline.addLast(new GetStoreIdRequestEncoder());
    pipeline.addLast(new ResponseMessageTypeEncoder());
    pipeline.addLast(new RequestMessageTypeEncoder());
    pipeline.addLast(new ClientMessageTypeHandler(protocol, logProvider));
    RequestDecoderDispatcher<CatchupClientProtocol.State> decoderDispatcher = new RequestDecoderDispatcher<>(protocol, logProvider);
    decoderDispatcher.register(CatchupClientProtocol.State.STORE_ID, new GetStoreIdResponseDecoder());
    decoderDispatcher.register(CatchupClientProtocol.State.TX_PULL_RESPONSE, new TxPullResponseDecoder());
    decoderDispatcher.register(CatchupClientProtocol.State.CORE_SNAPSHOT, new CoreSnapshotDecoder());
    decoderDispatcher.register(CatchupClientProtocol.State.STORE_COPY_FINISHED, new StoreCopyFinishedResponseDecoder());
    decoderDispatcher.register(CatchupClientProtocol.State.TX_STREAM_FINISHED, new TxStreamFinishedResponseDecoder());
    decoderDispatcher.register(CatchupClientProtocol.State.FILE_HEADER, new FileHeaderDecoder());
    decoderDispatcher.register(CatchupClientProtocol.State.FILE_CONTENTS, new FileChunkDecoder());
    pipeline.addLast(decoderDispatcher);
    pipeline.addLast(new TxPullResponseHandler(protocol, handler));
    pipeline.addLast(new CoreSnapshotResponseHandler(protocol, handler));
    pipeline.addLast(new StoreCopyFinishedResponseHandler(protocol, handler));
    pipeline.addLast(new TxStreamFinishedResponseHandler(protocol, handler));
    pipeline.addLast(new FileHeaderHandler(protocol, handler, logProvider));
    pipeline.addLast(new FileChunkHandler(protocol, handler));
    pipeline.addLast(new GetStoreIdResponseHandler(protocol, handler));
    pipeline.addLast(new ExceptionLoggingHandler(logProvider.getLog(CatchUpClient.class)));
    pipeline.addLast(new ExceptionMonitoringHandler(monitors.newMonitor(ExceptionMonitoringHandler.Monitor.class, CatchUpClient.class)));
    pipeline.addLast(new ExceptionSwallowingHandler());
}
Also used : CoreSnapshotRequestEncoder(org.neo4j.causalclustering.core.state.snapshot.CoreSnapshotRequestEncoder) ExceptionSwallowingHandler(org.neo4j.causalclustering.handlers.ExceptionSwallowingHandler) VersionPrepender(org.neo4j.causalclustering.VersionPrepender) TxPullResponseDecoder(org.neo4j.causalclustering.catchup.tx.TxPullResponseDecoder) StoreCopyFinishedResponseDecoder(org.neo4j.causalclustering.catchup.storecopy.StoreCopyFinishedResponseDecoder) LengthFieldPrepender(io.netty.handler.codec.LengthFieldPrepender) ExceptionLoggingHandler(org.neo4j.causalclustering.handlers.ExceptionLoggingHandler) TxPullRequestEncoder(org.neo4j.causalclustering.catchup.tx.TxPullRequestEncoder) TxPullResponseHandler(org.neo4j.causalclustering.catchup.tx.TxPullResponseHandler) StoreCopyFinishedResponseHandler(org.neo4j.causalclustering.catchup.storecopy.StoreCopyFinishedResponseHandler) FileChunkDecoder(org.neo4j.causalclustering.catchup.storecopy.FileChunkDecoder) LengthFieldBasedFrameDecoder(io.netty.handler.codec.LengthFieldBasedFrameDecoder) GetStoreIdResponseDecoder(org.neo4j.causalclustering.catchup.storecopy.GetStoreIdResponseDecoder) GetStoreRequestEncoder(org.neo4j.causalclustering.catchup.storecopy.GetStoreRequestEncoder) CoreSnapshotDecoder(org.neo4j.causalclustering.core.state.snapshot.CoreSnapshotDecoder) FileHeaderHandler(org.neo4j.causalclustering.catchup.storecopy.FileHeaderHandler) VersionDecoder(org.neo4j.causalclustering.VersionDecoder) TxStreamFinishedResponseDecoder(org.neo4j.causalclustering.catchup.tx.TxStreamFinishedResponseDecoder) ChannelPipeline(io.netty.channel.ChannelPipeline) TxStreamFinishedResponseHandler(org.neo4j.causalclustering.catchup.tx.TxStreamFinishedResponseHandler) ExceptionMonitoringHandler(org.neo4j.causalclustering.handlers.ExceptionMonitoringHandler) FileHeaderDecoder(org.neo4j.causalclustering.catchup.storecopy.FileHeaderDecoder) GetStoreIdRequestEncoder(org.neo4j.causalclustering.catchup.storecopy.GetStoreIdRequestEncoder) GetStoreIdResponseHandler(org.neo4j.causalclustering.catchup.storecopy.GetStoreIdResponseHandler) CoreSnapshotResponseHandler(org.neo4j.causalclustering.core.state.snapshot.CoreSnapshotResponseHandler) FileChunkHandler(org.neo4j.causalclustering.catchup.storecopy.FileChunkHandler)

Aggregations

ChannelPipeline (io.netty.channel.ChannelPipeline)1 LengthFieldBasedFrameDecoder (io.netty.handler.codec.LengthFieldBasedFrameDecoder)1 LengthFieldPrepender (io.netty.handler.codec.LengthFieldPrepender)1 VersionDecoder (org.neo4j.causalclustering.VersionDecoder)1 VersionPrepender (org.neo4j.causalclustering.VersionPrepender)1 FileChunkDecoder (org.neo4j.causalclustering.catchup.storecopy.FileChunkDecoder)1 FileChunkHandler (org.neo4j.causalclustering.catchup.storecopy.FileChunkHandler)1 FileHeaderDecoder (org.neo4j.causalclustering.catchup.storecopy.FileHeaderDecoder)1 FileHeaderHandler (org.neo4j.causalclustering.catchup.storecopy.FileHeaderHandler)1 GetStoreIdRequestEncoder (org.neo4j.causalclustering.catchup.storecopy.GetStoreIdRequestEncoder)1 GetStoreIdResponseDecoder (org.neo4j.causalclustering.catchup.storecopy.GetStoreIdResponseDecoder)1 GetStoreIdResponseHandler (org.neo4j.causalclustering.catchup.storecopy.GetStoreIdResponseHandler)1 GetStoreRequestEncoder (org.neo4j.causalclustering.catchup.storecopy.GetStoreRequestEncoder)1 StoreCopyFinishedResponseDecoder (org.neo4j.causalclustering.catchup.storecopy.StoreCopyFinishedResponseDecoder)1 StoreCopyFinishedResponseHandler (org.neo4j.causalclustering.catchup.storecopy.StoreCopyFinishedResponseHandler)1 TxPullRequestEncoder (org.neo4j.causalclustering.catchup.tx.TxPullRequestEncoder)1 TxPullResponseDecoder (org.neo4j.causalclustering.catchup.tx.TxPullResponseDecoder)1 TxPullResponseHandler (org.neo4j.causalclustering.catchup.tx.TxPullResponseHandler)1 TxStreamFinishedResponseDecoder (org.neo4j.causalclustering.catchup.tx.TxStreamFinishedResponseDecoder)1 TxStreamFinishedResponseHandler (org.neo4j.causalclustering.catchup.tx.TxStreamFinishedResponseHandler)1