protected String[] getTables() { // core tables final List<String> tableNames = Lists.newArrayList( tableLayoutStrategy.getSpo(), tableLayoutStrategy.getPo(), tableLayoutStrategy.getOsp(), tableLayoutStrategy.getNs(), tableLayoutStrategy.getEval()); // Additional Tables for (final AccumuloIndexer index : secondaryIndexers) { tableNames.add(index.getTableName()); } return tableNames.toArray(new String[]{}); }
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; }
tables.add( coreTableNames.getSpo() ); tables.add( coreTableNames.getPo() ); tables.add( coreTableNames.getOsp() ); tables.add( coreTableNames.getEval() ); tables.add( coreTableNames.getNs() ); tables.add( coreTableNames.getProspects() ); tables.add( coreTableNames.getSelectivity() );
@Override public String getNamespace(final String pfx) throws RyaDAOException { try { final Scanner scanner = connector.createScanner(tableLayoutStrategy.getNs(), ALL_AUTHORIZATIONS); scanner.fetchColumn(INFO_NAMESPACE_TXT, EMPTY_TEXT); scanner.setRange(new Range(new Text(pfx))); final Iterator<Map.Entry<Key, Value>> iterator = scanner .iterator(); if (iterator.hasNext()) { return new String(iterator.next().getValue().get(), StandardCharsets.UTF_8); } } catch (final Exception e) { throw new RyaDAOException(e); } return null; }
@Override public void init() throws RdfDAOException { try { if (isInitialized()) { throw new IllegalStateException("Already initialized"); } checkNotNull(connector); tableLayoutStrategy = conf.getTableLayoutStrategy(); // evalTable = conf.get(RdfCloudTripleStoreConfiguration.CONF_TBL_EVAL, evalTable); // conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_EVAL, evalTable); final TableOperations tos = connector.tableOperations(); AccumuloRdfUtils.createTableIfNotExist(tos, tableLayoutStrategy.getEval()); // boolean tableExists = tos.exists(evalTable); // if (!tableExists) // tos.create(evalTable); isInitialized.set(true); } catch (final Exception e) { throw new RdfDAOException(e); } }
@Override public void init() throws RdfDAOException { try { if (isInitialized()) { throw new IllegalStateException("Already initialized"); } if (!resd.isInitialized()) { resd.init(); } checkNotNull(connector); tableLayoutStrategy = conf.getTableLayoutStrategy(); TableOperations tos = connector.tableOperations(); AccumuloRdfUtils.createTableIfNotExist(tos, tableLayoutStrategy.getSelectivity()); AccumuloRdfUtils.createTableIfNotExist(tos, tableLayoutStrategy.getProspects()); initialized = true; } catch (Exception e) { throw new RdfDAOException(e); } }
public int getTableSize(RdfCloudTripleStoreConfiguration conf) throws TableNotFoundException { Authorizations authorizations = getAuths(conf); if (joinMap.containsKey("subjectpredicateobject" + DELIM + "FullTableCardinality")) { FullTableCardinality = joinMap.get("subjectpredicateobject" + DELIM + "FullTableCardinality").intValue(); return FullTableCardinality; } if (FullTableCardinality == 0) { Scanner joinScanner = connector.createScanner(tableLayoutStrategy.getSelectivity(), authorizations); joinScanner.setRange(Range.prefix(new Text("subjectpredicateobject" + DELIM + "FullTableCardinality"))); Iterator<Map.Entry<Key,Value>> iterator = joinScanner.iterator(); if (iterator.hasNext()) { Map.Entry<Key,Value> entry = iterator.next(); if (entry.getKey().getColumnFamily().toString().equals("FullTableCardinality")) { String Count = entry.getKey().getColumnQualifier().toString(); FullTableCardinality = Integer.parseInt(Count); } } if (FullTableCardinality == 0) { throw new RuntimeException("Table does not contain full cardinality"); } } return FullTableCardinality; }
tables.add( coreTableNames.getSpo() ); tables.add( coreTableNames.getPo() ); tables.add( coreTableNames.getOsp() ); tables.add( coreTableNames.getEval() ); tables.add( coreTableNames.getNs() ); tables.add( coreTableNames.getProspects() ); tables.add( coreTableNames.getSelectivity() );
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; }
@Override public String getNamespace(final String pfx) throws RyaDAOException { try { final Scanner scanner = connector.createScanner(tableLayoutStrategy.getNs(), ALL_AUTHORIZATIONS); scanner.fetchColumn(INFO_NAMESPACE_TXT, EMPTY_TEXT); scanner.setRange(new Range(new Text(pfx))); final Iterator<Map.Entry<Key, Value>> iterator = scanner .iterator(); if (iterator.hasNext()) { return new String(iterator.next().getValue().get(), StandardCharsets.UTF_8); } } catch (final Exception e) { throw new RyaDAOException(e); } return null; }
@Override public void init() throws RdfDAOException { try { if (isInitialized()) { throw new IllegalStateException("Already initialized"); } checkNotNull(connector); tableLayoutStrategy = conf.getTableLayoutStrategy(); // evalTable = conf.get(RdfCloudTripleStoreConfiguration.CONF_TBL_EVAL, evalTable); // conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_EVAL, evalTable); final TableOperations tos = connector.tableOperations(); AccumuloRdfUtils.createTableIfNotExist(tos, tableLayoutStrategy.getEval()); // boolean tableExists = tos.exists(evalTable); // if (!tableExists) // tos.create(evalTable); isInitialized.set(true); } catch (final Exception e) { throw new RdfDAOException(e); } }
Scanner joinScanner = connector.createScanner(tableLayoutStrategy.getSelectivity(), authorizations); joinScanner.setRange(Range.prefix(row1)); Scanner joinScanner = connector.createScanner(tableLayoutStrategy.getSelectivity(), authorizations); joinScanner.setRange(Range.prefix(row2)); for (Map.Entry<Key,Value> entry : joinScanner) { Scanner joinScanner = connector.createScanner(tableLayoutStrategy.getSelectivity(), authorizations); joinScanner.setRange(Range.prefix(row1)); boolean found1 = false; Scanner joinScanner = connector.createScanner(tableLayoutStrategy.getSelectivity(), authorizations); joinScanner.setRange(Range.prefix(row2)); boolean found1 = false;
protected String[] getTables() { // core tables final List<String> tableNames = Lists.newArrayList( tableLayoutStrategy.getSpo(), tableLayoutStrategy.getPo(), tableLayoutStrategy.getOsp(), tableLayoutStrategy.getNs(), tableLayoutStrategy.getEval()); // Additional Tables for (final AccumuloIndexer index : secondaryIndexers) { tableNames.add(index.getTableName()); } return tableNames.toArray(new String[]{}); }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public CloseableIteration<Namespace, RyaDAOException> iterateNamespace() throws RyaDAOException { try { final Scanner scanner = connector.createScanner(tableLayoutStrategy.getNs(), ALL_AUTHORIZATIONS); scanner.fetchColumnFamily(INFO_NAMESPACE_TXT); final Iterator<Map.Entry<Key, Value>> result = scanner.iterator(); return new AccumuloNamespaceTableIterator(result); } catch (final Exception e) { throw new RyaDAOException(e); } }
try { final Authorizations authorizations = conf.getAuthorizations(); final Scanner scanner = connector.createScanner(tableLayoutStrategy.getEval(), authorizations); Text cfTxt = null; if (CARDINALITY_OF.SUBJECT.equals(card)) {
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()); }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public CloseableIteration<Namespace, RyaDAOException> iterateNamespace() throws RyaDAOException { try { final Scanner scanner = connector.createScanner(tableLayoutStrategy.getNs(), ALL_AUTHORIZATIONS); scanner.fetchColumnFamily(INFO_NAMESPACE_TXT); final Iterator<Map.Entry<Key, Value>> result = scanner.iterator(); return new AccumuloNamespaceTableIterator(result); } catch (final Exception e) { throw new RyaDAOException(e); } }
try { final Authorizations authorizations = conf.getAuthorizations(); final Scanner scanner = connector.createScanner(tableLayoutStrategy.getEval(), authorizations); Text cfTxt = null; if (CARDINALITY_OF.SUBJECT.equals(card)) {