Re: [OT] Using object store for other (java) applications

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schneider <mailings@xxxxxxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]