Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs storage. Update common & parser. #12

Merged
merged 18 commits into from
May 14, 2016
Merged

Conversation

anton2larionov
Copy link
Member

Simple logs db impl.
Some changes in parser and macro.

}

"Test Log from HashMap" >> {
val (obj, hm) = genLog()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fntz
Copy link
Member

fntz commented May 9, 2016

а какая цель рефакторинка?

@anton2larionov
Copy link
Member Author

anton2larionov commented May 9, 2016

Главная проблема с которой столкнулся - равенство объектов помещённых и возвращенных из RethinkDB.

Для macro добавил implicit параметр Converter[-T]. Существующую логику перенес в defaultConverter, а для логов добавил реализацию с учетом преобразования типов в RethinkDB.

Вторая проблема: корректное формирование ReqlFunction1 для filter. А именно, запрет запросов типа "timestamp contains 'abc'".

level: Int,
env: String,
name: String,
timestamp: OffsetDateTime,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мб timestamp надо переименовать уже

@fntz
Copy link
Member

fntz commented May 10, 2016

досмотрю завтра.

@anton2larionov
Copy link
Member Author

Изменены parser и (query => reql) для работы с запросами вида:

  • 100 sec (логи за последние 100 сек)
  • 30 min .. 1 h (логи, имеющие время в интервале от 30 мин до 1 ч назад)

и их комбинациями с другими query: 5 min AND message contains 'foo', etc.

@fntz
Copy link
Member

fntz commented May 12, 2016

клёво, это получается сделал частицу вот этого таска #19

@@ -0,0 +1,11 @@
package com.github.scalalab3.logs.common.domain

case class Period(private val amountVal: Long = 0L, timeUnit: TimeUnit = Sec) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему private?
и зачем val, для case class аргументы будут всегда val

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Попытка сделать защиту от amountVal < 0, метод amount() тогда вернет 0.

@fntz
Copy link
Member

fntz commented May 12, 2016

zbs сделал

@anton2larionov
Copy link
Member Author

Спасибо за code review :)

@fntz
Copy link
Member

fntz commented May 12, 2016

пожалуйсто

@anton2larionov
Copy link
Member Author

Обновлено.


val stringKeys: Seq[String] = typeOf[Log].members.collect {
case m: MethodSymbol
if m.isCaseAccessor & m.typeSignature.finalResultType =:= typeOf[String] => m.name.toString
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&&

@fntz
Copy link
Member

fntz commented May 13, 2016

исправь там & -> && и я солью
всё ок.

@anton2larionov
Copy link
Member Author

Исправлено.

@fntz fntz merged commit cd00641 into scalalab3:master May 14, 2016
@fntz
Copy link
Member

fntz commented May 14, 2016

спасибо

@anton2larionov anton2larionov mentioned this pull request May 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants