C# Class GitSharp.Core.ObjectDatabase

Abstraction of arbitrary object storage. An object database stores one or more Git objects, indexed by their unique ObjectId. Optionally an object database can reference one or more alternates; other ObjectDatabase instances that are searched in addition to the current database. Databases are usually divided into two halves: a half that is considered to be fast to search, and a half that is considered to be slow to search. When alternates are present the fast half is fully searched (recursively through all alternates) before the slow half is considered.
Inheritance: IDisposable
ファイルを表示 Open project: jagregory/GitSharp Class Usage Examples

Protected Properties

Property Type Description
NoAlternates GitSharp.Core.ObjectDatabase[]

Public Methods

Method Description
Dispose ( ) : void
OpenObjectInAllPacks ( ICollection @out, GitSharp.Core.WindowCursor windowCursor, AnyObjectId objectId ) : void

Open the object from all packs containing it. If any alternates are present, their packs are also considered.

OpenObjectInAllPacksImplementation ( ICollection @out, GitSharp.Core.WindowCursor windowCursor, AnyObjectId objectId ) : void

Open the object from all packs containing it. If any alternates are present, their packs are also considered.

close ( ) : void

Close any resources held by this database and its active alternates.

closeAlternates ( ) : void

Fully close all loaded alternates and clear the alternate list.

closeSelf ( ) : void

Close any resources held by this database only; ignoring alternates. To fully close this database and its referenced alternates, the caller should instead invoke close().

create ( ) : void

Initialize a new object database at this location.

exists ( ) : bool

Gets if this database is already created; If it returns false, the caller should invoke create to create this database location.

getAlternates ( ) : GitSharp.Core.ObjectDatabase[]

Get the alternate databases known to this database.

hasObject ( AnyObjectId objectId ) : bool

Does the requested object exist in this database? Alternates (if present) are searched automatically.

hasObject1 ( AnyObjectId objectId ) : bool

Fast half of hasObject(AnyObjectId).

hasObject2 ( string objectName ) : bool

Slow half of hasObject(AnyObjectId).

loadAlternates ( ) : GitSharp.Core.ObjectDatabase[]

Load the list of alternate databases into memory. This method is invoked by getAlternates() if the alternate list has not yet been populated, or if closeAlternates() has been called on this instance and the alternate list is needed again. If the alternate array is empty, implementors should consider using the constant NoAlternates.

openObject ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader

Open an object from this database. Alternates (if present) are searched automatically.

openObject1 ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader

Fast half of openObject(WindowCursor, AnyObjectId).

openObject2 ( GitSharp.Core.WindowCursor curs, string objectName, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader

Slow half of openObject(WindowCursor, AnyObjectId).

tryAgain1 ( ) : bool

true if the fast-half search should be tried again.

Protected Methods

Method Description
ObjectDatabase ( ) : System

Initialize a new database instance for access.

closeAlternates ( ObjectDatabase alt ) : void

Private Methods

Method Description
OpenObjectImpl1 ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
OpenObjectImpl2 ( GitSharp.Core.WindowCursor curs, string objectName, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
hasObjectImpl1 ( AnyObjectId objectId ) : bool
hasObjectImpl2 ( string objectId ) : bool

Method Details

Dispose() public method

public Dispose ( ) : void
return void

ObjectDatabase() protected method

Initialize a new database instance for access.
protected ObjectDatabase ( ) : System
return System

OpenObjectInAllPacks() public method

Open the object from all packs containing it. If any alternates are present, their packs are also considered.
public OpenObjectInAllPacks ( ICollection @out, GitSharp.Core.WindowCursor windowCursor, AnyObjectId objectId ) : void
@out ICollection
windowCursor GitSharp.Core.WindowCursor /// Temporary working space associated with the calling thread. ///
objectId AnyObjectId of object to search for.
return void

OpenObjectInAllPacksImplementation() public method

Open the object from all packs containing it. If any alternates are present, their packs are also considered.
public OpenObjectInAllPacksImplementation ( ICollection @out, GitSharp.Core.WindowCursor windowCursor, AnyObjectId objectId ) : void
@out ICollection
windowCursor GitSharp.Core.WindowCursor /// Temporary working space associated with the calling thread. ///
objectId AnyObjectId of object to search for.
return void

close() public method

Close any resources held by this database and its active alternates.
public close ( ) : void
return void

closeAlternates() public method

Fully close all loaded alternates and clear the alternate list.
public closeAlternates ( ) : void
return void

closeAlternates() protected method

protected closeAlternates ( ObjectDatabase alt ) : void
alt ObjectDatabase
return void

closeSelf() public method

Close any resources held by this database only; ignoring alternates. To fully close this database and its referenced alternates, the caller should instead invoke close().
public closeSelf ( ) : void
return void

create() public method

Initialize a new object database at this location.
public create ( ) : void
return void

exists() public method

Gets if this database is already created; If it returns false, the caller should invoke create to create this database location.
public exists ( ) : bool
return bool

getAlternates() public method

Get the alternate databases known to this database.
public getAlternates ( ) : GitSharp.Core.ObjectDatabase[]
return GitSharp.Core.ObjectDatabase[]

hasObject() public method

Does the requested object exist in this database? Alternates (if present) are searched automatically.
public hasObject ( AnyObjectId objectId ) : bool
objectId AnyObjectId identity of the object to test for existence of.
return bool

hasObject1() public abstract method

Fast half of hasObject(AnyObjectId).
public abstract hasObject1 ( AnyObjectId objectId ) : bool
objectId AnyObjectId /// Identity of the object to test for existence of. ///
return bool

hasObject2() public method

Slow half of hasObject(AnyObjectId).
public hasObject2 ( string objectName ) : bool
objectName string /// Identity of the object to test for existence of. ///
return bool

loadAlternates() public method

Load the list of alternate databases into memory. This method is invoked by getAlternates() if the alternate list has not yet been populated, or if closeAlternates() has been called on this instance and the alternate list is needed again. If the alternate array is empty, implementors should consider using the constant NoAlternates.
/// The alternate list could not be accessed. The empty alternate /// array will be assumed by the caller. ///
public loadAlternates ( ) : GitSharp.Core.ObjectDatabase[]
return GitSharp.Core.ObjectDatabase[]

openObject() public method

Open an object from this database. Alternates (if present) are searched automatically.
public openObject ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
curs GitSharp.Core.WindowCursor /// Temporary working space associated with the calling thread. ///
objectId AnyObjectId Identity of the object to open.
return GitSharp.Core.ObjectLoader

openObject1() public abstract method

Fast half of openObject(WindowCursor, AnyObjectId).
public abstract openObject1 ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
curs GitSharp.Core.WindowCursor /// temporary working space associated with the calling thread. ///
objectId AnyObjectId identity of the object to open.
return GitSharp.Core.ObjectLoader

openObject2() public method

Slow half of openObject(WindowCursor, AnyObjectId).
public openObject2 ( GitSharp.Core.WindowCursor curs, string objectName, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
curs GitSharp.Core.WindowCursor /// temporary working space associated with the calling thread. ///
objectName string Name of the object to open.
objectId AnyObjectId identity of the object to open.
return GitSharp.Core.ObjectLoader

tryAgain1() public method

true if the fast-half search should be tried again.
public tryAgain1 ( ) : bool
return bool

Property Details

NoAlternates protected_oe static_oe property

Constant indicating no alternate databases exist.
protected static ObjectDatabase[],GitSharp.Core NoAlternates
return GitSharp.Core.ObjectDatabase[]