Top Description Fields Constructors Methods
org.apache.derby.impl.sql.catalog

public Class SequenceRange

extends Object
implements SequencePreallocator
Class Inheritance
All Implemented Interfaces
org.apache.derby.catalog.SequencePreallocator
Imports
org.apache.derby.catalog.SequencePreallocator

Default Derby logic for determining how many values to pre-allocate for an identity column or sequence.

Field Summary

Modifier and TypeField and Description
private int
private static final int
DEFAULT_PREALLOCATION_COUNT

Default number of values to pre-allocate.

Constructor Summary

AccessConstructor and Description
public
SequenceRange()

0-arg constructore needed to satisfy the SequencePreallocator contract.

public
SequenceRange(int rangeSize)

Method Summary

Modifier and TypeMethod and Description
public int
nextRangeSize(String
Name of schema holding the sequence.
schemaName
,
String
Specific name of the sequence.
sequenceName
)

Implements org.apache.derby.catalog.SequencePreallocator.nextRangeSize.

This method returns the size of the next pre-allocated range for the specified sequence.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_rangeSizeback to summary
private int _rangeSize
DEFAULT_PREALLOCATION_COUNTback to summary
private static final int DEFAULT_PREALLOCATION_COUNT

Default number of values to pre-allocate. Other databases use a preallocation size of 20 (see DERBY-4437). We boosted this to 100 in order to get better concurrency, after fixing correctness problems in pre-allocation (see DERBY-5493).

Constructor Detail

SequenceRangeback to summary
public SequenceRange()

0-arg constructore needed to satisfy the SequencePreallocator contract.

SequenceRangeback to summary
public SequenceRange(int rangeSize)

Method Detail

nextRangeSizeback to summary
public int nextRangeSize(String schemaName, String sequenceName)

Implements org.apache.derby.catalog.SequencePreallocator.nextRangeSize.

Doc from org.apache.derby.catalog.SequencePreallocator.nextRangeSize.

This method returns the size of the next pre-allocated range for the specified sequence. Names are case-sensitive, as specified in CREATE SEQUENCE and CREATE TABLE statements.

Parameters
schemaName:String

Name of schema holding the sequence.

sequenceName:String

Specific name of the sequence.

Returns:int

the size of the next pre-allocated range