當前位置: 首頁>>代碼示例>>Java>>正文


Java KCVSCache類代碼示例

本文整理匯總了Java中com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache的典型用法代碼示例。如果您正苦於以下問題:Java KCVSCache類的具體用法?Java KCVSCache怎麽用?Java KCVSCache使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


KCVSCache類屬於com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache包,在下文中一共展示了KCVSCache類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: add

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
@Override
public void add(StaticBuffer key, Entry cell) {
    try {
        kcvs.mutateEntries(key, Lists.newArrayList(cell), KCVSCache.NO_DELETIONS,tx);
    } catch (BackendException e) {
        throw new TitanException("Unexpected storage exception in log persistence against cache",e);
    }
}
 
開發者ID:graben1437,項目名稱:titan1withtp3.1,代碼行數:9,代碼來源:ExternalCachePersistor.java

示例2: BackendTransaction

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
public BackendTransaction(CacheTransaction storeTx, BaseTransactionConfig txConfig,
                          StoreFeatures features, KCVSCache edgeStore, KCVSCache indexStore,
                          KCVSCache txLogStore, Duration maxReadTime,
                          Map<String, IndexTransaction> indexTx, Executor threadPool) {
    this.storeTx = storeTx;
    this.txConfig = txConfig;
    this.storeFeatures = features;
    this.edgeStore = edgeStore;
    this.indexStore = indexStore;
    this.txLogStore = txLogStore;
    this.maxReadTime = maxReadTime;
    this.indexTx = indexTx;
    this.threadPool = threadPool;
}
 
開發者ID:graben1437,項目名稱:titan1withtp3.1,代碼行數:15,代碼來源:BackendTransaction.java

示例3: deletionsAppliedBeforeAdditions

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
@Test
public void deletionsAppliedBeforeAdditions() throws BackendException {

    StaticBuffer b1 = KeyColumnValueStoreUtil.longToByteBuffer(1);

    Assert.assertNull(KCVSUtil.get(store1, b1, b1, tx));

    List<Entry> additions = Lists.newArrayList(StaticArrayEntry.of(b1, b1));

    List<Entry> deletions = Lists.newArrayList(additions);

    Map<StaticBuffer, KCVEntryMutation> combination = new HashMap<StaticBuffer, KCVEntryMutation>(1);
    Map<StaticBuffer, KCVEntryMutation> deleteOnly = new HashMap<StaticBuffer, KCVEntryMutation>(1);
    Map<StaticBuffer, KCVEntryMutation> addOnly = new HashMap<StaticBuffer, KCVEntryMutation>(1);

    combination.put(b1, new KCVEntryMutation(additions, deletions));
    deleteOnly.put(b1, new KCVEntryMutation(KeyColumnValueStore.NO_ADDITIONS, deletions));
    addOnly.put(b1, new KCVEntryMutation(additions, KCVSCache.NO_DELETIONS));

    store1.mutateEntries(b1, additions, deletions, tx);
    newTx();

    StaticBuffer result = KCVSUtil.get(store1, b1, b1, tx);

    Assert.assertEquals(b1, result);

    store1.mutateEntries(b1, NO_ADDITIONS, deletions, tx);
    newTx();

    for (int i = 0; i < 100; i++) {
        StaticBuffer n = KCVSUtil.get(store1, b1, b1, tx);
        Assert.assertNull(n);
        store1.mutateEntries(b1, additions, KCVSCache.NO_DELETIONS, tx);
        newTx();
        store1.mutateEntries(b1, NO_ADDITIONS, deletions, tx);
        newTx();
        n = KCVSUtil.get(store1, b1, b1, tx);
        Assert.assertNull(n);
    }

    for (int i = 0; i < 100; i++) {
        store1.mutateEntries(b1, NO_ADDITIONS, deletions, tx);
        newTx();
        store1.mutateEntries(b1, additions, KCVSCache.NO_DELETIONS, tx);
        newTx();
        Assert.assertEquals(b1, KCVSUtil.get(store1, b1, b1, tx));
    }

    for (int i = 0; i < 100; i++) {
        store1.mutateEntries(b1, additions, deletions, tx);
        newTx();
        Assert.assertEquals(b1, KCVSUtil.get(store1, b1, b1, tx));
    }
}
 
開發者ID:graben1437,項目名稱:titan1withtp3.1,代碼行數:55,代碼來源:MultiWriteKeyColumnValueStoreTest.java

示例4: applyChanges

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
public void applyChanges(Map<StaticBuffer, KCVEntryMutation> changes, KCVSCache store, StoreTransaction tx) throws BackendException {
    for (Map.Entry<StaticBuffer, KCVEntryMutation> change : changes.entrySet()) {
        store.mutateEntries(change.getKey(), change.getValue().getAdditions(), change.getValue().getDeletions(), tx);
    }
}
 
開發者ID:graben1437,項目名稱:titan1withtp3.1,代碼行數:6,代碼來源:MultiWriteKeyColumnValueStoreTest.java

示例5: getCache

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
@Override
public KCVSCache getCache(KeyColumnValueStore store) {
    return getCache(store,Duration.ofDays(1), Duration.ZERO);
}
 
開發者ID:graben1437,項目名稱:titan1withtp3.1,代碼行數:5,代碼來源:ExpirationCacheTest.java

示例6: ExternalCachePersistor

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
public ExternalCachePersistor(KCVSCache kcvs, CacheTransaction tx) {
    this.kcvs = kcvs;
    this.tx = tx;
}
 
開發者ID:graben1437,項目名稱:titan1withtp3.1,代碼行數:5,代碼來源:ExternalCachePersistor.java

示例7: getCache

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
@Override
public KCVSCache getCache(KeyColumnValueStore store) {
    return getCache(store,new StandardDuration(1,TimeUnit.DAYS),ZeroDuration.INSTANCE);
}
 
開發者ID:graben1437,項目名稱:titan0.5.4-hbase1.1.1-custom,代碼行數:5,代碼來源:ExpirationCacheTest.java

示例8: getCache

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
public abstract KCVSCache getCache(KeyColumnValueStore store); 
開發者ID:graben1437,項目名稱:titan1withtp3.1,代碼行數:2,代碼來源:KCVSCacheTest.java


注:本文中的com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。