本文整理汇总了Java中com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests类的典型用法代码示例。如果您正苦于以下问题:Java OrderedKeyStoreTests类的具体用法?Java OrderedKeyStoreTests怎么用?Java OrderedKeyStoreTests使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrderedKeyStoreTests类属于com.thinkaurelius.titan.testcategory包,在下文中一共展示了OrderedKeyStoreTests类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetKeysWithKeyRange
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
@Test
@Category({OrderedKeyStoreTests.class})
public void testGetKeysWithKeyRange() throws Exception {
if (!manager.getFeatures().hasOrderedScan()) {
log.warn("Can't test ordered scans on incompatible store. "
+ "This warning could indicate reduced test coverage and "
+ "shouldn't happen in an ideal JUnit configuration. "
+ "Skipping test {}.", name.getMethodName());
return;
}
populateDBWith100Keys();
tx.commit();
tx = startTx();
KeyIterator keyIterator = store.getKeys(new KeyRangeQuery(
KeyColumnValueStoreUtil.longToByteBuffer(10), // key start
KeyColumnValueStoreUtil.longToByteBuffer(40), // key end
new ReadArrayBuffer("b".getBytes()), // column start
new ReadArrayBuffer("c".getBytes())), tx);
examineGetKeysResults(keyIterator, 10, 40, 1);
}
示例2: testOrderedConfiguration
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
@Test
@Category({ OrderedKeyStoreTests.class })
public void testOrderedConfiguration() {
if (!manager.getFeatures().hasOrderedScan()) {
log.warn(
"Can't test key-ordered features on incompatible store. "
+ "This warning could indicate reduced test coverage and "
+ "a broken JUnit configuration. Skipping test {}.",
name.getMethodName());
return;
}
StoreFeatures features = manager.getFeatures();
assertTrue(features.isKeyOrdered());
}
示例3: testConfiguration
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
@Test
@Category({ OrderedKeyStoreTests.class })
public void testConfiguration() {
StoreFeatures features = manager.getFeatures();
assertTrue(features.isKeyOrdered());
assertTrue(features.hasLocalKeyPartition());
}
示例4: testGetLocalKeyPartition
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
@Test
@Category({ OrderedKeyStoreTests.class })
public void testGetLocalKeyPartition() throws BackendException {
List<KeyRange> local = manager.getLocalKeyPartition();
assertNotNull(local);
assertEquals(1, local.size());
assertNotNull(local.get(0).getStart());
assertNotNull(local.get(0).getEnd());
}
示例5: testOrderedGetKeysRespectsKeyLimit
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
/**
* Verify that
* {@link KeyColumnValueStore#getKeys(KeyRangeQuery, StoreTransaction)}
* treats the lower key bound as inclusive and the upper key bound as
* exclusive. Verify that keys less than the start and greater than or equal
* to the end containing matching columns are not returned.
*
* @throws BackendException
*/
@Test
@Category({OrderedKeyStoreTests.class})
public void testOrderedGetKeysRespectsKeyLimit() throws BackendException {
if (!manager.getFeatures().hasOrderedScan()) {
log.warn("Can't test key-ordered features on incompatible store. "
+ "This warning could indicate reduced test coverage and "
+ "a broken JUnit configuration. Skipping test {}.",
name.getMethodName());
return;
}
Preconditions.checkArgument(4 <= numKeys);
Preconditions.checkArgument(4 <= numColumns);
final long minKey = KeyValueStoreUtil.idOffset + 1;
final long maxKey = KeyValueStoreUtil.idOffset + numKeys - 2;
final long expectedKeyCount = maxKey - minKey;
String[][] values = generateValues();
loadValues(values);
final SliceQuery columnSlice = new SliceQuery(BufferUtil.zeroBuffer(8), BufferUtil.oneBuffer(8)).setLimit(1);
KeyIterator keys;
keys = store.getKeys(new KeyRangeQuery(BufferUtil.getLongBuffer(minKey), BufferUtil.getLongBuffer(maxKey), columnSlice), tx);
assertEquals(expectedKeyCount, KeyValueStoreUtil.count(keys));
clopen();
keys = store.getKeys(new KeyRangeQuery(BufferUtil.getLongBuffer(minKey), BufferUtil.getLongBuffer(maxKey), columnSlice), tx);
assertEquals(expectedKeyCount, KeyValueStoreUtil.count(keys));
}
示例6: testSetup
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
@Test
@Category({ OrderedKeyStoreTests.class })
public void testSetup() {
final IDManager idManager = graph.getIDManager();
assertEquals(8, idManager.getPartitionBound());
Set<Long> hashs = Sets.newHashSet();
for (long i=1;i<idManager.getPartitionBound()*2;i++) hashs.add(idManager.getPartitionHashForId(i));
assertTrue(hashs.size()>idManager.getPartitionBound()/2);
assertNotEquals(idManager.getPartitionHashForId(101),idManager.getPartitionHashForId(102));
}
示例7: testVLabelOnOrderedStorage
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
@Test
@Category({ OrderedKeyStoreTests.class })
public void testVLabelOnOrderedStorage() {
final String label = "pl";
mgmt.makeVertexLabel(label).partition().make();
mgmt.commit();
graph.rollback();
graph.addVertexWithLabel(label);
graph.commit();
mgmt = graph.getManagementSystem();
VertexLabel vl = mgmt.getVertexLabel(label);
assertTrue(vl.isPartitioned());
mgmt.rollback();
}
示例8: testGetDeployment
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
@Test
@Category({ OrderedKeyStoreTests.class })
public void testGetDeployment() {
assertEquals(Deployment.LOCAL, manager.getDeployment());
}
示例9: testGraphOfTheGodsWithBOP
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
@Test
@Category({ OrderedKeyStoreTests.class })
public void testGraphOfTheGodsWithBOP() throws Exception {
unzipAndRunExpect("faunus-cassandra.expect.vm", ImmutableMap.of("cassandraPartitioner", "org.apache.cassandra.dht.ByteOrderedPartitioner"));
}
示例10: testOrderedConfig
import com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests; //导入依赖的package包/类
@Test
@Category({ OrderedKeyStoreTests.class })
public void testOrderedConfig() {
assertTrue(graph.getConfiguration().isClusterPartitioned());
}