@Override public <V> V getCustomOption(ConfigOption<V> opt) { return handleConfig.getCustomOption(opt); }
private Lock getLock(StoreTransaction txh) { Boolean txOn = txh.getConfiguration().getCustomOption(STORAGE_TRANSACTIONAL); if (null != txOn && txOn) { ReentrantLock result = lock; if (result == null) { synchronized (this) { result = lock; if (result == null) { lock = result = new ReentrantLock(); } } } return result; } else return NoLock.INSTANCE; }
@After public void verifyMocks() { ctrl.verify(); ctrl.reset(); // Check capture created in the @Before method assertTrue(txConfigCapture.hasCaptured()); List<BaseTransactionConfig> transactionConfigurations = txConfigCapture.getValues(); assertEquals(2, transactionConfigurations.size()); // First backing store transaction should use default tx config assertEquals("default", transactionConfigurations.get(0).getCustomOption(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID)); // Second backing store transaction should use global strong consistency config assertEquals("global", transactionConfigurations.get(1).getCustomOption(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID)); // The order in which these transactions are opened isn't really significant; // testing them in order is kind of over-specifying the implementation's behavior. // Could probably relax the ordering selectively here with some thought, but // I want to keep order checking on in general for the EasyMock control. }
public CQLTransaction(final BaseTransactionConfig config) { super(config); this.readConsistencyLevel = ConsistencyLevel.valueOf(getConfiguration().getCustomOption(READ_CONSISTENCY)); this.writeConsistencyLevel = ConsistencyLevel.valueOf(getConfiguration().getCustomOption(WRITE_CONSISTENCY)); }