Skip to content

Change register to apply - #4

Merged
woop merged 6 commits into
masterfrom
feast-apply
Dec 13, 2018
Merged

Change register to apply#4
woop merged 6 commits into
masterfrom
feast-apply

Conversation

@zhilingc

Copy link
Copy Markdown
Collaborator

Change register API to apply.

If you apply a spec for a resource that doesn't already exist in the system, it will be created. If not, then the resource will be updated to match the new spec provided. Note that only fields without dependencies can be updated; i.e. changes to ids, storage sinks, or value types are not allowed. If you apply a spec that has no changes without throwing an error.

Updated the CLI to reflect these changes as well.

@zhilingc
zhilingc requested review from pradithya, tims and woop December 12, 2018 08:31

@pradithya pradithya left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.
Need to remember that register is no longer exist and any documentation should refer to it as apply

* @param otherFeatureGroup
* @return boolean
*/
public boolean eq(FeatureGroupInfo otherFeatureGroup) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't it possible (and perhaps cleaner) to use the built in .equals() method that all Java objects have?

https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)

EntityInfo entity1 = new EntityInfo(entitySpec);
entity1.setCreated(Date.from(Instant.ofEpochSecond(1)));
EntityInfo entity2 = new EntityInfo(entitySpec);
entity1.setCreated(Date.from(Instant.ofEpochSecond(2)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this line correct? Shouldn't it be entity2.setCreated(Date.from(Instant.ofEpochSecond(2)));?

&& oldStoreOpts.equals(
newStore == null
? ""
: TypeConversion.convertMapToJsonString(newStore.getOptionsMap()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we really need to have oldStoreOpts here? Can this also be a method on StorageInfo?

@zhilingc

Copy link
Copy Markdown
Collaborator Author

Cleaned it up a bit.

return storageInfo;
} else {
storageInfo = new StorageInfo(spec);
StorageInfo out = storageInfoRepository.saveAndFlush(storageInfo);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't there a more descriptive variable name that we can use instead of out?

@woop
woop merged commit 491d5f6 into master Dec 13, 2018
@zhilingc
zhilingc deleted the feast-apply branch December 13, 2018 07:06
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