本文整理汇总了Java中org.apache.cassandra.config.DatabaseDescriptor.getIndexAccessMode方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseDescriptor.getIndexAccessMode方法的具体用法?Java DatabaseDescriptor.getIndexAccessMode怎么用?Java DatabaseDescriptor.getIndexAccessMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.config.DatabaseDescriptor
的用法示例。
在下文中一共展示了DatabaseDescriptor.getIndexAccessMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RepairOption
import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
public RepairOption(RepairParallelism parallelism, boolean primaryRange, boolean incremental, boolean trace, int jobThreads, Collection<Range<Token>> ranges, boolean isSubrangeRepair)
{
if (FBUtilities.isWindows() &&
(DatabaseDescriptor.getDiskAccessMode() != Config.DiskAccessMode.standard || DatabaseDescriptor.getIndexAccessMode() != Config.DiskAccessMode.standard) &&
parallelism == RepairParallelism.SEQUENTIAL)
{
logger.warn("Sequential repair disabled when memory-mapped I/O is configured on Windows. Reverting to parallel.");
this.parallelism = RepairParallelism.PARALLEL;
}
else
this.parallelism = parallelism;
this.primaryRange = primaryRange;
this.incremental = incremental;
this.trace = trace;
this.jobThreads = jobThreads;
this.ranges.addAll(ranges);
this.isSubrangeRepair = isSubrangeRepair;
}
示例2: defineSchema
import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
if (FBUtilities.isWindows())
{
standardMode = DatabaseDescriptor.getDiskAccessMode();
indexMode = DatabaseDescriptor.getIndexAccessMode();
DatabaseDescriptor.setDiskAccessMode(Config.DiskAccessMode.standard);
DatabaseDescriptor.setIndexAccessMode(Config.DiskAccessMode.standard);
}
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE, CF),
SchemaLoader.standardCFMD(KEYSPACE, CF_SMALL_MAX_VALUE));
maxValueSize = DatabaseDescriptor.getMaxValueSize();
DatabaseDescriptor.setMaxValueSize(1024 * 1024); // set max value size to 1MB
}
示例3: testParseOptions
import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
@Test
public void testParseOptions()
{
IPartitioner partitioner = Murmur3Partitioner.instance;
Token.TokenFactory tokenFactory = partitioner.getTokenFactory();
// parse with empty options
RepairOption option = RepairOption.parse(new HashMap<String, String>(), partitioner);
if (FBUtilities.isWindows() && (DatabaseDescriptor.getDiskAccessMode() != Config.DiskAccessMode.standard || DatabaseDescriptor.getIndexAccessMode() != Config.DiskAccessMode.standard))
assertTrue(option.getParallelism() == RepairParallelism.PARALLEL);
else
assertTrue(option.getParallelism() == RepairParallelism.SEQUENTIAL);
assertFalse(option.isPrimaryRange());
assertFalse(option.isIncremental());
// parse everything
Map<String, String> options = new HashMap<>();
options.put(RepairOption.PARALLELISM_KEY, "parallel");
options.put(RepairOption.PRIMARY_RANGE_KEY, "false");
options.put(RepairOption.INCREMENTAL_KEY, "false");
options.put(RepairOption.RANGES_KEY, "0:10,11:20,21:30");
options.put(RepairOption.COLUMNFAMILIES_KEY, "cf1,cf2,cf3");
options.put(RepairOption.DATACENTERS_KEY, "dc1,dc2,dc3");
options.put(RepairOption.HOSTS_KEY, "127.0.0.1,127.0.0.2,127.0.0.3");
option = RepairOption.parse(options, partitioner);
assertTrue(option.getParallelism() == RepairParallelism.PARALLEL);
assertFalse(option.isPrimaryRange());
assertFalse(option.isIncremental());
Set<Range<Token>> expectedRanges = new HashSet<>(3);
expectedRanges.add(new Range<>(tokenFactory.fromString("0"), tokenFactory.fromString("10")));
expectedRanges.add(new Range<>(tokenFactory.fromString("11"), tokenFactory.fromString("20")));
expectedRanges.add(new Range<>(tokenFactory.fromString("21"), tokenFactory.fromString("30")));
assertEquals(expectedRanges, option.getRanges());
Set<String> expectedCFs = new HashSet<>(3);
expectedCFs.add("cf1");
expectedCFs.add("cf2");
expectedCFs.add("cf3");
assertEquals(expectedCFs, option.getColumnFamilies());
Set<String> expectedDCs = new HashSet<>(3);
expectedDCs.add("dc1");
expectedDCs.add("dc2");
expectedDCs.add("dc3");
assertEquals(expectedDCs, option.getDataCenters());
Set<String> expectedHosts = new HashSet<>(3);
expectedHosts.add("127.0.0.1");
expectedHosts.add("127.0.0.2");
expectedHosts.add("127.0.0.3");
assertEquals(expectedHosts, option.getHosts());
}