本文整理汇总了Java中com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager类的典型用法代码示例。如果您正苦于以下问题:Java KeyColumnValueStoreManager类的具体用法?Java KeyColumnValueStoreManager怎么用?Java KeyColumnValueStoreManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KeyColumnValueStoreManager类属于com.thinkaurelius.titan.diskstorage.keycolumnvalue包,在下文中一共展示了KeyColumnValueStoreManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getConfig
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public WriteConfiguration getConfig() {
final KeyColumnValueStoreManager manager = new InMemoryStoreManager(Configuration.EMPTY);
ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
config.set(GraphDatabaseConfiguration.TIMESTAMP_PROVIDER, TimestampProviders.MICRO);
try {
return new KCVSConfiguration(new BackendOperation.TransactionalProvider() {
@Override
public StoreTransaction openTx() throws BackendException {
return manager.beginTransaction(StandardBaseTransactionConfig.of(TimestampProviders.MICRO, manager.getFeatures().getKeyConsistentTxConfig()));
}
@Override
public void close() throws BackendException {
manager.close();
}
}, config, manager.openDatabase("titan"),"general");
} catch (BackendException e) {
throw new RuntimeException(e);
}
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:22,代码来源:KCVSConfigTest.java
示例2: getConfig
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public WriteConfiguration getConfig() {
final KeyColumnValueStoreManager manager = new InMemoryStoreManager(Configuration.EMPTY);
try {
return new KCVSConfiguration(new BackendOperation.TransactionalProvider() {
@Override
public StoreTransaction openTx() throws BackendException {
return manager.beginTransaction(StandardBaseTransactionConfig.of(Timestamps.MICRO, manager.getFeatures().getKeyConsistentTxConfig()));
}
@Override
public void close() throws BackendException {
manager.close();
}
}, Timestamps.MICRO,manager.openDatabase("titan"),"general");
} catch (BackendException e) {
throw new RuntimeException(e);
}
}
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:20,代码来源:KCVSConfigTest.java
示例3: testSimpleScan
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Test
public void testSimpleScan()
throws InterruptedException, ExecutionException, IOException, BackendException {
int keys = 1000;
int cols = 40;
String[][] values = KeyValueStoreUtil.generateData(keys, cols);
//Make it only half the number of columns for every 2nd key
for (int i = 0; i < values.length; i++) {
if (i%2==0) values[i]= Arrays.copyOf(values[i], cols / 2);
}
log.debug("Loading values: " + keys + "x" + cols);
KeyColumnValueStoreManager mgr = new CassandraThriftStoreManager(GraphDatabaseConfiguration.buildGraphConfiguration());
KeyColumnValueStore store = mgr.openDatabase("edgestore");
StoreTransaction tx = mgr.beginTransaction(StandardBaseTransactionConfig.of(TimestampProviders.MICRO));
KeyColumnValueStoreUtil.loadValues(store, tx, values);
tx.commit(); // noop on Cassandra, but harmless
SimpleScanJobRunner runner = (ScanJob job, Configuration jobConf, String rootNSName) -> {
try {
return new CassandraHadoopScanRunner(job).scanJobConf(jobConf).scanJobConfRoot(rootNSName)
.partitionerOverride("org.apache.cassandra.dht.Murmur3Partitioner").run();
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
};
SimpleScanJob.runBasicTests(keys, cols, runner);
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:32,代码来源:CassandraScanJobIT.java
示例4: StandardScanner
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
public StandardScanner(final KeyColumnValueStoreManager manager) {
Preconditions.checkArgument(manager!=null);
Preconditions.checkArgument(manager.getFeatures().hasScan(),"Provided data store does not support scans: %s",manager);
this.manager = manager;
this.openStores = new HashSet<>(4);
this.runningJobs = new ConcurrentHashMap<>();
this.jobCounter = new AtomicLong(0);
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:10,代码来源:StandardScanner.java
示例5: CacheTransaction
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
public CacheTransaction(StoreTransaction tx, KeyColumnValueStoreManager manager, int persistChunkSize,
Duration maxWriteTime, boolean batchLoading, int expectedNumStores) {
Preconditions.checkArgument(tx != null && manager != null && persistChunkSize > 0);
this.tx = tx;
this.manager = manager;
this.batchLoading = batchLoading;
this.numMutations = 0;
this.persistChunkSize = persistChunkSize;
this.maxWriteTime = maxWriteTime;
this.mutations = new HashMap<KCVSCache, Map<StaticBuffer, KCVEntryMutation>>(expectedNumStores);
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:12,代码来源:CacheTransaction.java
示例6: TTLKCVSManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
public TTLKCVSManager(KeyColumnValueStoreManager manager) {
super(manager);
Preconditions.checkArgument(manager.getFeatures().hasCellTTL());
Preconditions.checkArgument(!manager.getFeatures().hasStoreTTL(),
"Using TTLKCVSManager with %s is redundant: underlying implementation already supports store-level ttl",
manager);
this.features = new StandardStoreFeatures.Builder(manager.getFeatures()).storeTTL(true).build();
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:9,代码来源:TTLKCVSManager.java
示例7: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
public KeyColumnValueStoreManager openStorageManager() throws StorageException {
Configuration config = PersistitStorageSetup.getPersistitGraphConfig();
PersistitStoreManager sm = new PersistitStoreManager(config.subset(STORAGE_NAMESPACE));
// The same as BerkeleyJE in hash prefixed mode, Persistit doesn't support ordered key iteration
sm.features.supportsOrderedScan = false;
sm.features.supportsUnorderedScan = false;
return new OrderedKeyValueStoreManagerAdapter(sm);
}
开发者ID:thinkaurelius,项目名称:titan-experimental,代码行数:11,代码来源:PersistitHashKeyColumnValueTest.java
示例8: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager() throws BackendException {
return new AstyanaxStoreManager(CassandraStorageSetup.getAstyanaxConfiguration(getClass().getSimpleName()));
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:AstyanaxLogTest.java
示例9: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager(int idx) throws BackendException {
return new AstyanaxStoreManager(CassandraStorageSetup.getAstyanaxConfiguration(getClass().getSimpleName()));
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:AstyanaxLockStoreTest.java
示例10: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager() throws BackendException {
return new CassandraEmbeddedStoreManager(CassandraStorageSetup.getEmbeddedConfiguration(getClass().getSimpleName()));
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:EmbeddedMultiWriteStoreTest.java
示例11: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager(int idx) throws BackendException {
return new CassandraEmbeddedStoreManager(CassandraStorageSetup.getEmbeddedConfiguration(getClass().getSimpleName()));
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:EmbeddedLockStoreTest.java
示例12: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager() throws BackendException {
return new CassandraThriftStoreManager(CassandraStorageSetup.getCassandraThriftConfiguration(this.getClass().getSimpleName()));
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:ThriftIDAuthorityTest.java
示例13: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager(int idx) throws BackendException {
return new CassandraThriftStoreManager(CassandraStorageSetup.getCassandraThriftConfiguration(this.getClass().getSimpleName()));
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:ThriftLockStoreTest.java
示例14: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager() throws BackendException {
return new CassandraThriftStoreManager(new BasicConfiguration(GraphDatabaseConfiguration.ROOT_NS,getConfiguration(), BasicConfiguration.Restriction.NONE));
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:ThriftGraphIterativeTest.java
示例15: setupMocks
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Before
public void setupMocks() throws BackendException {
// Initialize mock controller
ctrl = EasyMock.createStrictControl();
ctrl.checkOrder(true);
// Setup some config mocks and objects
backingManager = ctrl.createMock(KeyColumnValueStoreManager.class);
lockerProvider = ctrl.createMock(LockerProvider.class);
globalConfig = GraphDatabaseConfiguration.buildGraphConfiguration();
localConfig = GraphDatabaseConfiguration.buildGraphConfiguration();
defaultConfig = GraphDatabaseConfiguration.buildGraphConfiguration();
// Set some properties on the configs, just so that global/local/default can be easily distinguished
globalConfig.set(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID, "global");
localConfig.set(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID, "local");
defaultConfig.set(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID, "default");
defaultTxConfig = new StandardBaseTransactionConfig.Builder().customOptions(defaultConfig).timestampProvider(TimestampProviders.MICRO).build();
backingFeatures = new StandardStoreFeatures.Builder().keyConsistent(globalConfig, localConfig).build();
// Setup behavior specification starts below this line
// 1. Construct manager
// The EVCSManager ctor retrieves the backing store's features and stores it in an instance field
expect(backingManager.getFeatures()).andReturn(backingFeatures).once();
// 2. Begin transaction
// EVCTx begins two transactions on the backingManager: one with globalConfig and one with localConfig
// The capture is used in the @After method to check the config
txConfigCapture = new Capture<BaseTransactionConfig>(CaptureType.ALL);
inconsistentTx = ctrl.createMock(StoreTransaction.class);
consistentTx = ctrl.createMock(StoreTransaction.class);
expect(backingManager.beginTransaction(capture(txConfigCapture))).andReturn(inconsistentTx);
expect(backingManager.beginTransaction(capture(txConfigCapture))).andReturn(consistentTx);
// 3. Open a database
backingLocker = ctrl.createMock(Locker.class);
backingStore = ctrl.createMock(KeyColumnValueStore.class);
expect(backingManager.openDatabase(STORE_NAME)).andReturn(backingStore);
expect(backingStore.getName()).andReturn(STORE_NAME);
expect(lockerProvider.getLocker(LOCKER_NAME)).andReturn(backingLocker);
// Carry out setup behavior against mocks
ctrl.replay();
// 1. Construct manager
expectManager = new ExpectedValueCheckingStoreManager(backingManager, LOCK_SUFFIX, lockerProvider, Duration.ofSeconds(1L));
// 2. Begin transaction
expectTx = expectManager.beginTransaction(defaultTxConfig);
// 3. Open a database
expectStore = expectManager.openDatabase(STORE_NAME);
// Verify behavior and reset the mocks for test methods to use
ctrl.verify();
ctrl.reset();
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:58,代码来源:ExpectedValueCheckingTest.java
示例16: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager() throws BackendException {
return new InMemoryStoreManager();
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:InMemoryKeyColumnValueStoreTest.java
示例17: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager(int id) throws BackendException {
return new InMemoryStoreManager();
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:InMemoryLockKeyColumnValueStoreTest.java
示例18: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
@Override
public KeyColumnValueStoreManager openStorageManager() throws BackendException {
return sharedManager;
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:InMemoryIDAuthorityTest.java
示例19: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
public KeyColumnValueStoreManager openStorageManager() throws BackendException {
BerkeleyJEStoreManager sm = new BerkeleyJEStoreManager(BerkeleyStorageSetup.getBerkeleyJEConfiguration());
return new OrderedKeyValueStoreManagerAdapter(sm);
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:BerkeleyVariableLengthKCVSTest.java
示例20: openStorageManager
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; //导入依赖的package包/类
public KeyColumnValueStoreManager openStorageManager() throws BackendException {
BerkeleyJEStoreManager sm = new BerkeleyJEStoreManager(BerkeleyStorageSetup.getBerkeleyJEConfiguration());
return new OrderedKeyValueStoreManagerAdapter(sm, ImmutableMap.of(storeName, 8));
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:5,代码来源:BerkeleyFixedLengthKCVSTest.java
注:本文中的com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论