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

configure streams based on settings #9

Merged
merged 1 commit into from Jan 19, 2022

Conversation

jsilhan
Copy link
Contributor

@jsilhan jsilhan commented Dec 28, 2021

No description provided.

@@ -71,6 +71,8 @@ def create_table(self,
settings.PYDJAMODB_DATABASE.get('POINT_IN_TIME_RECOVERY', False) if set_point_in_time_recovery is None
else set_point_in_time_recovery
)
if not stream_specification and settings.PYDJAMODB_DATABASE.get('STREAM_ENABLED'):
stream_specification = {'stream_enabled': True, 'stream_view_type': 'NEW_AND_OLD_IMAGES'}
Copy link

Choose a reason for hiding this comment

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

We don't need old images. Use NEW_IMAGE only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, changed

@@ -71,6 +71,8 @@ def create_table(self,
settings.PYDJAMODB_DATABASE.get('POINT_IN_TIME_RECOVERY', False) if set_point_in_time_recovery is None
else set_point_in_time_recovery
)
if not stream_specification and settings.PYDJAMODB_DATABASE.get('STREAM_ENABLED'):
stream_specification = {'stream_enabled': True, 'stream_view_type': 'NEW_IMAGE'}
Copy link
Contributor

Choose a reason for hiding this comment

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

stream_view_type cannot be changed?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe better solution should be set whole stream specification in PYDJAMODB_DATABASE

Copy link
Contributor

Choose a reason for hiding this comment

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

PYDJAMODB_DATABASE = {
...
STREAM_SPECIFICATION: {'stream_enabled': True, 'stream_view_type': 'NEW_IMAGE'}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, changed.

@@ -71,6 +71,10 @@ def create_table(self,
settings.PYDJAMODB_DATABASE.get('POINT_IN_TIME_RECOVERY', False) if set_point_in_time_recovery is None
else set_point_in_time_recovery
)
stream_specification_settings = settings.PYDJAMODB_DATABASE.get('STREAM_SPECIFICATION')
if (not stream_specification and stream_specification_settings
and stream_specification_settings.get('stream_enabled')):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you specify image view type and streams are disabled you get error

Copy link
Contributor

Choose a reason for hiding this comment

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

but this is settings problem. Therefore it should be left up to developer..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I have changed that but it's little bit more complicated definition in PYDJAMODB_DATABASE settings from main app.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1682964702

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 90.364%

Totals Coverage Status
Change from base Build 1667995320: 0.04%
Covered Lines: 497
Relevant Lines: 550

💛 - Coveralls

@matllubos matllubos merged commit 368b1f0 into druids:master Jan 19, 2022
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.

None yet

4 participants