当前位置: 首页>>代码示例>>Java>>正文


Java Exchange类代码示例

本文整理汇总了Java中com.persistit.Exchange的典型用法代码示例。如果您正苦于以下问题:Java Exchange类的具体用法?Java Exchange怎么用?Java Exchange使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Exchange类属于com.persistit包,在下文中一共展示了Exchange类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: randomWrite

import com.persistit.Exchange; //导入依赖的package包/类
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
@Warmup(iterations = WARMUP_ITERATIONS)
@Measurement(iterations = MEASUREMENT_ITERATIONS)
@Fork(FORKS)
public void randomWrite() throws PersistitException {
    final Exchange exchange = createTestStore();
    for (final ByteIterable key : randomKeys) {
        exchange.clear();
        for (int i = 0; i < key.getLength(); i++) {
            exchange.append(key.getBytesUnsafe()[i]);
        }
        exchange.getValue().put(key.getBytesUnsafe());
        exchange.store();
    }
    persistit.flush();
}
 
开发者ID:JetBrains,项目名称:xodus,代码行数:18,代码来源:JMHPersistItTokyoCabinetWriteBenchmark.java

示例2: randomRead

import com.persistit.Exchange; //导入依赖的package包/类
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
@Warmup(iterations = WARMUP_ITERATIONS)
@Measurement(iterations = MEASUREMENT_ITERATIONS)
@Fork(FORKS)
public void randomRead(final Blackhole bh) throws PersistitException {
    final Exchange exchange = createTestStore();
    for (final ByteIterable key : randomKeys) {
        exchange.clear();
        for (int i = 0; i < key.getLength(); i++) {
            exchange.append(key.getBytesUnsafe()[i]);
        }
        exchange.fetch();

        bh.consume(((byte[]) exchange.getValue().get()).length);
    }
}
 
开发者ID:JetBrains,项目名称:xodus,代码行数:18,代码来源:JMHPersistItTokyoCabinetReadBenchmark.java

示例3: writeSuccessiveKeys

import com.persistit.Exchange; //导入依赖的package包/类
void writeSuccessiveKeys(@NotNull final Exchange store) throws PersistitException {
    for (final ByteIterable key : successiveKeys) {
        exchange.clear();
        for (int i = 0; i < key.getLength(); i++) {
            exchange.append(key.getBytesUnsafe()[i]);
        }
        exchange.getValue().put(key.getBytesUnsafe());
        exchange.store();
    }
    persistit.flush();
}
 
开发者ID:JetBrains,项目名称:xodus,代码行数:12,代码来源:JMHPersistItTokyoCabinetBenchmarkBase.java

示例4: successiveRead

import com.persistit.Exchange; //导入依赖的package包/类
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
@Warmup(iterations = WARMUP_ITERATIONS)
@Measurement(iterations = MEASUREMENT_ITERATIONS)
@Fork(FORKS)
public void successiveRead(final Blackhole bh) throws PersistitException {
    final Exchange exchange = createTestStore();
    exchange.clear();
    exchange.append(Key.BEFORE);
    while (exchange.traverse(Key.GT, true)) {
        bh.consume(exchange.getKey().toString().length());
        bh.consume(((byte[]) exchange.getValue().get()).length);
    }
}
 
开发者ID:JetBrains,项目名称:xodus,代码行数:15,代码来源:JMHPersistItTokyoCabinetReadBenchmark.java

示例5: getExchange

import com.persistit.Exchange; //导入依赖的package包/类
public Exchange getExchange(String treeName, Boolean create) throws StorageException {
    synchronized (this) {
        Exchange exchange;
        try {
            assign();
            exchange = db.getExchange(VOLUME_NAME, treeName, create);
            return exchange;
        } catch (PersistitException ex) {
            throw new PermanentStorageException(ex);
        }
    }
}
 
开发者ID:thinkaurelius,项目名称:titan-experimental,代码行数:13,代码来源:PersistitTransaction.java

示例6: createTestStore

import com.persistit.Exchange; //导入依赖的package包/类
Exchange createTestStore() throws PersistitException {
    if (exchange == null) {
        exchange = persistit.getExchange(volume, "testTokyoCabinet", true);
    }
    return exchange;
}
 
开发者ID:JetBrains,项目名称:xodus,代码行数:7,代码来源:JMHPersistItTokyoCabinetBenchmarkBase.java

示例7: releaseExchange

import com.persistit.Exchange; //导入依赖的package包/类
public void releaseExchange(Exchange exchange) {
    //
}
 
开发者ID:thinkaurelius,项目名称:titan-experimental,代码行数:4,代码来源:PersistitTransaction.java


注:本文中的com.persistit.Exchange类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。