本文整理汇总了Java中org.hsqldb.lib.DoubleIntIndex类的典型用法代码示例。如果您正苦于以下问题:Java DoubleIntIndex类的具体用法?Java DoubleIntIndex怎么用?Java DoubleIntIndex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DoubleIntIndex类属于org.hsqldb.lib包,在下文中一共展示了DoubleIntIndex类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: TableSpaceManagerBlocks
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
/**
*
*/
public TableSpaceManagerBlocks(DataSpaceManager spaceManager, int tableId,
int fileBlockSize, int capacity,
int fileScale, int minReuse) {
this.spaceManager = spaceManager;
this.scale = fileScale;
this.spaceID = tableId;
this.mainBlockSize = fileBlockSize;
this.minReuse = minReuse;
lookup = new DoubleIntIndex(capacity, true);
lookup.setValuesSearchTarget();
this.capacity = capacity;
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:19,代码来源:TableSpaceManagerBlocks.java
示例2: testDoubleIntLookup
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
public void testDoubleIntLookup() throws Exception {
boolean failed = false;
int testSize = 512;
org.hsqldb.lib.IntKeyHashMap hIntMap =
new org.hsqldb.lib.IntKeyHashMap();
DoubleIntIndex intLookup = new DoubleIntIndex(12, false);
try {
intLookup.setKeysSearchTarget();
populateBySerialIntKeysInt(intLookup, hIntMap, testSize);
compareByHIteratorInt(intLookup, hIntMap);
populateByRandomIntKeysInt(intLookup, hIntMap, testSize);
compareByHIteratorInt(intLookup, hIntMap);
} catch (Exception e) {
failed = true;
}
assertTrue(!failed);
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:21,代码来源:TestHashStructures.java
示例3: populateByRandomIntKeysInt
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
void populateByRandomIntKeysInt(DoubleIntIndex intLookup,
org.hsqldb.lib.IntKeyHashMap hMap,
int testSize) throws Exception {
for (int i = 0; i < testSize; i++) {
int intValue = randomgen.nextInt();
intLookup.addUnique(intValue, i);
hMap.put(intValue, new Integer(i));
// actually this can happen as duplicates are allowed in DoubleIntTable
if (intLookup.size() != hMap.size()) {
throw new Exception("Duplicate random in int lookup");
}
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:TestHashStructures.java
示例4: compareByHIteratorInt
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
void compareByHIteratorInt(DoubleIntIndex intLookup,
org.hsqldb.lib.IntKeyHashMap hMap)
throws Exception {
org.hsqldb.lib.Iterator hIt = hMap.keySet().iterator();
for (int i = 0; hIt.hasNext(); i++) {
int hK = hIt.nextInt();
int lookup = intLookup.findFirstEqualKeyIndex(hK);
int lV = intLookup.getValue(lookup);
Integer hV = (Integer) hMap.get(hK);
if (hV.intValue() != lV) {
throw new Exception("HashMap value mismatch");
}
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:18,代码来源:TestHashStructures.java
示例5: getTransactionIDList
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
/**
* Return a lookup of all row ids for cached tables in transactions.
* For auto-defrag, as currently there will be no RowAction entries
* at the time of defrag.
*/
public DoubleIntIndex getTransactionIDList() {
writeLock.lock();
try {
DoubleIntIndex lookup = new DoubleIntIndex(10, false);
lookup.setKeysSearchTarget();
Iterator it = this.rowActionMap.keySet().iterator();
for (; it.hasNext(); ) {
lookup.addUnique(it.nextInt(), 0);
}
return lookup;
} finally {
writeLock.unlock();
}
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:26,代码来源:TransactionManager.java
示例6: convertTransactionIDs
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
/**
* Convert row ID's for cached table rows in transactions
*/
public void convertTransactionIDs(DoubleIntIndex lookup) {
writeLock.lock();
try {
RowAction[] list = new RowAction[rowActionMap.size()];
Iterator it = this.rowActionMap.values().iterator();
for (int i = 0; it.hasNext(); i++) {
list[i] = (RowAction) it.next();
}
rowActionMap.clear();
for (int i = 0; i < list.length; i++) {
int pos = lookup.lookupFirstEqual(list[i].getPos());
list[i].setPos(pos);
rowActionMap.put(pos, list[i]);
}
} finally {
writeLock.unlock();
}
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:28,代码来源:TransactionManager.java
示例7: getTransactionIDList
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
/**
* Return a lookup of all transactions ids for cached tables.
*/
public DoubleIntIndex getTransactionIDList() {
Session[] sessions = database.sessionManager.getAllSessions();
DoubleIntIndex lookup = new DoubleIntIndex(10, false);
lookup.setKeysSearchTarget();
for (int i = 0; i < sessions.length; i++) {
HsqlArrayList tlist = sessions[i].rowActionList;
for (int j = 0, size = tlist.size(); j < size; j++) {
Transaction tx = (Transaction) tlist.get(j);
if (tx.tTable.getTableType() == Table.CACHED_TABLE) {
lookup.addUnique(tx.row.getPos(), 0);
}
}
}
return lookup;
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:TransactionManager.java
示例8: convertTransactionIDs
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
/**
* Convert row ID's for cached table rows in transactions
*/
public void convertTransactionIDs(DoubleIntIndex lookup) {
Session[] sessions = database.sessionManager.getAllSessions();
for (int i = 0; i < sessions.length; i++) {
HsqlArrayList tlist = sessions[i].rowActionList;
for (int j = 0, size = tlist.size(); j < size; j++) {
Transaction tx = (Transaction) tlist.get(j);
if (tx.tTable.getTableType() == Table.CACHED_TABLE) {
int pos = lookup.lookupFirstEqual(tx.row.getPos());
tx.row.setPos(pos);
}
}
}
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:TransactionManager.java
示例9: freeTableSpace
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
public void freeTableSpace(int spaceId, DoubleIntIndex spaceList,
long offset, long limit, boolean full) {
totalFragmentSize += spaceList.getTotalValues()
* cache.getDataFileScale();
if (full) {
if (cache.fileFreePosition == limit) {
cache.writeLock.lock();
try {
cache.fileFreePosition = offset;
} finally {
cache.writeLock.unlock();
}
} else {
totalFragmentSize += limit - offset;
}
if (spaceList.size() != 0) {
lookup = new DoubleIntIndex(spaceList.size(), true);
spaceList.copyTo(lookup);
spaceList.clear();
}
} else {
spaceList.compactLookupAsIntervals();
spaceList.setValuesSearchTarget();
spaceList.sort();
int extra = spaceList.size() - spaceList.capacity() / 2;
if (extra > 0) {
spaceList.removeRange(0, extra);
totalFragmentSize -= spaceList.getTotalValues()
* cache.getDataFileScale();
}
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:41,代码来源:DataSpaceManagerSimple.java
示例10: initialiseFileBlock
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
public void initialiseFileBlock(DoubleIntIndex spaceList,
long blockFreePos, long blockLimit) {
freshBlockFreePos = blockFreePos;
freshBlockLimit = blockLimit;
if (spaceList != null) {
spaceList.copyTo(lookup);
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:11,代码来源:TableSpaceManagerBlocks.java
示例11: populateBySerialIntKeysInt
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
void populateBySerialIntKeysInt(DoubleIntIndex intLookup,
org.hsqldb.lib.IntKeyHashMap hMap,
int testSize) throws Exception {
for (int i = 0; i < testSize; i++) {
int intValue = randomgen.nextInt();
intLookup.addUnique(i, intValue);
hMap.put(i, new Integer(intValue));
if (intLookup.size() != hMap.size()) {
throw new Exception("HashMap size mismatch");
}
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:16,代码来源:TestHashStructures.java
示例12: setTransactionRowLookups
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
void setTransactionRowLookups(DoubleIntIndex pointerLookup) {
for (int i = 0, size = transactionRowLookup.size(); i < size; i++) {
int key = transactionRowLookup.getKey(i);
int lookupIndex = pointerLookup.findFirstEqualKeyIndex(key);
if (lookupIndex != -1) {
transactionRowLookup.setValue(
i, pointerLookup.getValue(lookupIndex));
}
}
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:13,代码来源:DataFileDefrag.java
示例13: DataFileBlockManager
import org.hsqldb.lib.DoubleIntIndex; //导入依赖的package包/类
/**
*
*/
public DataFileBlockManager(int capacity, int scale, long lostSize) {
lookup = new DoubleIntIndex(capacity, true);
lookup.setValuesSearchTarget();
this.capacity = capacity;
this.scale = scale;
this.lostFreeBlockSize = lostSize;
this.midSize = 128; // arbitrary initial value
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:15,代码来源:DataFileBlockManager.java
注:本文中的org.hsqldb.lib.DoubleIntIndex类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论