public static void setInputInfo(Job job, AccumuloGraph graph, String instanceName, String zooKeepers, String principal, AuthenticationToken token, String[] authorizations) throws AccumuloSecurityException { String tableName = graph.getEdgesTableName(); setInputInfo(job, instanceName, zooKeepers, principal, token, authorizations, tableName); }
public static void setInputInfo(Job job, AccumuloGraph graph, String instanceName, String zooKeepers, String principal, AuthenticationToken token, String[] authorizations) throws AccumuloSecurityException { String tableName = graph.getEdgesTableName(); setInputInfo(job, instanceName, zooKeepers, principal, token, authorizations, tableName); }
public BatchWriter getEdgesWriter() { return getWriterForTable(getEdgesTableName()); }
public Iterable<Range> listEdgesTableSplits() { return listTableSplits(getEdgesTableName()); }
public Iterable<Range> listEdgesTableSplits() { return listTableSplits(getEdgesTableName()); }
public BatchWriter getEdgesWriter() { return getWriterForTable(getEdgesTableName()); }
public String getTableNameFromElementType(ElementType elementType) { switch (elementType) { case VERTEX: return getVerticesTableName(); case EDGE: return getEdgesTableName(); default: throw new VertexiumException("Unexpected element type: " + elementType); } }
public String getTableNameFromElementType(ElementType elementType) { switch (elementType) { case VERTEX: return getVerticesTableName(); case EDGE: return getEdgesTableName(); default: throw new VertexiumException("Unexpected element type: " + elementType); } }
AccumuloGraphConfiguration accumuloGraphConfiguration = new AccumuloGraphConfiguration(context.getConfiguration(), configPrefix); String tableNamePrefix = accumuloGraphConfiguration.getTableNamePrefix(); final Text edgesTableName = new Text(AccumuloGraph.getEdgesTableName(tableNamePrefix)); final Text dataTableName = new Text(AccumuloGraph.getDataTableName(tableNamePrefix)); final Text verticesTableName = new Text(AccumuloGraph.getVerticesTableName(tableNamePrefix));
AccumuloGraphConfiguration accumuloGraphConfiguration = new AccumuloGraphConfiguration(context.getConfiguration(), configPrefix); String tableNamePrefix = accumuloGraphConfiguration.getTableNamePrefix(); final Text edgesTableName = new Text(AccumuloGraph.getEdgesTableName(tableNamePrefix)); final Text dataTableName = new Text(AccumuloGraph.getDataTableName(tableNamePrefix)); final Text verticesTableName = new Text(AccumuloGraph.getVerticesTableName(tableNamePrefix));
@Test public void testListSplits() throws AccumuloSecurityException, TableNotFoundException, AccumuloException { SortedSet<Text> keys = new TreeSet<>(); keys.add(new Text("j")); getGraph().getConnector().tableOperations().addSplits(getGraph().getVerticesTableName(), keys); keys = new TreeSet<>(); keys.add(new Text("k")); getGraph().getConnector().tableOperations().addSplits(getGraph().getEdgesTableName(), keys); keys = new TreeSet<>(); keys.add(new Text("l")); getGraph().getConnector().tableOperations().addSplits(getGraph().getDataTableName(), keys); List<org.vertexium.Range> verticesTableSplits = toList(getGraph().listVerticesTableSplits()); assertEquals(2, verticesTableSplits.size()); assertEquals(null, verticesTableSplits.get(0).getInclusiveStart()); assertEquals("j", verticesTableSplits.get(0).getExclusiveEnd()); assertEquals("j", verticesTableSplits.get(1).getInclusiveStart()); assertEquals(null, verticesTableSplits.get(1).getExclusiveEnd()); List<org.vertexium.Range> edgesTableSplits = toList(getGraph().listEdgesTableSplits()); assertEquals(2, edgesTableSplits.size()); assertEquals(null, edgesTableSplits.get(0).getInclusiveStart()); assertEquals("k", edgesTableSplits.get(0).getExclusiveEnd()); assertEquals("k", edgesTableSplits.get(1).getInclusiveStart()); assertEquals(null, edgesTableSplits.get(1).getExclusiveEnd()); List<org.vertexium.Range> dataTableSplits = toList(getGraph().listDataTableSplits()); assertEquals(2, dataTableSplits.size()); assertEquals(null, dataTableSplits.get(0).getInclusiveStart()); assertEquals("l", dataTableSplits.get(0).getExclusiveEnd()); assertEquals("l", dataTableSplits.get(1).getInclusiveStart()); assertEquals(null, dataTableSplits.get(1).getExclusiveEnd()); }
@Override public void drop() { try { dropTableIfExists(getDataTableName()); dropTableIfExists(getEdgesTableName()); dropTableIfExists(getVerticesTableName()); dropTableIfExists(getMetadataTableName()); if (isHistoryInSeparateTable()) { dropTableIfExists(getHistoryEdgesTableName()); dropTableIfExists(getHistoryVerticesTableName()); } getSearchIndex().drop(this); } catch (Exception ex) { throw new VertexiumException("Could not drop tables", ex); } }
@Override public void drop() { try { dropTableIfExists(getDataTableName()); dropTableIfExists(getEdgesTableName()); dropTableIfExists(getVerticesTableName()); dropTableIfExists(getMetadataTableName()); if (isHistoryInSeparateTable()) { dropTableIfExists(getHistoryEdgesTableName()); dropTableIfExists(getHistoryVerticesTableName()); } getSearchIndex().drop(this); } catch (Exception ex) { throw new VertexiumException("Could not drop tables", ex); } }
this.graphMetadataStore = new AccumuloGraphMetadataStore(curatorFramework, zkPath); this.verticesTableName = getVerticesTableName(getConfiguration().getTableNamePrefix()); this.edgesTableName = getEdgesTableName(getConfiguration().getTableNamePrefix()); this.extendedDataTableName = getExtendedDataTableName(getConfiguration().getTableNamePrefix()); this.dataTableName = getDataTableName(getConfiguration().getTableNamePrefix());
public static AccumuloGraph create(AccumuloGraphConfiguration config) { if (config == null) { throw new IllegalArgumentException("config cannot be null"); } Connector connector = config.createConnector(); if (config.isHistoryInSeparateTable()) { ensureTableExists(connector, getVerticesTableName(config.getTableNamePrefix()), 1, config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getEdgesTableName(config.getTableNamePrefix()), 1, config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getHistoryVerticesTableName(config.getTableNamePrefix()), config.getMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getHistoryEdgesTableName(config.getTableNamePrefix()), config.getMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); ensureRowDeletingIteratorIsAttached(connector, getHistoryVerticesTableName(config.getTableNamePrefix())); ensureRowDeletingIteratorIsAttached(connector, getHistoryEdgesTableName(config.getTableNamePrefix())); } else { ensureTableExists(connector, getVerticesTableName(config.getTableNamePrefix()), config.getMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getEdgesTableName(config.getTableNamePrefix()), config.getMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); } ensureTableExists(connector, getExtendedDataTableName(config.getTableNamePrefix()), config.getExtendedDataMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getDataTableName(config.getTableNamePrefix()), 1, config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getMetadataTableName(config.getTableNamePrefix()), 1, config.getHdfsContextClasspath(), config.isCreateTables()); ensureRowDeletingIteratorIsAttached(connector, getVerticesTableName(config.getTableNamePrefix())); ensureRowDeletingIteratorIsAttached(connector, getEdgesTableName(config.getTableNamePrefix())); ensureRowDeletingIteratorIsAttached(connector, getDataTableName(config.getTableNamePrefix())); AccumuloGraph graph = new AccumuloGraph(config, connector); graph.setup(); return graph; }
this.graphMetadataStore = new AccumuloGraphMetadataStore(curatorFramework, zkPath); this.verticesTableName = getVerticesTableName(getConfiguration().getTableNamePrefix()); this.edgesTableName = getEdgesTableName(getConfiguration().getTableNamePrefix()); this.extendedDataTableName = getExtendedDataTableName(getConfiguration().getTableNamePrefix()); this.dataTableName = getDataTableName(getConfiguration().getTableNamePrefix());
public static AccumuloGraph create(AccumuloGraphConfiguration config) { if (config == null) { throw new IllegalArgumentException("config cannot be null"); } Connector connector = config.createConnector(); if (config.isHistoryInSeparateTable()) { ensureTableExists(connector, getVerticesTableName(config.getTableNamePrefix()), 1, config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getEdgesTableName(config.getTableNamePrefix()), 1, config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getHistoryVerticesTableName(config.getTableNamePrefix()), config.getMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getHistoryEdgesTableName(config.getTableNamePrefix()), config.getMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); ensureRowDeletingIteratorIsAttached(connector, getHistoryVerticesTableName(config.getTableNamePrefix())); ensureRowDeletingIteratorIsAttached(connector, getHistoryEdgesTableName(config.getTableNamePrefix())); } else { ensureTableExists(connector, getVerticesTableName(config.getTableNamePrefix()), config.getMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getEdgesTableName(config.getTableNamePrefix()), config.getMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); } ensureTableExists(connector, getExtendedDataTableName(config.getTableNamePrefix()), config.getExtendedDataMaxVersions(), config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getDataTableName(config.getTableNamePrefix()), 1, config.getHdfsContextClasspath(), config.isCreateTables()); ensureTableExists(connector, getMetadataTableName(config.getTableNamePrefix()), 1, config.getHdfsContextClasspath(), config.isCreateTables()); ensureRowDeletingIteratorIsAttached(connector, getVerticesTableName(config.getTableNamePrefix())); ensureRowDeletingIteratorIsAttached(connector, getEdgesTableName(config.getTableNamePrefix())); ensureRowDeletingIteratorIsAttached(connector, getDataTableName(config.getTableNamePrefix())); AccumuloGraph graph = new AccumuloGraph(config, connector); graph.setup(); return graph; }
@Override public void truncate() { try { this.connector.tableOperations().deleteRows(getDataTableName(), null, null); this.connector.tableOperations().deleteRows(getEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getVerticesTableName(), null, null); this.connector.tableOperations().deleteRows(getExtendedDataTableName(), null, null); this.connector.tableOperations().deleteRows(getMetadataTableName(), null, null); if (isHistoryInSeparateTable()) { this.connector.tableOperations().deleteRows(getHistoryEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getHistoryVerticesTableName(), null, null); } getSearchIndex().truncate(this); } catch (Exception ex) { throw new VertexiumException("Could not delete rows", ex); } }
@Override public void truncate() { try { this.connector.tableOperations().deleteRows(getDataTableName(), null, null); this.connector.tableOperations().deleteRows(getEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getVerticesTableName(), null, null); this.connector.tableOperations().deleteRows(getExtendedDataTableName(), null, null); this.connector.tableOperations().deleteRows(getMetadataTableName(), null, null); if (isHistoryInSeparateTable()) { this.connector.tableOperations().deleteRows(getHistoryEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getHistoryVerticesTableName(), null, null); } getSearchIndex().truncate(this); } catch (Exception ex) { throw new VertexiumException("Could not delete rows", ex); } }
public void dropGraph() throws Exception { Connector connector = createConnector(); AccumuloGraphTestUtils.ensureTableExists(connector, GraphConfiguration.DEFAULT_TABLE_NAME_PREFIX); AccumuloGraphTestUtils.dropGraph(connector, AccumuloGraph.getDataTableName(GraphConfiguration.DEFAULT_TABLE_NAME_PREFIX)); AccumuloGraphTestUtils.dropGraph(connector, AccumuloGraph.getVerticesTableName(GraphConfiguration.DEFAULT_TABLE_NAME_PREFIX)); AccumuloGraphTestUtils.dropGraph(connector, AccumuloGraph.getHistoryVerticesTableName(GraphConfiguration.DEFAULT_TABLE_NAME_PREFIX)); AccumuloGraphTestUtils.dropGraph(connector, AccumuloGraph.getEdgesTableName(GraphConfiguration.DEFAULT_TABLE_NAME_PREFIX)); AccumuloGraphTestUtils.dropGraph(connector, AccumuloGraph.getExtendedDataTableName(GraphConfiguration.DEFAULT_TABLE_NAME_PREFIX)); AccumuloGraphTestUtils.dropGraph(connector, AccumuloGraph.getHistoryEdgesTableName(GraphConfiguration.DEFAULT_TABLE_NAME_PREFIX)); AccumuloGraphTestUtils.dropGraph(connector, AccumuloGraph.getMetadataTableName(GraphConfiguration.DEFAULT_TABLE_NAME_PREFIX)); connector.securityOperations().changeUserAuthorizations( AccumuloGraphConfiguration.DEFAULT_ACCUMULO_USERNAME, new org.apache.accumulo.core.security.Authorizations( VISIBILITY_A_STRING, VISIBILITY_B_STRING, VISIBILITY_C_STRING, VISIBILITY_MIXED_CASE_STRING ) ); }