/** * Sets a {@link DataSource} to use for the RDB document and blob * stores. * * @return this */ public RDBDocumentNodeStoreBuilder setRDBConnection(DataSource ds) { setRDBConnection(ds, new RDBOptions()); return thisBuilder(); }
/** * Creates a {@linkplain RDBDocumentStore} instance using the provided * {@link DataSource}, {@link DocumentNodeStoreBuilder}, and {@link RDBOptions}. */ public RDBDocumentStore(DataSource ds, DocumentNodeStoreBuilder<?> builder, RDBOptions options) { try { initialize(ds, builder, options); } catch (Exception ex) { throw asDocumentStoreException(ex, "initializing RDB document store"); } }
private <T extends Document> DocumentStoreException handleException(String message, Exception ex, Collection<T> collection, java.util.Collection<String> ids) { if (collection == Collection.NODES) { for (String id : ids) { invalidateCache(collection, id, false); } } return asDocumentStoreException(ex, message); }
public RDBDocumentStoreJDBCTest(DocumentStoreFixture dsf) { super(dsf); assumeTrue(super.rdbDataSource != null); dbInfo = RDBDocumentStoreDB.getValue(((RDBDocumentStore) super.ds).getMetadata().get("db")); RDBDocumentSerializer ser = new RDBDocumentSerializer(super.ds); jdbc = new RDBDocumentStoreJDBC(dbInfo, ser, 100, 10000); }
private void internalClose() { this.rs = closeResultSet(this.rs); this.stmt = closeStatement(this.stmt); this.ch.closeConnection(this.connection); this.connection = null; if (LOG.isDebugEnabled()) { LOG.debug(this.message + " -> " + this.cnt + " results in " + elapsed + "ms"); } } }
public MyFixture(String name, String url, String username, String passwd) { this.name = name; try { dataSource = new RDBDataSourceWrapper(RDBDataSourceFactory.forJdbcUrl(url, username, passwd)); } catch (Exception ex) { LOG.info("Database instance not available at " + url + ", skipping tests...", ex); } }
/** * Creates a {@linkplain RDBBlobStore} instance using the provided * {@link DataSource} using default {@link RDBOptions}. */ public RDBBlobStore(DataSource ds) { this(ds, new RDBOptions()); }
public MissingLastRevSeeker createMissingLastRevSeeker() { final DocumentStore store = getDocumentStore(); if (store instanceof RDBDocumentStore) { return new RDBMissingLastRevSeeker((RDBDocumentStore) store, getClock()); } else { return super.createMissingLastRevSeeker(); } } }
public Iterable<ReferencedBlob> createReferencedBlobs(DocumentNodeStore ns) { final DocumentStore store = getDocumentStore(); if (store instanceof RDBDocumentStore) { return () -> new RDBBlobReferenceIterator(ns, (RDBDocumentStore) store); } else { return super.createReferencedBlobs(ns); } }
@Override public <T extends Document> void remove(Collection<T> collection, List<String> ids) { try { delete(collection, ids); } finally { for (String id : ids) { invalidateCache(collection, id, true); } } }
@Override public String checkVersion(DatabaseMetaData md) throws SQLException { return RDBJDBCTools.versionCheck(md, 1, 4, description); } },
@Override public CacheInvalidationStats invalidateCache(Iterable<String> keys) { for (String key : keys) { invalidateCache(Collection.NODES, key); } return null; }
/** * @return a new {@link RDBDocumentNodeStoreBuilder}. */ public static RDBDocumentNodeStoreBuilder newRDBDocumentNodeStoreBuilder() { return new RDBDocumentNodeStoreBuilder(); }
/** * Sets a {@link DataSource} to use for the RDB document and blob * stores. * * @return this */ public RDBDocumentNodeStoreBuilder setRDBConnection(DataSource ds) { setRDBConnection(ds, new RDBOptions()); return thisBuilder(); }
/** * Creates a {@linkplain RDBDocumentStore} instance using the provided * {@link DataSource}, {@link DocumentNodeStoreBuilder}, and default * {@link RDBOptions}. */ public RDBDocumentStore(DataSource ds, DocumentNodeStoreBuilder<?> builder) { this(ds, builder, new RDBOptions()); }
/** * Creates a {@linkplain RDBDocumentStore} instance using the provided * {@link DataSource}, {@link DocumentNodeStoreBuilder}, and {@link RDBOptions}. */ public RDBDocumentStore(DataSource ds, DocumentNodeStoreBuilder<?> builder, RDBOptions options) { try { initialize(ds, builder, options); } catch (Exception ex) { throw asDocumentStoreException(ex, "initializing RDB document store"); } }
private <T extends Document> DocumentStoreException handleException(String message, Exception ex, Collection<T> collection, java.util.Collection<String> ids) { if (collection == Collection.NODES) { for (String id : ids) { invalidateCache(collection, id, false); } } return asDocumentStoreException(ex, message); }
@Override public <T extends Document> void remove(Collection<T> collection, List<String> ids) { try { delete(collection, ids); } finally { for (String id : ids) { invalidateCache(collection, id, true); } } }
@Override public String checkVersion(DatabaseMetaData md) throws SQLException { return RDBJDBCTools.versionCheck(md, 10, 11, description); } },
@Override public String checkVersion(DatabaseMetaData md) throws SQLException { return RDBJDBCTools.versionCheck(md, 10, 11, description); } },