Giter Club home page Giter Club logo

Comments (3)

michel-kraemer avatar michel-kraemer commented on June 16, 2024

I'm not sure what you mean by "records". Can you please give me more information about what you want to do? Thanks.

Michel

from bson4jackson.

bimargulies avatar bimargulies commented on June 16, 2024

I need to create a log on disk of operations performed on an in-memory data structure. Each operation corresponds to one top-level json object. Currently, I'm just writing it all to files in json format. If the power goes out in mid-write, the results will not be pretty. I want to save space by using bson (there are logs of floating point numbers), and I want to switch from writing a text file to writing records to a BDB database, which will give me some recoverability. The simple thing to do would be to create a new generator for each record, take the bytes in a ByteArrayInputStream, and shove them to the database. That might not really be awful, but I wondered if I had other options.

from bson4jackson.

michel-kraemer avatar michel-kraemer commented on June 16, 2024

Thank you for your explanation. Now I understand better what you are going to do.

As far as I remember, generator objects cannot be reused. There is no way of changing the output stream once the generator has been created.

Creating a new generator is a very lightweight operation. So, in fact it should not be a problem.

from bson4jackson.

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.