Giter Site home page Giter Site logo

cdc-read-write-example's Introduction

CDC read write example

Пример чтения CDC данных в standalone приложении

NOTE: Данный пример использует internal API. Хорошим решением является запрос на доработку для создания public API standalone чтения сериализованных BinaryObject'ов.

Куда смотреть в исходниках?

ignite.xml

Конфиг Ignite'а с CDC consumer'ом, который пишет события в файлики.

WriteToFileConsumer

Consumer - стандартным для java образом сохраняет данные в файлы. Для его работы нужно после запуска Ignite ноды запустить ignite-cdc.sh

Writer

Приложение - через тонкий клиент вставляет данные в кластер. Нужно стартовать когда локально запущена и активирована нода игнайта.

CdcDataReader

Читалка данных.

binary_meta, marshaller - папки, которые формируются в процессе работы ноды Игнайта. Для корректной работы их нужно вручную перенести туда же где запускается приложение.

Пример вывода:

[CdcDataReader] Start read data[root=/Users/sbt-izhikov-nv/tmp/cdc]
[CdcDataReader] Reading[file=5.bin, user=User{fio='John Connor', department=Department{id=1, name='Management'}, birthday=Sat Feb 28 00:00:00 MSK 3885}]
[CdcDataReader] Reading[file=4.bin, user=User{fio='Sarah Connor', department=Department{id=1, name='Management'}, birthday=Mon May 01 00:00:00 MSK 3865}]
[CdcDataReader] Reading[file=6.bin, user=User{fio='Kyle Reese', department=Department{id=1, name='Management'}, birthday=Tue Jul 05 00:00:00 MSK 3904}]
[CdcDataReader] Reading[file=3.bin, user=User{fio='Young and furious', department=Department{id=1, name='Management'}, birthday=Thu Jul 05 00:00:00 MSK 3900}]
[CdcDataReader] Reading[file=2.bin, user=User{fio='Vice president', department=Department{id=1, name='Management'}, birthday=Wed Mar 01 00:00:00 MSK 3871}]
[CdcDataReader] Reading[file=1.bin, user=User{fio='Big boss', department=Department{id=1, name='Management'}, birthday=Wed Feb 01 00:00:00 MSK 3860}]

Process finished with exit code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.