@Override public StoreTransaction openTx() throws BackendException { return manager.beginTransaction(storeTxConfigBuilder.build()); } @Override
@Override public void setup() throws Exception { StoreManager m = openStorageManager(); m.clearStorage(); m.close(); super.setup(); }
@Override public List<KeyRange> getLocalIDPartition() throws BackendException { return manager.getLocalKeyPartition(); }
protected StandardBaseTransactionConfig getConsistentTxConfig(StoreManager manager) { return StandardBaseTransactionConfig.of(times,manager.getFeatures().getKeyConsistentTxConfig()); }
private static void assertStorageExists(Backend backend, boolean exists) throws Exception { final String suffix = exists ? "should exist before clearing" : "should not exist after clearing"; assertTrue("graph " + suffix, backend.getStoreManager().exists() == exists); for (final IndexInformation index : backend.getIndexInformation().values()) { assertTrue("index " + suffix, ((IndexProvider) index).exists() == exists); } }
public ConsistentKeyIDAuthority(KeyColumnValueStore idStore, StoreManager manager, Configuration config) throws BackendException { super(config); Preconditions.checkArgument(manager.getFeatures().isKeyConsistent()); this.manager = manager; this.idStore = idStore; Preconditions.checkNotNull(times); supportsInterruption = manager.getFeatures().supportsInterruption(); randomUniqueIDLimit,uniqueIDUpperBound); uniqueId = -1; storeTxConfigBuilder.customOptions(manager.getFeatures().getKeyConsistentTxConfig()); } else { randomizeUniqueId = false; if (conflictAvoidanceMode.equals(ConflictAvoidanceMode.LOCAL_MANUAL)) { Preconditions.checkArgument(config.has(IDAUTHORITY_CAV_TAG),"Need to configure a unique id in order to use local consistency"); storeTxConfigBuilder.customOptions(manager.getFeatures().getLocalKeyConsistentTxConfig()); } else { storeTxConfigBuilder.customOptions(manager.getFeatures().getKeyConsistentTxConfig());
/** * Ensure clearing storage actually removes underlying database. * @throws Exception */ @Test public void testClearStorage() throws Exception { tearDown(); config.set(ConfigElement.getPath(GraphDatabaseConfiguration.DROP_ON_CLEAR), true); final Backend backend = getBackend(config, false); assertTrue("graph should exist before clearing storage", backend.getStoreManager().exists()); clearGraph(config); assertFalse("graph should not exist after clearing storage", backend.getStoreManager().exists()); }
@Before public void setUp() throws Exception { StoreManager m = openStorageManager(); m.clearStorage(); m.close(); open(); }
@Override public StoreTransaction openTx() throws BackendException { return manager.beginTransaction(storeTxConfigBuilder.build()); }
@Before public void setUp() throws Exception { StoreManager m = openStorageManager(); m.clearStorage(); m.close(); open(); }
private StoreTransaction overrideTimestamp(final StoreTransaction tx, final Instant commitTime) throws BackendException { StandardBaseTransactionConfig newCfg = new StandardBaseTransactionConfig.Builder(tx.getConfiguration()) .commitTime(commitTime).build(); return manager.beginTransaction(newCfg); }
@Before public void setUp() throws Exception { StoreManager m = openStorageManager(); m.clearStorage(); m.close(); open(); }
@Before public void setUp() throws Exception { StoreManager m = openStorageManager(); m.clearStorage(); m.close(); open(); }
@Before public void setUp() throws Exception { StoreManager tmp = null; try { tmp = openStorageManager(0, GraphDatabaseConfiguration.buildGraphConfiguration()); tmp.clearStorage(); } finally { tmp.close(); } for (int i = 0; i < CONCURRENCY; i++) { LocalLockMediators.INSTANCE.clear(concreteClassName + i); } open(); k = KeyValueStoreUtil.getBuffer("testkey"); c1 = KeyValueStoreUtil.getBuffer("col1"); c2 = KeyValueStoreUtil.getBuffer("col2"); v1 = KeyValueStoreUtil.getBuffer("val1"); v2 = KeyValueStoreUtil.getBuffer("val2"); }