本文整理匯總了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);
}
}
示例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;
}
示例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));
}
}
示例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);
}
}
示例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);
}
示例6: ExternalCachePersistor
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
public ExternalCachePersistor(KCVSCache kcvs, CacheTransaction tx) {
this.kcvs = kcvs;
this.tx = tx;
}
示例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);
}
示例8: getCache
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache; //導入依賴的package包/類
public abstract KCVSCache getCache(KeyColumnValueStore store);