Giter Club home page Giter Club logo

Comments (1)

 avatar commented on August 16, 2024

Sorry for the delay in responding, @brettwooldridge. The HollowIncrementalProducer (as currently implemented) has some, but not all the behavior you're looking for:

  • Deletion of an Actor results in the removal from all Movie.actors sets.

It doesn't behave that way. After requesting deletion of an Actor, it checks whether the instance is referenced up the graph and if so, won't delete it.

  • Deletion of a Movie removes both the Movie and its actors set, but does not remove the referenced Actor objects if they are referenced by other Movies.

It does behave that way. All references down the graph will also be deleted unless any of those references are referenced up the graph from the Movie instance being deleted.

For instance, if Actor types also has an Award type (e.g. "Best Actress"), if all movies referencing a particular actress are removed, the actress will be removed and her awards will be removed, too, unless a particular award is also referenced from another Actor instance. Assuming there are actresses left in the data set with "Best Actress" award, that award won't be deleted, even though the actress was by virtue of the movie having been deleted.

  • Ideally, but not required, is the removal of an Actor if it is no longer referenced by any Movie (i.e. no orphans).

It does behave that way. For example, given a movie already in the dataset with a list of actors already populated, if you remove one of those actors from the movie pojo and pass it to addOrModify(someMovie) it will a) remove the actor reference from that Movie record and b) remove the corresponding Actor reference from the dataset if there are no other references to it. The incremental producer isn't doing anything special in this case, this is just one of the features of Hollow whether using either producer or lower-level APIs.

(Technically the Actor instance lingers for 1 more cycle as a ghost record before it's truly garbage collected.)


Given that info (again as implemented) explicit deletions (via producer.delete(...)) only make sense for top-level types in your data model. You could think of it as, if you were working with a regular HollowProducer, those types for which you would call newState.add(o) on are the only ones for which incProducer.delete(o) will be useful. To delete a non-top-level type, you have to remove the references to it manually, and pass those modified POJOs in to incProducer.addOrModify(o).

from hollow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.