public static String layoutPrefixToTable(TABLE_LAYOUT layout, String prefix) { return layoutToTable(layout, new TablePrefixLayoutStrategy(prefix)); }
final TablePrefixLayoutStrategy prefixStrategy = new TablePrefixLayoutStrategy(tablePrefix); tables.clear(); tables.add(prefixStrategy.getSpo()); tables.add(prefixStrategy.getOsp()); tables.add(prefixStrategy.getPo()); tables.add(prefixStrategy.getNs()); ruleset.addTable(prefixStrategy.getNs()); for (final String line : ruleset.toString().split("\n")) { log.info(line);
public static String layoutPrefixToTable(TABLE_LAYOUT layout, String prefix) { return layoutToTable(layout, new TablePrefixLayoutStrategy(prefix)); }
public void setTablePrefix(final String tablePrefix) { Preconditions.checkNotNull(tablePrefix); set(CONF_TBL_PREFIX, tablePrefix); setTableLayoutStrategy(new TablePrefixLayoutStrategy(tablePrefix)); //TODO: Should we change the layout strategy }
public void setTablePrefix(final String tablePrefix) { Preconditions.checkNotNull(tablePrefix); set(CONF_TBL_PREFIX, tablePrefix); setTableLayoutStrategy(new TablePrefixLayoutStrategy(tablePrefix)); //TODO: Should we change the layout strategy }
private static final String[] EMPTY_STR_ARR = new String[0]; private TableLayoutStrategy tableLayoutStrategy = new TablePrefixLayoutStrategy();
private static final String[] EMPTY_STR_ARR = new String[0]; private TableLayoutStrategy tableLayoutStrategy = new TablePrefixLayoutStrategy();
public static String layoutToTable(TABLE_LAYOUT layout, TableLayoutStrategy tableLayoutStrategy) { if (tableLayoutStrategy == null) { tableLayoutStrategy = new TablePrefixLayoutStrategy(); } switch (layout) { case SPO: { return tableLayoutStrategy.getSpo(); } case PO: { return tableLayoutStrategy.getPo(); } case OSP: { return tableLayoutStrategy.getOsp(); } } return null; }
public static String layoutToTable(TABLE_LAYOUT layout, TableLayoutStrategy tableLayoutStrategy) { if (tableLayoutStrategy == null) { tableLayoutStrategy = new TablePrefixLayoutStrategy(); } switch (layout) { case SPO: { return tableLayoutStrategy.getSpo(); } case PO: { return tableLayoutStrategy.getPo(); } case OSP: { return tableLayoutStrategy.getOsp(); } } return null; }
/** * Creates an AccumuloRyaDAO after updating the AccumuloRdfConfiguration so that it is consistent * with the configuration of the RyaInstance that the user is trying to connect to. This ensures * that user configuration aligns with Rya instance configuration and prevents the creation of * new index tables based on a user's query configuration. This method requires the {@link AccumuloRyaInstanceDetailsRepository} * to exist. * * @param config - user's query configuration * @return - AccumuloRyaDAO with an updated configuration that is consistent with the Rya instance configuration * @throws AccumuloException * @throws AccumuloSecurityException * @throws RyaDAOException */ public static AccumuloRyaDAO getAccumuloDAOWithUpdatedConfig(final AccumuloRdfConfiguration config) throws AccumuloException, AccumuloSecurityException, RyaDAOException { final String ryaInstance = config.get(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX); Objects.requireNonNull(ryaInstance, "RyaInstance or table prefix is missing from configuration."+RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX); final String user = config.get(AccumuloRdfConfiguration.CLOUDBASE_USER); final String pswd = config.get(AccumuloRdfConfiguration.CLOUDBASE_PASSWORD); Objects.requireNonNull(user, "Accumulo user name is missing from configuration."+AccumuloRdfConfiguration.CLOUDBASE_USER); Objects.requireNonNull(pswd, "Accumulo user password is missing from configuration."+AccumuloRdfConfiguration.CLOUDBASE_PASSWORD); config.setTableLayoutStrategy( new TablePrefixLayoutStrategy(ryaInstance) ); updateAccumuloConfig(config, user, pswd, ryaInstance); return getAccumuloDAO(config); }
/** * Creates an AccumuloRyaDAO after updating the AccumuloRdfConfiguration so that it is consistent * with the configuration of the RyaInstance that the user is trying to connect to. This ensures * that user configuration aligns with Rya instance configuration and prevents the creation of * new index tables based on a user's query configuration. This method requires the {@link AccumuloRyaInstanceDetailsRepository} * to exist. * * @param config - user's query configuration * @return - AccumuloRyaDAO with an updated configuration that is consistent with the Rya instance configuration * @throws AccumuloException * @throws AccumuloSecurityException * @throws RyaDAOException */ public static AccumuloRyaDAO getAccumuloDAOWithUpdatedConfig(final AccumuloRdfConfiguration config) throws AccumuloException, AccumuloSecurityException, RyaDAOException { final String ryaInstance = config.get(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX); Objects.requireNonNull(ryaInstance, "RyaInstance or table prefix is missing from configuration."+RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX); final String user = config.get(AccumuloRdfConfiguration.CLOUDBASE_USER); final String pswd = config.get(AccumuloRdfConfiguration.CLOUDBASE_PASSWORD); Objects.requireNonNull(user, "Accumulo user name is missing from configuration."+AccumuloRdfConfiguration.CLOUDBASE_USER); Objects.requireNonNull(pswd, "Accumulo user password is missing from configuration."+AccumuloRdfConfiguration.CLOUDBASE_PASSWORD); config.setTableLayoutStrategy( new TablePrefixLayoutStrategy(ryaInstance) ); updateAccumuloConfig(config, user, pswd, ryaInstance); return getAccumuloDAO(config); }
final TableLayoutStrategy coreTableNames = new TablePrefixLayoutStrategy(ryaInstanceName); tables.add( coreTableNames.getSpo() ); tables.add( coreTableNames.getPo() );
final TableLayoutStrategy coreTableNames = new TablePrefixLayoutStrategy(ryaInstanceName); tables.add( coreTableNames.getSpo() ); tables.add( coreTableNames.getPo() );
public void setTableLayoutStrategy(final TableLayoutStrategy tableLayoutStrategy) { if (tableLayoutStrategy != null) { this.tableLayoutStrategy = tableLayoutStrategy; } else { this.tableLayoutStrategy = new TablePrefixLayoutStrategy(); //default } set(CONF_TBL_SPO, this.tableLayoutStrategy.getSpo()); set(CONF_TBL_PO, this.tableLayoutStrategy.getPo()); set(CONF_TBL_OSP, this.tableLayoutStrategy.getOsp()); set(CONF_TBL_NS, this.tableLayoutStrategy.getNs()); set(CONF_TBL_EVAL, this.tableLayoutStrategy.getEval()); }
public void setTableLayoutStrategy(final TableLayoutStrategy tableLayoutStrategy) { if (tableLayoutStrategy != null) { this.tableLayoutStrategy = tableLayoutStrategy; } else { this.tableLayoutStrategy = new TablePrefixLayoutStrategy(); //default } set(CONF_TBL_SPO, this.tableLayoutStrategy.getSpo()); set(CONF_TBL_PO, this.tableLayoutStrategy.getPo()); set(CONF_TBL_OSP, this.tableLayoutStrategy.getOsp()); set(CONF_TBL_NS, this.tableLayoutStrategy.getNs()); set(CONF_TBL_EVAL, this.tableLayoutStrategy.getEval()); }
Objects.requireNonNull(user, "Accumulo user name is missing from configuration."+ConfigUtils.CLOUDBASE_USER); Objects.requireNonNull(pswd, "Accumulo user password is missing from configuration."+ConfigUtils.CLOUDBASE_PASSWORD); rdfConfig.setTableLayoutStrategy( new TablePrefixLayoutStrategy(ryaInstance) ); updateAccumuloConfig((AccumuloRdfConfiguration) rdfConfig, user, pswd, ryaInstance); dao = getAccumuloDAO((AccumuloRdfConfiguration)rdfConfig);
Objects.requireNonNull(user, "Accumulo user name is missing from configuration."+ConfigUtils.CLOUDBASE_USER); Objects.requireNonNull(pswd, "Accumulo user password is missing from configuration."+ConfigUtils.CLOUDBASE_PASSWORD); rdfConfig.setTableLayoutStrategy( new TablePrefixLayoutStrategy(ryaInstance) ); updateAccumuloConfig((AccumuloRdfConfiguration) rdfConfig, user, pswd, ryaInstance); dao = getAccumuloDAO((AccumuloRdfConfiguration)rdfConfig);