Top Description Inners Fields Constructors Methods
org.eclipse.jgit.internal.storage.file

pack-priv Class PackObjectSizeIndexV1

extends Object
implements PackObjectSizeIndex
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex
Imports
java.io.IOException, .InputStream, .UnsupportedEncodingException, java.text.MessageFormat, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.util.NB

Memory representation of the object-size index The object size index is a map from position in the primary idx (i.e. position of the object-id in lexicographical order) to size. Most of the positions fit in unsigned 3 bytes (up to 16 million)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
PackObjectSizeIndexV1.IntArray

A byte[] that should be interpreted as an int[]

private static class
PackObjectSizeIndexV1.LongArray

A byte[] that should be interpreted as an long[]

private static class

Field Summary

Modifier and TypeField and Description
private static final byte
private static final byte
private final UInt24Array
private final PackObjectSizeIndexV1.IntArray
private final PackObjectSizeIndexV1.IntArray
sizes32

Parallel array to concat(positions24, positions32) with the size of the objects.

private final PackObjectSizeIndexV1.LongArray
private final int

Constructor Summary

AccessConstructor and Description
private
PackObjectSizeIndexV1(InputStream stream, int threshold, int objCount)

Method Summary

Modifier and TypeMethod and Description
public long
public long
getSize(int
position in the pack (as returned from PackIndex)
idxOffset
)

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getSize.

Returns the inflated size of the object.

public int
getThreshold()

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getThreshold.

Minimal size of an object to be included in this index Cut-off value used at generation time to decide what objects to index.

pack-priv static PackObjectSizeIndex
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BITS_24back to summary
private static final byte BITS_24
BITS_32back to summary
private static final byte BITS_32
positions24back to summary
private final UInt24Array positions24
positions32back to summary
private final PackObjectSizeIndexV1.IntArray positions32
sizes32back to summary
private final PackObjectSizeIndexV1.IntArray sizes32

Parallel array to concat(positions24, positions32) with the size of the objects. A value >= 0 is the size of the object. A negative value means the size doesn't fit in an int and |value|-1 is the position for the size in the size64 array e.g. a value of -1 is sizes64[0], -2 = sizes64[1], ...

sizes64back to summary
private final PackObjectSizeIndexV1.LongArray sizes64
thresholdback to summary
private final int threshold

Constructor Detail

PackObjectSizeIndexV1back to summary
private PackObjectSizeIndexV1(InputStream stream, int threshold, int objCount) throws IOException

Method Detail

getObjectCountback to summary
public long getObjectCount()

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getObjectCount.

Doc from org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getObjectCount.

Number of objects in the index

Returns:long

number of objects in the index

Annotations
@Override
getSizeback to summary
public long getSize(int idxOffset)

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getSize.

Doc from org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getSize.

Returns the inflated size of the object.

Parameters
idxOffset:int

position in the pack (as returned from PackIndex)

Returns:long

size of the object, -1 if not found in the index.

Annotations
@Override
getThresholdback to summary
public int getThreshold()

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getThreshold.

Doc from org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getThreshold.

Minimal size of an object to be included in this index Cut-off value used at generation time to decide what objects to index.

Returns:int

size in bytes

Annotations
@Override
parseback to summary
pack-priv static PackObjectSizeIndex parse(InputStream in) throws IOException
org.eclipse.jgit.internal.storage.file back to summary

private Class PackObjectSizeIndexV1.EmptyPackObjectSizeIndex

extends Object
implements PackObjectSizeIndex
Class Inheritance
  • java.lang.Object
  • org.eclipse.jgit.internal.storage.file.PackObjectSizeIndexV1.EmptyPackObjectSizeIndex
All Implemented Interfaces
org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
EmptyPackObjectSizeIndex(int threshold)

Method Summary

Modifier and TypeMethod and Description
public long
public long
getSize(int
position in the pack (as returned from PackIndex)
idxOffset
)

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getSize.

Returns the inflated size of the object.

public int
getThreshold()

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getThreshold.

Minimal size of an object to be included in this index Cut-off value used at generation time to decide what objects to index.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

thresholdback to summary
private final int threshold

Constructor Detail

EmptyPackObjectSizeIndexback to summary
pack-priv EmptyPackObjectSizeIndex(int threshold)

