esque

Resembles an Elasticsearch Stateful Query Executor

Лицензия

Лицензия

Группа

Группа

org.loesak.esque
Идентификатор

Идентификатор

esque
Последняя версия

Последняя версия

0.1.2
Дата

Дата

Тип

Тип

pom
Описание

Описание

esque
Resembles an Elasticsearch Stateful Query Executor
Ссылка на сайт

Ссылка на сайт

https://github.com/loesak/esque
Система контроля версий

Система контроля версий

https://github.com/loesak/esque

Скачать esque

Имя Файла Размер
esque-0.1.2.pom 4 KB
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.loesak.esque/esque/ -->
<dependency>
    <groupId>org.loesak.esque</groupId>
    <artifactId>esque</artifactId>
    <version>0.1.2</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/org.loesak.esque/esque/
implementation 'org.loesak.esque:esque:0.1.2'
// https://jarcasting.com/artifacts/org.loesak.esque/esque/
implementation ("org.loesak.esque:esque:0.1.2")
'org.loesak.esque:esque:pom:0.1.2'
<dependency org="org.loesak.esque" name="esque" rev="0.1.2">
  <artifact name="esque" type="pom" />
</dependency>
@Grapes(
@Grab(group='org.loesak.esque', module='esque', version='0.1.2')
)
libraryDependencies += "org.loesak.esque" % "esque" % "0.1.2"
[org.loesak.esque/esque "0.1.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

  • esque-core
  • esque-examples

esque

Resembles an Elasticsearch Stateful Query Executor

What is it

A means of repeatable execution of pre-defined queries against your Elasticsearch cluster. Esque will remember which queries it ran against the cluster and only execute those that have not in the order they are defined.

It is Flyway-esque but for Elasticsearch.

What it does

  • Define queries in migration files using YAML
  • Executes the migration files in order as needed
  • Maintains state of which migration files have been executed
  • Ensures integrity between migration files and applied migrations
  • Locks migration operations across distributed systems to ensure single execution
  • Can supply your own distributed lock if needed (e.g. Hazelcast)
  • Allows for different logical separation of migration sets via a migration key

What it doesn't

  • Rollback in the face of failure. Back up your systems and test your migrations

Prerequisites

  • Elasticsearch 7+

Dependencies

  • org.elasticsearch.client:elasticsearch-rest-client
  • com.fasterxml.jackson.core:jackson-databind
  • com.fasterxml.jackson.module:jackson-module-parameter-names
  • com.fasterxml.jackson.datatype:jackson-datatype-jdk8
  • com.fasterxml.jackson.datatype:jackson-datatype-jsr310
  • com.fasterxml.jackson.dataformat:jackson-dataformat-yaml
  • org.slf4j:slf4j-api

Use cases

  • Executing all queries for bootstrapping a brand new Elasticsearch cluster. For example:
    • cluster settings
    • saved searches
    • visualizations
    • dashboards
    • creating indexes
    • creating users
  • Executing queries needed for a particular application. For example:
    • creating indexes
    • creating index templates
    • creating/modifying index aliases
    • index schema modification
    • etc.

It basically executes queries and remembers which queries have been run on a cluster for a given migration key. You can organize it's usage to your needs.

Install

Add the following to your maven dependencies. Make sure to check the releases or Maven Central for the latest version.

<dependency>
  <groupId>org.loesak.esque</groupId>
  <artifactId>esque-core</artifactId>
  <version>0.1.2</version>
</dependency>

Security

TODO: deal with Elasticsearch security as well as AWS ES security

Examples

Example projects exist in the esque-examples subdirectory

Future Features

  • may allow ability to define "undo" queries for each definition to allow for attempts to roll back in the face of partial failure
  • support other versions of Elasticsearch (5.6+ only) - may just ditch the elasticsearch rest client and move to straight HTTP queries...

Версии библиотеки

Версия
0.1.2