org.eclipse.jgit.storage.dht
Class DhtPackParser

java.lang.Object
  extended by org.eclipse.jgit.transport.PackParser
      extended by org.eclipse.jgit.storage.dht.DhtPackParser

public class DhtPackParser
extends PackParser

Parses the pack stream into chunks, and indexes the chunks for lookup.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jgit.transport.PackParser
PackParser.ObjectTypeAndSize, PackParser.Source, PackParser.UnresolvedDelta
 
Method Summary
protected  boolean checkCRC(int oldCRC)
           
 boolean isSaveAsCachedPack()
           
protected  PackedObjectInfo newInfo(AnyObjectId id, PackParser.UnresolvedDelta delta, ObjectId baseId)
           
protected  boolean onAppendBase(int typeCode, byte[] data, PackedObjectInfo info)
           
protected  void onBeginOfsDelta(long deltaPos, long basePos, long inflatedSize)
           
protected  void onBeginRefDelta(long deltaPos, AnyObjectId baseId, long inflatedSize)
           
protected  void onBeginWholeObject(long streamPosition, int type, long inflatedSize)
           
protected  org.eclipse.jgit.storage.dht.DhtPackParser.DhtDelta onEndDelta()
           
protected  void onEndThinPack()
           
protected  void onEndWholeObject(PackedObjectInfo info)
           
protected  void onInflatedObjectData(PackedObjectInfo obj, int typeCode, byte[] data)
           
protected  void onObjectData(PackParser.Source src, byte[] raw, int pos, int len)
           
protected  void onObjectHeader(PackParser.Source src, byte[] raw, int pos, int len)
           
protected  void onPackFooter(byte[] hash)
           
protected  void onPackHeader(long objCnt)
           
protected  void onStoreStream(byte[] raw, int pos, int len)
           
 PackLock parse(ProgressMonitor receiving, ProgressMonitor resolving)
           
protected  int readDatabase(byte[] dst, int pos, int cnt)
           
protected  PackParser.ObjectTypeAndSize seekDatabase(PackedObjectInfo obj, PackParser.ObjectTypeAndSize info)
           
protected  PackParser.ObjectTypeAndSize seekDatabase(PackParser.UnresolvedDelta delta, PackParser.ObjectTypeAndSize info)
           
 void setSaveAsCachedPack(boolean save)
          Enable saving the pack stream as a cached pack.
 
Methods inherited from class org.eclipse.jgit.transport.PackParser
buffer, getBaseObjectIds, getLockMessage, getNewObjectIds, getObject, getObjectCount, getSortedObjectList, isAllowThin, isCheckEofAfterPackFooter, isCheckObjectCollisions, parse, readObjectHeader, setAllowThin, setCheckEofAfterPackFooter, setCheckObjectCollisions, setLockMessage, setNeedBaseObjectIds, setNeedNewObjectIds, setObjectChecker, setObjectChecking
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isSaveAsCachedPack

public boolean isSaveAsCachedPack()
Returns:
if true, the pack stream is marked as a cached pack.

setSaveAsCachedPack

public void setSaveAsCachedPack(boolean save)
Enable saving the pack stream as a cached pack.

Parameters:
save - if true, the stream is saved.

parse

public PackLock parse(ProgressMonitor receiving,
                      ProgressMonitor resolving)
               throws java.io.IOException
Overrides:
parse in class PackParser
Throws:
java.io.IOException

newInfo

protected PackedObjectInfo newInfo(AnyObjectId id,
                                   PackParser.UnresolvedDelta delta,
                                   ObjectId baseId)
Overrides:
newInfo in class PackParser

onPackHeader

protected void onPackHeader(long objCnt)
                     throws java.io.IOException
Specified by:
onPackHeader in class PackParser
Throws:
java.io.IOException

onBeginWholeObject

protected void onBeginWholeObject(long streamPosition,
                                  int type,
                                  long inflatedSize)
                           throws java.io.IOException
Specified by:
onBeginWholeObject in class PackParser
Throws:
java.io.IOException

onEndWholeObject

protected void onEndWholeObject(PackedObjectInfo info)
                         throws java.io.IOException
Specified by:
onEndWholeObject in class PackParser
Throws:
java.io.IOException

onBeginOfsDelta

protected void onBeginOfsDelta(long deltaPos,
                               long basePos,
                               long inflatedSize)
                        throws java.io.IOException
Specified by:
onBeginOfsDelta in class PackParser
Throws:
java.io.IOException

onBeginRefDelta

protected void onBeginRefDelta(long deltaPos,
                               AnyObjectId baseId,
                               long inflatedSize)
                        throws java.io.IOException
Specified by:
onBeginRefDelta in class PackParser
Throws:
java.io.IOException

onEndDelta

protected org.eclipse.jgit.storage.dht.DhtPackParser.DhtDelta onEndDelta()
                                                                  throws java.io.IOException
Overrides:
onEndDelta in class PackParser
Throws:
java.io.IOException

onObjectData

protected void onObjectData(PackParser.Source src,
                            byte[] raw,
                            int pos,
                            int len)
                     throws java.io.IOException
Specified by:
onObjectData in class PackParser
Throws:
java.io.IOException

onInflatedObjectData

protected void onInflatedObjectData(PackedObjectInfo obj,
                                    int typeCode,
                                    byte[] data)
                             throws java.io.IOException
Specified by:
onInflatedObjectData in class PackParser
Throws:
java.io.IOException

seekDatabase

protected PackParser.ObjectTypeAndSize seekDatabase(PackedObjectInfo obj,
                                                    PackParser.ObjectTypeAndSize info)
                                             throws java.io.IOException
Specified by:
seekDatabase in class PackParser
Throws:
java.io.IOException

seekDatabase

protected PackParser.ObjectTypeAndSize seekDatabase(PackParser.UnresolvedDelta delta,
                                                    PackParser.ObjectTypeAndSize info)
                                             throws java.io.IOException
Specified by:
seekDatabase in class PackParser
Throws:
java.io.IOException

readDatabase

protected int readDatabase(byte[] dst,
                           int pos,
                           int cnt)
                    throws java.io.IOException
Specified by:
readDatabase in class PackParser
Throws:
java.io.IOException

onAppendBase

protected boolean onAppendBase(int typeCode,
                               byte[] data,
                               PackedObjectInfo info)
                        throws java.io.IOException
Specified by:
onAppendBase in class PackParser
Throws:
java.io.IOException

onEndThinPack

protected void onEndThinPack()
                      throws java.io.IOException
Specified by:
onEndThinPack in class PackParser
Throws:
java.io.IOException

onPackFooter

protected void onPackFooter(byte[] hash)
                     throws java.io.IOException
Specified by:
onPackFooter in class PackParser
Throws:
java.io.IOException

onObjectHeader

protected void onObjectHeader(PackParser.Source src,
                              byte[] raw,
                              int pos,
                              int len)
                       throws java.io.IOException
Specified by:
onObjectHeader in class PackParser
Throws:
java.io.IOException

onStoreStream

protected void onStoreStream(byte[] raw,
                             int pos,
                             int len)
                      throws java.io.IOException
Specified by:
onStoreStream in class PackParser
Throws:
java.io.IOException

checkCRC

protected boolean checkCRC(int oldCRC)
Specified by:
checkCRC in class PackParser


Copyright © 2011. All Rights Reserved.