Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Activate Local Snapshots #1172

Conversation

hmoog
Copy link

@hmoog hmoog commented Nov 20, 2018

Description

This PR replaces the refactored classes and activates local snapshots. It is not the last PR, yet since we want to integrate the missing repair routine and the requester thread but local snapshots should be fully functional already.

Type of change

  • Enhancement (a non-breaking change which adds functionality)

Checklist:

Please delete items that are not relevant.

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes

Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

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

Good

Just a few changes


public final AsyncTransactionPruner transactionPruner;

public final MilestoneSolidifierImpl milestoneSolidifier;
Copy link
Contributor

Choose a reason for hiding this comment

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

All the Impls should be removed.
This is because: The D in Solid states that the code should depend on abstractions, not concretions.

The Impl is sort of a feature that help you enforce D. Everytime you see it you know D breaks. Besides it is ugly so it incentivizes you to use the interface :-)

Copy link
Author

Choose a reason for hiding this comment

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

This is so we can use all the implementation specific methods like "init", "start" and so on without having to typecast them to their explicit type again. I could have the field be generic and then do

((MilestoneSolidifierImpl) milestoneSolidifier).init(...) but that kind of makes it more complicated imho

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm
Once we will do proper DI we will fix it

For now it is fine

src/main/java/com/iota/iri/service/API.java Outdated Show resolved Hide resolved
@GalRogozinski GalRogozinski merged commit 474ba4c into iotaledger:dev-localsnapshots Nov 20, 2018
@hmoog hmoog deleted the merge_dependencyhandling branch November 20, 2018 13:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants