From: "Shawn O. Pearce" <spearce@spearce.org>
To: Johannes Schneider <mailings@cedarsoft.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [OT] Using object store for other (java) applications
Date: Mon, 1 Jun 2009 07:34:48 -0700 [thread overview]
Message-ID: <20090601143448.GF30527@spearce.org> (raw)
In-Reply-To: <4A22F39A.9010900@cedarsoft.com>
Johannes Schneider <mailings@cedarsoft.com> wrote:
> what do you think: Is it possible to use the object store (hash based
> and optimized storage) within another Java application?
Sure. So long as your storage model fits well onto the Git object
store. If all you want is a content keyed lookup, Git is possibly
overkill, but you could use it.
> Maybe the JGIT implementation contains anything that could be used?
Yes. Use the Repository class to access the local repository, use
an ObjectWriter to store blobs and compute their names. Use the
openBlob method on Repository to obtain an ObjectLoader for a blob
content you previously had stored.
ObjectWriter stores everything as loose files. Eventually, you may
want to pack them. Use a PackWriter. JGit lacks `git prune-packed`
support, but this probably could be coded up in Java and contributed
to JGit with fairly little effort.
If you store data, you probably should connect the blobs into a
tree and into commits, so that the blobs are considered reachable
and can't be cleaned out by `git gc`.
But, if you only ever use your own application against the
repository, and use JGit to manage it, you would never be invoking
GC and thus would never need to worry about it.
--
Shawn.
prev parent reply other threads:[~2009-06-01 14:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-31 21:16 [OT] Using object store for other (java) applications Johannes Schneider
2009-06-01 14:34 ` Shawn O. Pearce [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090601143448.GF30527@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=mailings@cedarsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).