Method Detail

getObjectCountback to summary
public long getObjectCount()

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getObjectCount.

Doc from org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getObjectCount.

Number of objects in the index

Returns:long

number of objects in the index

Annotations
@Override
getSizeback to summary
public long getSize(int idxOffset)

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getSize.

Doc from org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getSize.

Returns the inflated size of the object.

Parameters
idxOffset:int

position in the pack (as returned from PackIndex)

Returns:long

size of the object, -1 if not found in the index.

Annotations
@Override
getThresholdback to summary
public int getThreshold()

Implements org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getThreshold.

Doc from org.eclipse.jgit.internal.storage.file.PackObjectSizeIndex.getThreshold.

Minimal size of an object to be included in this index Cut-off value used at generation time to decide what objects to index.

Returns:int

size in bytes

Annotations
@Override
org.eclipse.jgit.internal.storage.file back to summary

private Class PackObjectSizeIndexV1.IntArray

extends Object
Class Inheritance
  • java.lang.Object
  • org.eclipse.jgit.internal.storage.file.PackObjectSizeIndexV1.IntArray

A byte[] that should be interpreted as an int[]

Field Summary

Modifier and TypeField and Description
private final byte[]
private static final PackObjectSizeIndexV1.IntArray
private static final int
private final int

Constructor Summary

AccessConstructor and Description
private
IntArray(byte[] data)

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

position of the element in the array or -1 if not found
binarySearch
(int
element to look for
needle
)

Returns position of element in array, -1 if not there

pack-priv boolean
pack-priv static PackObjectSizeIndexV1.IntArray
from(InputStream in, int ints)

pack-priv int
get(int position)

pack-priv int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
private final byte[] data
EMPTYback to summary
private static final PackObjectSizeIndexV1.IntArray EMPTY
INT_SIZEback to summary
private static final int INT_SIZE
sizeback to summary
private final int size

Constructor Detail

IntArrayback to summary
private IntArray(byte[] data)

Method Detail

binarySearchback to summary
pack-priv int binarySearch(int needle)

Returns position of element in array, -1 if not there

Parameters
needle:int

element to look for

Returns:int

position of the element in the array or -1 if not found

emptyback to summary
pack-priv boolean empty()
fromback to summary
pack-priv static PackObjectSizeIndexV1.IntArray from(InputStream in, int ints) throws IOException
getback to summary
pack-priv int get(int position)
sizeback to summary
pack-priv int size()
org.eclipse.jgit.internal.storage.file back to summary

private Class PackObjectSizeIndexV1.LongArray

extends Object
Class Inheritance
  • java.lang.Object
  • org.eclipse.jgit.internal.storage.file.PackObjectSizeIndexV1.LongArray

A byte[] that should be interpreted as an long[]

Field Summary

Modifier and TypeField and Description
private final byte[]
private static final PackObjectSizeIndexV1.LongArray
private static final int
private final int

Constructor Summary

AccessConstructor and Description
private
LongArray(byte[] data)

Method Summary

Modifier and TypeMethod and Description
pack-priv static PackObjectSizeIndexV1.LongArray
from(InputStream in, int longs)

pack-priv long
get(int position)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
private final byte[] data
EMPTYback to summary
private static final PackObjectSizeIndexV1.LongArray EMPTY
LONG_SIZEback to summary
private static final int LONG_SIZE
sizeback to summary
private final int size

Constructor Detail

LongArrayback to summary
private LongArray(byte[] data)

Method Detail

fromback to summary
pack-priv static PackObjectSizeIndexV1.LongArray from(InputStream in, int longs) throws IOException
getback to summary
pack-priv long get(int position)
org.eclipse.jgit.internal.storage.file back to summary

private Class PackObjectSizeIndexV1.StreamHelper

extends Object
Class Inheritance
  • java.lang.Object
  • org.eclipse.jgit.internal.storage.file.PackObjectSizeIndexV1.StreamHelper

Field Summary

Modifier and TypeField and Description
private final byte[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv byte
pack-priv int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private final byte[] buffer

Constructor Detail

StreamHelperback to summary
private StreamHelper()

Method Detail

readByteback to summary
pack-priv byte readByte(InputStream in) throws IOException
readIntback to summary
pack-priv int readInt(InputStream in) throws IOException