本文整理汇总了Java中com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager类的典型用法代码示例。如果您正苦于以下问题:Java AbstractCassandraStoreManager类的具体用法?Java AbstractCassandraStoreManager怎么用?Java AbstractCassandraStoreManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractCassandraStoreManager类属于com.thinkaurelius.titan.diskstorage.cassandra包,在下文中一共展示了AbstractCassandraStoreManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGraphConfigUsedByThreadBoundTx
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
@Test
public void testGraphConfigUsedByThreadBoundTx() {
close();
WriteConfiguration wc = getConfiguration();
wc.set(ConfigElement.getPath(CASSANDRA_READ_CONSISTENCY), "ALL");
wc.set(ConfigElement.getPath(CASSANDRA_WRITE_CONSISTENCY), "LOCAL_QUORUM");
graph = (StandardTitanGraph) TitanFactory.open(wc);
StandardTitanTx tx = (StandardTitanTx)graph.getCurrentThreadTx();
assertEquals("ALL",
tx.getTxHandle().getBaseTransactionConfig().getCustomOptions()
.get(AbstractCassandraStoreManager.CASSANDRA_READ_CONSISTENCY));
assertEquals("LOCAL_QUORUM",
tx.getTxHandle().getBaseTransactionConfig().getCustomOptions()
.get(AbstractCassandraStoreManager.CASSANDRA_WRITE_CONSISTENCY));
}
示例2: testGraphConfigUsedByTx
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
@Test
public void testGraphConfigUsedByTx() {
close();
WriteConfiguration wc = getConfiguration();
wc.set(ConfigElement.getPath(CASSANDRA_READ_CONSISTENCY), "TWO");
wc.set(ConfigElement.getPath(CASSANDRA_WRITE_CONSISTENCY), "THREE");
graph = (StandardTitanGraph) TitanFactory.open(wc);
StandardTitanTx tx = (StandardTitanTx)graph.newTransaction();
assertEquals("TWO",
tx.getTxHandle().getBaseTransactionConfig().getCustomOptions()
.get(AbstractCassandraStoreManager.CASSANDRA_READ_CONSISTENCY));
assertEquals("THREE",
tx.getTxHandle().getBaseTransactionConfig().getCustomOptions()
.get(AbstractCassandraStoreManager.CASSANDRA_WRITE_CONSISTENCY));
tx.rollback();
}
示例3: testCustomConfigUsedByTx
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
@Test
public void testCustomConfigUsedByTx() {
close();
WriteConfiguration wc = getConfiguration();
wc.set(ConfigElement.getPath(CASSANDRA_READ_CONSISTENCY), "ALL");
wc.set(ConfigElement.getPath(CASSANDRA_WRITE_CONSISTENCY), "ALL");
graph = (StandardTitanGraph) TitanFactory.open(wc);
StandardTitanTx tx = (StandardTitanTx)graph.buildTransaction()
.customOption(ConfigElement.getPath(CASSANDRA_READ_CONSISTENCY), "ONE")
.customOption(ConfigElement.getPath(CASSANDRA_WRITE_CONSISTENCY), "TWO").start();
assertEquals("ONE",
tx.getTxHandle().getBaseTransactionConfig().getCustomOptions()
.get(AbstractCassandraStoreManager.CASSANDRA_READ_CONSISTENCY));
assertEquals("TWO",
tx.getTxHandle().getBaseTransactionConfig().getCustomOptions()
.get(AbstractCassandraStoreManager.CASSANDRA_WRITE_CONSISTENCY));
tx.rollback();
}
示例4: setConf
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
@Override
public void setConf(final Configuration config) {
super.setConf(config);
// Copy some Titan configuration keys to the Hadoop Configuration keys used by Cassandra's ColumnFamilyInputFormat
ConfigHelper.setInputInitialAddress(config, titanConf.get(GraphDatabaseConfiguration.STORAGE_HOSTS)[0]);
if (titanConf.has(GraphDatabaseConfiguration.STORAGE_PORT))
ConfigHelper.setInputRpcPort(config, String.valueOf(titanConf.get(GraphDatabaseConfiguration.STORAGE_PORT)));
if (titanConf.has(GraphDatabaseConfiguration.AUTH_USERNAME))
ConfigHelper.setInputKeyspaceUserName(config, titanConf.get(GraphDatabaseConfiguration.AUTH_USERNAME));
if (titanConf.has(GraphDatabaseConfiguration.AUTH_PASSWORD))
ConfigHelper.setInputKeyspacePassword(config, titanConf.get(GraphDatabaseConfiguration.AUTH_PASSWORD));
// Copy keyspace, force the CF setting to edgestore, honor widerows when set
final boolean wideRows = config.getBoolean(INPUT_WIDEROWS_CONFIG, false);
// Use the setInputColumnFamily overload that includes a widerows argument; using the overload without this argument forces it false
ConfigHelper.setInputColumnFamily(config, titanConf.get(AbstractCassandraStoreManager.CASSANDRA_KEYSPACE),
mrConf.get(TitanHadoopConfiguration.COLUMN_FAMILY_NAME), wideRows);
log.debug("Set keyspace: {}", titanConf.get(AbstractCassandraStoreManager.CASSANDRA_KEYSPACE));
// Set the column slice bounds via Faunus's vertex query filter
final SlicePredicate predicate = new SlicePredicate();
final int rangeBatchSize = config.getInt(RANGE_BATCH_SIZE_CONFIG, Integer.MAX_VALUE);
predicate.setSlice_range(getSliceRange(TitanHadoopSetupCommon.DEFAULT_SLICE_QUERY, rangeBatchSize)); // TODO stop slicing the whole row
ConfigHelper.setInputSlicePredicate(config, predicate);
}
示例5: testCustomConfigUsedByTx
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
@Test
public void testCustomConfigUsedByTx() {
close();
WriteConfiguration wc = getConfiguration();
wc.set(ConfigElement.getPath(CASSANDRA_READ_CONSISTENCY), "ALL");
wc.set(ConfigElement.getPath(CASSANDRA_WRITE_CONSISTENCY), "ALL");
graph = (StandardTitanGraph) TitanFactory.open(wc);
StandardTitanTx tx = (StandardTitanTx)graph.buildTransaction()
.setCustomOption(ConfigElement.getPath(CASSANDRA_READ_CONSISTENCY), "ONE")
.setCustomOption(ConfigElement.getPath(CASSANDRA_WRITE_CONSISTENCY), "TWO").start();
assertEquals("ONE",
tx.getTxHandle().getBaseTransactionConfig().getCustomOptions()
.get(AbstractCassandraStoreManager.CASSANDRA_READ_CONSISTENCY));
assertEquals("TWO",
tx.getTxHandle().getBaseTransactionConfig().getCustomOptions()
.get(AbstractCassandraStoreManager.CASSANDRA_WRITE_CONSISTENCY));
tx.rollback();
}
示例6: generateGraph
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
public static TitanGraph generateGraph(final ModifiableHadoopConfiguration titanConf) {
final Class<? extends OutputFormat> format = titanConf.getClass(OUTPUT_FORMAT, OutputFormat.class, OutputFormat.class);
if (TitanOutputFormat.class.isAssignableFrom(format)) {
ModifiableConfiguration mc = titanConf.getOutputConf();
boolean present = mc.has(AbstractCassandraStoreManager.CASSANDRA_KEYSPACE);
LOGGER.trace("Keyspace in_config=" + present + " value=" + mc.get(AbstractCassandraStoreManager.CASSANDRA_KEYSPACE));
TitanGraph g = TitanFactory.open(mc);
// final boolean checkTypes = titanConf.get(TitanHadoopConfiguration.OUTPUT_TITAN_TYPE_CHECKING);
//
// if (checkTypes) {
// FaunusSchemaManager.getTypeManager(null).setSchemaProvider(new SchemaContainer(g));
// }
return g;
} else {
throw new RuntimeException("The provide graph output format is not a supported TitanOutputFormat: " + format.getName());
}
}
示例7: enableSSL
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
private static ModifiableConfiguration enableSSL(ModifiableConfiguration mc) {
mc.set(AbstractCassandraStoreManager.SSL_ENABLED, true);
mc.set(STORAGE_HOSTS, new String[]{ "localhost" });
mc.set(AbstractCassandraStoreManager.SSL_TRUSTSTORE_LOCATION,
Joiner.on(File.separator).join("target", "cassandra", "conf", "localhost-murmur-ssl", "test.truststore"));
mc.set(AbstractCassandraStoreManager.SSL_TRUSTSTORE_PASSWORD, "cassandra");
return mc;
}
示例8: setConf
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
@Override
public void setConf(final Configuration config) {
super.setConf(config);
// Copy some Titan configuration keys to the Hadoop Configuration keys used by Cassandra's ColumnFamilyInputFormat
ConfigHelper.setInputInitialAddress(config, inputConf.get(GraphDatabaseConfiguration.STORAGE_HOSTS)[0]);
if (inputConf.has(GraphDatabaseConfiguration.STORAGE_PORT))
ConfigHelper.setInputRpcPort(config, String.valueOf(inputConf.get(GraphDatabaseConfiguration.STORAGE_PORT)));
if (inputConf.has(GraphDatabaseConfiguration.AUTH_USERNAME))
ConfigHelper.setInputKeyspaceUserName(config, inputConf.get(GraphDatabaseConfiguration.AUTH_USERNAME));
if (inputConf.has(GraphDatabaseConfiguration.AUTH_PASSWORD))
ConfigHelper.setInputKeyspacePassword(config, inputConf.get(GraphDatabaseConfiguration.AUTH_PASSWORD));
// Copy keyspace, force the CF setting to edgestore, honor widerows when set
final boolean wideRows = config.getBoolean(INPUT_WIDEROWS_CONFIG, INPUT_WIDEROWS_DEFAULT);
// Use the setInputColumnFamily overload that includes a widerows argument; using the overload without this
// argument forces it false
ConfigHelper.setInputColumnFamily(config, inputConf.get(AbstractCassandraStoreManager.CASSANDRA_KEYSPACE), Backend.EDGESTORE_NAME, wideRows);
// Set the column slice bounds via Faunus's vertex query filter
final SlicePredicate predicate = new SlicePredicate();
final int rangeBatchSize = config.getInt(RANGE_BATCH_SIZE_CONFIG, Integer.MAX_VALUE);
predicate.setSlice_range(getSliceRange(TitanHadoopSetupCommon.getDefaultSliceQuery(), rangeBatchSize));
ConfigHelper.setInputSlicePredicate(config, predicate);
this.config = config;
}
示例9: openStorageManager
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
@Override
public AbstractCassandraStoreManager openStorageManager(Configuration c) throws BackendException {
return new AstyanaxStoreManager(c);
}
示例10: openStorageManager
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
@Override
public AbstractCassandraStoreManager openStorageManager(Configuration c) throws BackendException {
return new CassandraEmbeddedStoreManager(c);
}
示例11: openStorageManager
import com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager; //导入依赖的package包/类
@Override
public AbstractCassandraStoreManager openStorageManager(Configuration c) throws BackendException {
return new CassandraThriftStoreManager(c);
}