當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。